Ok, searched this forum and Google from the back to the front on how to get this usefull module working.
For now, after getting the SVN trunk of subsite to the root directory of my Silverstripe installation i get the same error over and over again when i try to run /db/build?flush=1:
Fatal error: DataObject::buildSQL: Can't find data classes (classes linked to tables) for Subsite in /var/www/vhosts/lodown.nl/httpdocs/SilverStripeSite/sapphire/core/model/DataObject.php on line 1430
I tried the hack of Carnal mentioned in his post at http://www.silverstripe.com/extending-hacking-silverstripe-forum/flat/37125?showPost=128586 and commented some lines out in the _config.php
Greatfully the /db/build worked after applying his hack, but i got the feeling that the module doesn't install properly, isn't it? For example there are no changes made by the build process to the table Groups.
So i ended up now with a big ? What do i have to do, to get the module installed properly on my Silverstripe 2.2.2 (a question i've read from quite a people on this forum :-)) ??? Any helping hand?
For the record, i also found this post of Racc, which seems to have installed the module without any problems at all... how?? http://www.silverstripe.com/site-builders-forum/flat/127215
[edit 15:26] Ok, found out that only the Object::add_extension('Group', 'GroupSubsites'); has to be commented out to get /db/build giving a positive result, so there should be the problem for me, anyone any idea where to look for?
[edit 15:54] Well, added the column SubsiteID (int(11), not null default '0') to the table "groups" manually and added an index to it. Now i can remove the comment for Object::add_extension('Group', 'GroupSubsites'); and call the website without any errors.
After entering the CMS i can't find the "subsites"-menu tab, so up to the next issue :-) Any input on this one?
[edit 03-08-08] After i searched for something like a rights problem i discovered that the daily build of Silverstripe had a bug concerning setting rights to groups (rights are set to groupID=0 instead of groupID= id group editted) i installed the latest stable download from the website, did the things above to get Subsites running and voila, "Sub-sites" appears into the CMS menu :-) Can some explain how to assign templates to individual subsites?
After i added a new subsite (my first), silverstripe crashes with an error:
FATAL ERROR: DataObject::get_by_id passed a non-numeric ID #
At line 1669 in /var/www/vhosts/lodown.nl/httpdocs/SilverStripeSite3/sapphire/core/model/DataObject.php
user_error(DataObject::get_by_id passed a non-numeric ID #,512)
line 1669 of DataObject.php
DataObject::get_by_id(Subsite_Template,)
line 101 of SubsiteAdmin.php
SubsiteAdmin->addintranet(Array,Form)
line 238 of Controller.php
Controller->run(Array)
line 104 of Director.php
Director::direct(/admin/subsites/)
line 158 of main.php
Context
Debug (Debug::showError() in line 180 of Debug.php)
* callerClass =
Subsite_Template
* id =
Fatal error: Call to a member function createInstance() on a non-object in /var/www/vhosts/lodown.nl/httpdocs/SilverStripeSite3/subsites/code/SubsiteAdmin.php on line 113
Great, but after adding manually a record to Subsite like Sam discribed above, i'm able to successfully add more subsites and templates :-) But, now the dropdown at the top right is missing, needed to switch the trees for the different subsites. I discovered that ?flush=1 or manually deleting the cache content located in /tmp does miracles, and in this case it did, the dropdown shows up :-)
I'm curious how to add different templates to the different subsites. The definition of "Template" within the module configuration is another one than "template" as the visualisation of your website, it's only a way to quickly create subsites from default settings.
Sam and other users, how do i set the allowed_themes and allowed_domains for the module?