After updating to PHP 5.5.9 I get the following error using apache solr views.

Notice: Undefined index: group_enabled in apachesolr_views_query->get_group_info() (line 41 of  sites/all/modules/contrib/apachesolr_views/apachesolr_views_query.inc).

After having a look the cause is a conditional check that when a group isn't defined, is throwing the error. To fix, the method just needs to be update to be:

/**
 * Build our grouping information for the query.
 */
public function get_group_info($field) {
  if (isset($field->options['group_enabled']) && $field->options['group_enabled'] == 'yes') {
    $this->grouping_info['group'] = TRUE;
 
    if (isset($this->grouping_info['groups'][$field->options['group_id']])) {
      $this->grouping_info['groups'][$field->options['group_id']] .= ',' . $field->field_alias;
    }
    else {
      $this->grouping_info['groups'][$field->options['group_id']] = $field->field_alias;
    }
  }
}

Happy to provide a patch for this one if you want it fixed and it already isn't addressed in the dev version already.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

acidpotato’s picture

Yes, please provide a patch!

jacobbednarz’s picture

Status: Active » Needs review
FileSize
951 bytes

Status: Needs review » Needs work

The last submitted patch, 2: apachesolr_views-fix-undefined-index-errors-2216779-2.patch, failed testing.

jacobbednarz’s picture

jacobbednarz’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 4: apachesolr_views-fix-undefined-index-errors-2216779-3.patch, failed testing.

MiroslavBanov’s picture

Version: 7.x-1.0-beta2 » 7.x-1.x-dev

Please provide a patch that is applicable to the latest dev version of the module.

jacobbednarz’s picture

The latest dev version does not have this issue. Might close this off and wait for it to be rolled into stable.

jacobbednarz’s picture

Status: Needs work » Closed (won't fix)
MiroslavBanov’s picture

The latest dev version does not have this issue. Might close this off and wait for it to be rolled into stable.

The latest stable (1.0-beta3) is basically same as current dev version, so it doesn't have the issue either.
I fact, the function from the issue summary public function get_group_info($field) { is not in this module, and I can't find any revision with it. I have no idea where it even comes from, but if there is no issue, than that's all I need to know.