Jump to:

10993 Posts in 2727 Topics by 1818 members

All other Modules

SilverStripe Forums » All other Modules » Subsites Modules - Problems + Bugs ... and how i overcame them (so far)

Discuss all other Modules here.

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

Page: 1 2
Go to End
Author Topic: 4411 Views
  • BSirius
    Avatar
    Community Member
    3 Posts

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

    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

  • silverseba
    Avatar
    Community Member
    26 Posts

    Re: Subsites Modules - Problems + Bugs ... and how i overcame them (so far) Link to this post

    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...

  • warwick
    Avatar
    Community Member
    13 Posts

    Re: Subsites Modules - Problems + Bugs ... and how i overcame them (so far) Link to this post

    Hi BSirius

    Thanks for your post.

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

  • Ingo
    Avatar
    Forum Moderator
    801 Posts

    Re: Subsites Modules - Problems + Bugs ... and how i overcame them (so far) Link to this post

    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?

  • silverseba
    Avatar
    Community Member
    26 Posts

    Re: Subsites Modules - Problems + Bugs ... and how i overcame them (so far) Link to this post

    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'.

  • ulysses
    Avatar
    Community Member
    57 Posts

    Re: Subsites Modules - Problems + Bugs ... and how i overcame them (so far) Link to this post

    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

  • silverseba
    Avatar
    Community Member
    26 Posts

    Re: Subsites Modules - Problems + Bugs ... and how i overcame them (so far) Link to this post

    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.

  • ulysses
    Avatar
    Community Member
    57 Posts

    Re: Subsites Modules - Problems + Bugs ... and how i overcame them (so far) Link to this post

    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?

    4411 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.