Roles Moderators Fatal error:

hey there! i was excited to see the roles/modeators and ran it ( as well as Roles) what happened next was my fault i think. i make user ☠PurplePoision☣ (i think the ☠ ☣ may have hurt?) a admin, then lodded in as ☠PurplePoision☣ and set role to moderator. instantly i got a crash, error

Fatal error: Call to a member function getName() on a non-object in /home/mrcoffee/public_html/mod/roles/lib/roles.php on line 394

Line 394 reads
            if ($menu[$index]->getName() === $item_name) {

currently other members can view site, but i cant. so any ideas on how to fix this mess?

  • upgrade.php let me view site again.. but now i get

    Fatal error: Call to a member function getName() on a non-object in /home/mrcoffee/public_html/mod/roles/lib/roles.php on line 394

  • @mrcoffee This has already been reported by two other community members, but I still could not reproduce it. What exact Elgg version are you using? Did you try this with only core and roles plugin enabled, and any other 3rd party plugins disabled?

  • elgg 1.8.3, thank you for your intrst in the problem!

    moderators would be extreamly helpfull. the account that was given Mod acess can not be loggin in.

    yes, same errors. you may look at my system files if it helps.. pm me,

    im quite new to elgg. i do love the plugin idea though!

  • Hi Andras,

    I had the same problem, but when I deactivated my theme (bright theme) it worked. Maybe you will be able to reproduce it.

    http://community.elgg.org/pg/plugins/release/849007/developer/easy82/bright-theme-for-elgg-18

    I think it has something to do with the System Messages, like: "You don't have access to this page..". Or with the forward part.

    My question is: Why is the only thing working in the code below: The deny of seeing Members site, when being af Visitor on my site..?

            VISITOR_ROLE => array(
                'title' => 'roles:role:VISITOR_ROLE',
                'extends' => array(),
                'permissions' => array(
                    'actions' => array(
                    ),
                    'menus' => array(
                        'site::members' => array('rule' => 'deny'),
                        'site::photos/all' => array('rule' => 'deny'),
                        'page::blog' => array('rule' => 'deny'),
                        'site' => array( // 2nd menu rule
                          'rule' => 'deny',
                          'menu_item' => array(
                            'name' => 'file',
                            'text' => 'Files',
                            'href' => 'file/all',
                          )
                        )
                    ),
                    'views' => array(
                    ),
                    'hooks' => array(
                    ),
                ),
            ),

     

  • same problem here! disable Theme and all works.

  • Folks, there is a new version of the Roles plugin that hopefully fixes this issue. Please ugrade to version 1.0.2 available here. Any feedback is appreciated.