We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17838
    • 82 Posts
    Hello,

    I use MemberCheck snippet in a chunk as it’s shown here:

    View at EasyCaptures.com

    It returns &default chunk instead of &chunk chunk (private one).

    Here’s a fragment of problematic code (modified):
                $check = $this->modx->isMemberOfWebGroup(array ('SuperadminsUG')); // <-- this returns FALSE
    	    // $check = $this->modx->isMemberOfWebGroup($groups);
    	    $o .= 'check = '.$check.' '; // DEBUG <-- FALSE
    	    $o .= 'userlogedin = '. $this->modx->user->username .' '; // DEBUG <-- returns 'superadmin'
                $chunkcheck = $this->modx->getChunk($chunk);
                $defaultcheck = $this->modx->getChunk($this->config['default']);


    As I checked: when isMemberOfWebGroup function is invoked, $_SESSION[’webUserGroupNames’] is undefined and that causes function to return ’false’;
      • 28215
      • 4,149 Posts
      Can you file a bug and a fix here?

      http://svn.modxcms.com/jira/browse/ADDON

      Prefix the name of the bug with [MemberCheck]. Thanks for catching this.
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 17838
        • 82 Posts
        Ok, but I have no fix for that.

        http://svn.modxcms.com/jira/browse/ADDON-55
          • 28215
          • 4,149 Posts
          That’s fine. Someone will fix it; just bug reports in the forums often get lost; it’s best to get them somewhere central - ergo, JIRA.
            shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com