When creating a new entity reference display on a new view, and trying to edit the display settings, the following ajax error comes up.
Invalid argument supplied for foreach() in form_type_checkboxes_value()
The cause is a line in the views plugin style include that just assigns default values but does not check that tthe value is an array.

Attached patch just passes in an empty array if there is no array to assign.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yareckon’s picture

Status: Active » Needs review

it is just a warning, but still.

milos.kroulik’s picture

Thanks a lot. It works prefectly.

victory17’s picture

Patch worked great, Thanks!

Chris Matthews’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Needs reroll

The 6 year old patch to entityreference_plugin_style.inc does not apply to the latest 7.x-1.x-dev and if still relevant needs a reroll.

Checking patch views/entityreference_plugin_style.inc...
error: while searching for:
        '#title' => t('Search fields'),
        '#options' => $options,
        '#required' => TRUE,
        '#default_value' => $this->options['search_fields'],
        '#description' => t('Select the field(s) that will be searched when using the autocomplete widget.'),
        '#weight' => -3,
      );

error: patch failed: views/entityreference_plugin_style.inc:26
error: views/entityreference_plugin_style.inc: patch does not apply