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.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | views-check_summary-2200141-6.patch | 3.03 KB | JvE |
| #2 | views-summary_check-2200141.patch | 2.75 KB | JvE |
Comments
Comment #2
JvE commentedComment #3
JvE commentedComment #4
Bojhan commentedYup, this bug is showing up for me as well. I cant apply it anymore.
Comment #5
Bojhan commentedI noticed that I can bypass this bug by enabling Search API Autocomplete.
Comment #6
JvE commentedSearch 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.
Comment #7
das-peter commentedThis is indeed an open issue:
While
views_handler_argument::options_formuses$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
Comment #9
das-peter commented@dawehner Thanks a lot :)