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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

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

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


Go to End


14 Posts   6624 Views

Avatar
BSirius

Community Member, 3 Posts

9 January 2009 at 6:47am

Edited: 09/01/2009 6:50am

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 http://localhost/silverstripe/db/build?flush=1 to see the subsite item left of the helm menu when calling the admin section at http://localhost/silverstripe/admin/

Setup:
When opening the subsite section under http://localhost/silverstripe/admin/subsites/
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

Community Member, 26 Posts

3 February 2009 at 1:50am

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

Community Member, 13 Posts

3 February 2009 at 10:08pm

Hi BSirius

Thanks for your post.

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

Avatar
Ingo

Forum Moderator, 801 Posts

9 February 2009 at 8:32am

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

Community Member, 26 Posts

9 February 2009 at 9:48pm

Edited: 09/02/2009 9:50pm

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 http://www.silverstripe.org/assets/downloads/SilverStripe-v2.3.0-rc3.tar.gz
2. Install genericdataadmin module (Daily Build) by placing the folder "genericdataadmin" in the root folder of SilverStripe http://doc.silverstripe.com/doku.php?id=modules:genericdataadmin
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 (http://doc.silverstripe.com/doku.php?id=modules:subsites). 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

Community Member, 57 Posts

16 February 2010 at 12:55am

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

Community Member, 26 Posts

16 February 2010 at 1:17am

Edited: 16/02/2010 1:19am

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

Community Member, 57 Posts

16 February 2010 at 1:24am

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