Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

All other Modules

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Subsites Modules - Problems + Bugs ... and how i overcame them (so far)


Go to End
Reply

14 Posts   4437 Views

Avatar
BSirius

9 January 2009 at 6:47am (Last edited: 9 January 2009 6:50am), Community Member, 3 Posts

Hi,

i had problems installing the subsites module and overcame them like this.
I'm using a test envoronment on osx with xampp and silverstripe 2.3.0-rc2.

Installation:

  • unziped the latest version of subsites and genericdataadmin below htdocs/silverstripe (root folder of silverstripe)
  • made a link in the root folder with

    sudo ln -s modules/genericdataadmin/tags/rc/0.1/ genericdataadmin
    sudo ln -s modules/subsites/trunk/ subsites


  • Issued a [url]http://localhost/silverstripe/db/build?flush=1[/url] to see the subsite item left of the helm menu when calling the admin section at [url]http://localhost/silverstripe/admin/[/url]

Setup:
When opening the subsite section under [url]http://localhost/silverstripe/admin/subsites/[/url]
I got the error: Notice: Trying to get property of non-object in line 113 which is this code:

112 } else {
113 return $list->First()->Title;
114 }


  • After I made a quick hack modifying the line to:

    113 return $list; //->First()->Title;


  • loading the page succeeded.
    This confimed my suspicion that the db is not proberly initialised on install and there is no trap for this kind of error, which should be.
  • After creation of the first subsite and undooing my hack, it works now.
  • However, the error comes back if i delete the last subsite. So if there is a php crack who can fix this or even a developer, great!

Cheers
Bj

Avatar
silverseba

3 February 2009 at 1:50am Community Member, 26 Posts

Thanks a lot for your documentation of your problems!

Is the only way to get subsites working, to create the system links you mentioned?
I tried to install subsites by placing the subsites folder in the SilverStripe root and flushing the database. The neccessary tables were created but the Subsites tab doesn´t show up...

Avatar
warwick

3 February 2009 at 10:08pm Community Member, 13 Posts

Hi BSirius

Thanks for your post.

I can confirm I had exactly the problems you described and your work around worked

Avatar
Ingo

9 February 2009 at 8:32am Forum Moderator, 801 Posts

The symlinking might be the problem, as the internal manifest parser might "overlook" the model classes necessary to alter the database schema. Are you experiencing these issues with 2.3-rc3 or trunk?

Avatar
silverseba

9 February 2009 at 9:48pm (Last edited: 9 February 2009 9:50pm), Community Member, 26 Posts

The subsites module is working right now - without setting symlinks. I just forgot to install the genericdataadmin module.

For everybody experiencing similar problems: Here´s how I installed subsites.

1. Install SilverStripe 2.3.0-rc3 [url]http://www.silverstripe.org/assets/downloads/SilverStripe-v2.3.0-rc3.tar.gz[/url]
2. Install genericdataadmin module (Daily Build) by placing the folder "genericdataadmin" in the root folder of SilverStripe [url]http://doc.silverstripe.com/doku.php?id=modules:genericdataadmin[/url]
3. Rebuild database by calling http://localhost/silverstripe/db/build?flush=1
4. Install subsites module by placing the folder "subsites" in the root folder of SilverStripe ([url]http://doc.silverstripe.com/doku.php?id=modules:subsites[/url]). I downloaded the trunk version in the provided zip file.
5. Rebuild database by calling http://localhost/silverstripe/db/build?flush=1
6. Go to the admin area of Silverstripe and clear the cache by calling http://localhost/silverstripe/admin?flush=1
7. The "Subsites" tab appears in the admin area

Configuration of subsites
As I wanted to use multiple domains with different pages, I configured subsites to allow setting up any domain, instead of just subdomains. To do this just enter the following code in the _config.php file of your sites folder.

mysite/_config.php

Subsite::set_allowed_domains(array(
'com',
'de'
));

This code allows you to set up any domain ending with '.com' od '.de'.

Avatar
ulysses

16 February 2010 at 12:55am Community Member, 57 Posts

I have tried installing subsites with the genericdataadmin module. when I try to access the site or run /db/build or /dev/build I get database errors regarding missing table for the sub-site.

[User Error] Couldn't run query: SELECT `Subsite`.*, `Subsite`.ID, if(`Subsite`.ClassName,`Subsite`.ClassName,'Subsite') AS RecordClassName FROM `Subsite` WHERE (`Subdomain` = 'kidsmusiccompany' AND `IsPublic` = 1) ORDER BY "Title" LIMIT 1 Table 'kidsmc_ss233.Subsite' doesn't exist
GET /

Line 401 in /home/kidsmc/domains/kidsmusiccompany.com/public_html/sapphire/core/model/MySQLDatabase.php
Source

SS 2.3.3
subsites trunk modules_subsites_trunk-r99005.zip

Avatar
silverseba

16 February 2010 at 1:17am (Last edited: 16 February 2010 1:19am), Community Member, 26 Posts

Hi ulysses,
it looks like the necessary tables of the subsites module aren´t installed.
Did you follow the steps i described in my previous post?
First install the genericdataadmin module
Then call http://yoursite.com/dev/build/?flush=1
Second install the subsites module
Then call http://yoursite.com/dev/build/?flush=1 again (This should give you some new tables called something with "Subsites")

The only other problem I could think of is that you copied the wrong subsites folder. As you are using a trunk version the folder structure should look something like this:
modules/subsites/trunk/CONTENT HERE

What you need to do is copy the "trunk" folder with all its contents to your webserver root and rename it to "subsites". Then rebuild your database.

Avatar
ulysses

16 February 2010 at 1:24am Community Member, 57 Posts

Thanks Silverseba.

I did install the module as per documentation and tried again like you suggested, i.e. genericdataadmin then db/build and then copied subsites to the server and ran db/build etc. but still get the errors.

The "trunk" folder was copied to the root of the site and renamed to subsites

any other suggestions?

Go to Top