I'm getting an error that $bfield isn't set. The error goes away if I add the following line. I don't think the patch is necessarily the right solution, I just think it works for me. :)

CommentFileSizeAuthor
bfield.patch824 bytesemmajane

Comments

irakli’s picture

I assume you have error_level set to notice and that's what is "causing" this? Not trying to excuse me coming short on testing the module with notice level, just making sure there's not any other problem :)

Thank you

emmajane’s picture

My error reporting settings in /etc/php5/apache2/php.ini are as follows:

error_reporting = E_ALL & ~E_NOTICE

enboig’s picture

the problem is at:

    /** Add all other fields into count, to make sure they do not mess up group_by **/
    if (is_array($this->query->fields)) {
      foreach ($this->query->fields as $key => $field) {
        if ( !in_array($key, $to_group) &&
             !in_array($key, $to_aggregate) ) {

             if ($key != $bfield) {
              unset($this->query->fields[$key]);
             }             
        } 
        else if (in_array($key, $to_aggregate)) {
            $this->query->fields[$key][$sql_func] = TRUE;
            $this->query->fields[$key]['alias'] = $key;
        }
      }
    }

because $bfield is not set.

Otherwise, I think there is a problem in this: $bfield should contain the "key" field and it should be:

  if ($key == $bfield) {
    unset($this->query->fields[$key]);
  }
irakli’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.