English (United Kingdom)
Jms Multi Site, formerly joomla multisite.
Create, share multiple joomla sites in few clicks !
Message
  • EU e-Privacy Directive

    This website uses cookies to manage authentication, navigation, and other functions. By using our website, you agree that we can place these types of cookies on your device.

    View e-Privacy Directive Documents

Welcome, Guest
Please Login or Register.    Lost Password?

About create slave site problem based on template
(1 viewing) (1) Guest
Go to bottomPage: 12
TOPIC: About create slave site problem based on template
#4768
Re:About create slave site problem based on template 14 Years, 5 Months ago Karma: 0
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 !
nagyjozsef
Fresh Boarder
Posts: 1
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#4772
Re:About create slave site problem based on template 14 Years, 5 Months ago Karma: 54
You can NOT put such code in this source that might be used by ALL the Multisites extensions (not only JMS Multisites)

If you want to modify the code, do it in the source that create the DB and not on the one that establish the DB connection.

If you had a look in the source where we make the DB, you would have see that we already performed such kind of test before.
edwin2win
Moderator
Posts: 5370
graph
User Offline Click here to see the profile of this user
Last Edit: 2010/07/12 18:02 By edwin2win.
The administrator has disabled public write access.
 
Go to topPage: 12
get the latest posts directly to your desktop
2Win, Multisite(s) are trademarks of Edwin2Win.
Joomla