I write this note because I've spent a few hours finding out why is not working the
SLAVE SITE CREATION FROM THE BACKEND USING A TEMPLATE function, and seems that there is a kind of bug.
JMS verson info:
JMS Version 1.2.32 (Latest available: 1.2.32)
Patches definition Version 1.2.38 (Latest available: 1.2.38)
The simptom is that afer filling all the data for creating the new site based on one of the existing templates, and submitting the form we get
"Database Error: Unable to connect to the database:Could not connect to database" message.
This message appears because the DB with newly given name or generated name based on template, is not existing at the moment the component code wants to connect to it, and unfortunatelly there is no piece of code to create it ( nor Joomla and nor JMS) after pressing the "Save" button on admin interface.
(Not really the) resolution:
/administrator/components/com_multisites/libraries/joomla/jms2winfactory.php @ line 426
instead of
if ( JError::isError($db) ) {
jexit('Database Error: ' . $db->toString() );
}
You should replace and test with:
if ( JError::isError($db) ) {
// hack begin - create non existing database
mysql_connect($host, $user, $password);
mysql_query("CREATE DATABASE $database");
// hopefully DB is created, now we can create the wanted DB object reference
$db =& JDatabase::getInstance( $options );
if ( JError::isError($db) ) {
jexit('Database Error: ' . $db->toString() );
}
// hack end
}
This code above is not the final solution, is just a try and check if works, so Guys please finalize this component.
As further tests I've made, it seems that there is the same issue with the user creation too.
Good Luck , Jozsef !
|