Issue: Notice: Undefined index: summary in options_validate() prevents ajax functionality of contextual filters when creating/editing a view.
This occurs if the view is of a type that does not supply a 'summary' action for absent arguments.

views/handlers/views_handler_argument.inc

class views_handler_argument

  /**
   * Provide a list of default behaviors for this argument if the argument
   * is not present.
   *
   * Override this method to provide additional (or fewer) default behaviors.
   */
function default_actions($which = NULL) {

A module (in my case search_api) can override the default_actions function and not provide a 'summary' action.
In that case the form to define what should happen when the contextual filter argument is missing does not have the 'summary' option.
But views_handler_argument functions options_validate() and options_submit() assume $form_state['values']['options']['summary'] is present and filled.

Attached is a patch that adds an isset check to see if there are actually any summary options before using them.

Comments

Status: Needs review » Needs work

The last submitted patch, views-summary_check-1-1.patch, failed testing.

JvE’s picture

StatusFileSize
new2.75 KB
JvE’s picture

Status: Needs work » Needs review
Bojhan’s picture

Yup, this bug is showing up for me as well. I cant apply it anymore.

Bojhan’s picture

I noticed that I can bypass this bug by enabling Search API Autocomplete.

JvE’s picture

StatusFileSize
new3.03 KB

Search API Autocomplete probably adds something to the summary so it is not empty when Views tries to use it.

Did you say the patch does not apply for you?
I'll reroll it against latest dev.

das-peter’s picture

Status: Needs review » Reviewed & tested by the community

This is indeed an open issue:
While views_handler_argument::options_form uses $defaults = $this->default_actions(); to fetch the available defaults, the form handling later on simply assumes defaults.

While the patch works and looks ok I'm wondering if there isn't a better / generic solution based on $defaults = $this->default_actions();.
However, as this fixes the issue and makes the config usable again I'd say RTBC

  • dawehner committed 540f3f6 on 7.x-3.x authored by JvE
    Issue #2200141 by JvE: Fixed Notice: Undefined index: summary in...
das-peter’s picture

Status: Reviewed & tested by the community » Fixed

@dawehner Thanks a lot :)

Status: Fixed » Closed (fixed)

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