Upon saving a contextual filter containing a taxonomy term validator, Views tries to clean up the submitted values in options_submit(). However, since some point in time, the submitted data doesn't seem to be available in $form_state anymore, but has been moved to the $options array. Hence, using a taxonomy term validator currently doesn't clean up and throws a PHP notice.

Comments

smk-ka’s picture

Status: Active » Needs review
StatusFileSize
new1.65 KB

The attached patch restores the original behavior.

dawehner’s picture

Status: Needs review » Needs work
+++ b/modules/taxonomy/views_plugin_argument_default_taxonomy_tid.incundefined
@@ -89,8 +89,8 @@ class views_plugin_argument_default_taxonomy_tid extends views_plugin_argument_d
   function options_submit(&$form, &$form_state) {
-    // Clear checkbox values.
-    $form_state['values']['vocabularies'] = array_filter($form_state['values']['vocabularies']);
+    // Filter unselected items so we don't unnecessarily store giant arrays.
+    $options['vocabularies'] = array_filter($options['vocabularies']);

options is definitive missing in this function. Please look at the parent class how the method signature is there, changing it can cause new notices as well.

smk-ka’s picture

StatusFileSize
new893 bytes

Oops, changing views_plugin_argument_default_taxonomy_tid wasn't my intention. Reverted that change.

smk-ka’s picture

Status: Needs work » Needs review
dawehner’s picture

I think the proper fix is to change options_submit here as well, because if $form_state['values']['vocabularies'] doesn't exist for argument_default_taxonomy_term as well.

This bug was caused by the UI rewrite, which changed quite some logic in the argument form.

dawehner’s picture

To get this in, really some kind of additional feedback is required.

OldAccount’s picture

The patch in #5 seems to have worked for me, also fixed http://drupal.org/node/1254548. My view still isn't working, but at least I'm not getting those warnings anymore.

dawehner’s picture

Status: Needs review » Fixed

Thanks for providing feedback on this patch. Commited to 7.x-3.x
Additional thanks for creating the report and providing a patch!

Status: Fixed » Closed (fixed)

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