Jump to:

5554 Posts in 1742 Topics by 1227 members

Customising the CMS

SilverStripe Forums » Customising the CMS » SS3:Extend Group

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

Page: 1 2
Go to End
Author Topic: 1449 Views
  • Reflektera
    Avatar
    49 Posts

    Re: SS3:Extend Group Link to this post

    Sad to say, the error still occurs in 3.0.2. :/

  • Reflektera
    Avatar
    49 Posts

    Re: SS3:Extend Group Link to this post

    Getting crazy over this. Would really need to upgrade to 3.0.2 but this problem makes it impossible. Tried again with a fresh install and db with the code that IOTI wrote, but I still get the singleton error. Also get the same error when I try to add a member trough the autocompleter field.

    In the singleton function in core.php, I added a "echo $className" right in the beginning. The output contained 1 "Member" more in the 3.0 installation then in later. Don't know exactly what it means, but it should mean something, right?

    If it something I do wrong, what could it be? I have no idea...

  • Reflektera
    Avatar
    49 Posts

    Re: SS3:Extend Group Link to this post

    Update. If I comment line 186 out in Group.php it works as it should. The line reads:

    $fields->push($idField = new HiddenField("ID"));

    I changed it to a textfield and its value is set in all versions (3.0.X). Havn't done any estensive testing yet but I don't se any side effects so far.

    So the question is, what does this line do and why is it messing with me?! To be continued...

  • catcher
    Avatar
    Community Member
    4 Posts

    Re: SS3:Extend Group Link to this post

    Old post, but I just encountered this.
    Looks like the "ID" field name is in use, you can get around it by renaming that field.

  • superk
    Avatar
    Community Member
    2 Posts

    Re: SS3:Extend Group Link to this post

    Hi,

    I'm using the 3.1.2 version and was still looking for a solution. Finally I managed to find it.

    I followed the stack trace and discovered that LeftAndMain.php was trying to retrieve the current page (currentPage) by calling

    $this->getRecord()

    The first thing that getRecord does is to detect the className property of the extension object.
    This is done by querying the variable $site_tree

    public function getRecord($id) {
    $className = $this->stat('tree_class');
    .
    .
    .

    So I added $site_tree to my extension manager class:

    class GroupModelAdmin extends ModelAdmin {

    public static $tree_class = 'Group';
    public static $managed_models=array(
    'Group'
    );

    public static $url_segment='groupManager';
    public static $menu_title='Group Manager';

    }

    And that solved the problem....

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