Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#4 | apachesolr_views-fix-undefined-index-errors-2216779-3.patch | 944 bytes | jacobbednarz |
Comments
Comment #1
acidpotato CreditAttribution: acidpotato commentedYes, please provide a patch!
Comment #2
jacobbednarz CreditAttribution: jacobbednarz commentedComment #4
jacobbednarz CreditAttribution: jacobbednarz commentedComment #5
jacobbednarz CreditAttribution: jacobbednarz commentedComment #7
MiroslavBanov CreditAttribution: MiroslavBanov commentedPlease provide a patch that is applicable to the latest dev version of the module.
Comment #8
jacobbednarz CreditAttribution: jacobbednarz commentedThe latest dev version does not have this issue. Might close this off and wait for it to be rolled into stable.
Comment #9
jacobbednarz CreditAttribution: jacobbednarz commentedComment #10
MiroslavBanov CreditAttribution: MiroslavBanov commentedThe 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.