We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37054
    • 93 Posts
    In my Xodus addon I am using the modObjectGetListProcessor class to return a list of users in a particular group. However the class seems to be limiting the results to 20. I have tried to remove this limit in the prepareQueryBeforeCount method to no avail.

    public function prepareQueryBeforeCount(xPDOQuery $c) {
            $usergroup = (int)$this->getProperty('group',0);
    		$c->innerJoin ('modUserProfile','Profile');
    		$c->innerJoin ('modUserGroupMember','UserGroupMembers');
    		$c->innerJoin ('modUserGroup','UserGroup','`UserGroupMembers`.`user_group` = 		`UserGroup`.`id`');
    		$c->leftJoin ('modUserGroupRole','UserGroupRole','`UserGroupMembers`.`role` = `UserGroupRole`.`id`');
            $c->where(array(
    			'active' => true,
    			'UserGroupMembers.user_group' => $usergroup,
    		));
    		$c->select(array('modUser.id','modUser.username','modUser.password'));
    		$c->limit(0);
            return $c;
        }
    


    My question therefore is, is it possible to remove this limit with the list processor and if so, how?
      • 18373 ☆ A M B ☆
      • 3,141 Posts
      It will set the limit right after that method iirc.

      You could set it in prepareQueryAfterCount, or try $this->setProperty('limit', 0); in your ..BeforeCount().
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 37054
        • 93 Posts
        Great Mark thanks!
          • 37054
          • 93 Posts
          Just a quick update on this to say that even with Mark's suggested changes above the limit was still being applied. Thanks to some great work from Justin Vogel via Github we have a solution - from Justin:

          I moved the call earlier in the event chain, to beforeQuery, which modifies the the limit property prior to modProcessor calling the getData() method. Tested it and that works for getting rid of the limit and keeps the code within the processor.

          https://github.com/freelancewebdev/xodus/pull/1
            • 37031
            • 93 Posts
            Quote from: freelancewebdev at Mar 07, 2013, 05:23 AM
            Just a quick update on this to say that even with Mark's suggested changes above the limit was still being applied. Thanks to some great work from Justin Vogel via Github we have a solution - from Justin:

            I moved the call earlier in the event chain, to beforeQuery, which modifies the the limit property prior to modProcessor calling the getData() method. Tested it and that works for getting rid of the limit and keeps the code within the processor.

            https://github.com/freelancewebdev/xodus/pull/1

            This helped me immensely! Thank you for following up with the topic! smiley