In modules/taxonomy/views_plugin_argument_default_taxonomy_tid.inc option_definition defines 'vids' as NULL by default. This causes a foreach warning when drupal form api process #default_value of this form:

    $form['vids'] = array(
      '#prefix' => '<div><div id="edit-options-vids">',
      '#suffix' => '</div></div>',
      '#type' => 'checkboxes',
      '#title' => t('Vocabularies'),
      '#options' => $options,
      '#default_value' => $this->options['vids'],
      '#process' => array('expand_checkboxes', 'views_process_dependency'),
      '#dependency' => array(
        //'edit-options-argument-default-taxonomy-tid-limit' => array(1),
        'edit-options-argument-default-taxonomy-tid-node' => array(1),
      ),
    );

This patch is not needed in 2.x

CommentFileSizeAuthor
views-vocabulary-arg-notice.patch912 bytesdagmar

Comments

macdee’s picture

I don't know if this is related. I couldn't find a matching issue in the 6.x.2.x-dev queue which was the version I was experiencing a problem with and the problem I experienced still exists, at least in my environment, in the April 10 release of that, so this probably belongs there.

However, that said, the 6.x.3.x-dev code is similar in this respect and this is the only place I see any reference to problems with the views_plugin_argument_default_taxonomy_tid.inc file so I'm just throwing this idea out for your consideration.

Disclaimer: Feel free to discard this remedy as the only thing that's common seems to be the file involved and that it has something to do with the default state. I haven't used the 6.x.3.x-dev code yet.

I was having problems with views_plugin_argument_default_taxonomy_tid.inc but in my case I was getting a default argument not found when trying to create a taxonomy argument in views2. I can't remember if there was also a foreach warning.

The fix I employed (and I had to do this again with the latest release of 6.x.2.x-dev) was to add 'parent' => 'fixed', to the function taxonomy_views_plugins() in the 'taxonomy_tid' array (after line 454 in the April 10 release of .2 dev - it would be after line 484 in .3 alpha3) in the file "taxonomy.views.inc" because the file "views_plugin_argument_default_taxonomy_tid.inc' wasn't picking up the ...extends views_plugin_argument_default part of the declaration.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Sure checkboxes needs an array as default argument.

willazilla’s picture

I followed from another issue. My Calendar data stopped showing up after I upgraded to Drupal 6.16, and I went to look at the view. There is an error: "warning: Invalid argument supplied for foreach() in .../includes/form.inc on line 1207." Is there a patch or some other action I can take to get the functionality back?

dawehner’s picture

@willazilla

The patch is there, see above.

willazilla’s picture

Thanks!!

YK85’s picture

subscribing

merlinofchaos’s picture

Status: Reviewed & tested by the community » Fixed

Commited to all 3.x branches. Thanks!

kenorb’s picture

Thanks.
It's possible to publish 6.x-3.x-dev on the project page?

dawehner’s picture

You can find the release at http://drupal.org/node/38878/release

Status: Fixed » Closed (fixed)

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