We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • discuss.answer
    • 33968
    • 863 Posts
    As you are overriding the select query, you also now need to select the resource fields you want. Something like:

    public function prepareQueryBeforeCount(xPDOQuery $c) {
        $parent = $this->getProperty('parent');
        if (!empty($parent)) {
            $resourceColumns = array(
                'id'
                ,'pagetitle'
                ,'parent'
                ,'published'
            );
    
            $joinclass = 'modUser';
            $joinalias = 'PublishedBy';
            $c->leftjoin($joinclass, $joinalias);
            $c->select($this->modx->getSelectColumns($this->classKey, 'modResource', '', $resourceColumns));
            $c->select($this->modx->getSelectColumns($joinclass, $joinalias, 'publishedby_'));
            $c->where(array('modResource.parent:=' => $parent));
            $c->where(array('modResource.deleted' => 0));
        }
        return $c;
    }
    
    [ed. note: okyanet last edited this post 14 years ago.]
    • discuss.answer
      • 4172
      • 5,888 Posts
      and needs to be

      $c->select($this->modx->getSelectColumns($joinclass, $joinalias, 'publishedby_'));


      not

      $c->select($modx->getSelectColumns($joinclass, $joinalias, 'publishedby_'));
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 10378
        • 375 Posts
        Yes - this was it! Thank you very much!
          Freelancer @bitego http://www.bitego.com
          ---
          GoodNews - one of the most advanced and integrated Group Mailer premium add-ons for MODX Revolution!
          More infos here: http://www.bitego.com/extras/goodnews/
          • 10378
          • 375 Posts
          Thank you Bruno!
            Freelancer @bitego http://www.bitego.com
            ---
            GoodNews - one of the most advanced and integrated Group Mailer premium add-ons for MODX Revolution!
            More infos here: http://www.bitego.com/extras/goodnews/