Problem/Motivation

If an entityreference field is configured with:

  • multiple target bundles and
  • the views selection filter handler is enabled by checking the 'Render Views filters as select list' box on the field settings form,

then the options list shown in views appears as:

  • array
  • array
  • array

because the options list has a bundle key and is not suitable for display as option groups in the select element.

Proposed resolution

Flatten the array using options_array_flatten() to return an array suitable for a select element.

Remaining tasks

Review and test.

User interface changes

None (unless you want to count the expected list of options being present).

API changes

None.

Data model changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

solotandem created an issue. See original summary.

solotandem’s picture

Status: Active » Needs review
FileSize
1.02 KB

Attached patch implements proposed resolution.

devad’s picture

Status: Needs review » Reviewed & tested by the community

Tested and it works. No more "arrays" around. Nice. :)

minorOffense’s picture

Status: Reviewed & tested by the community » Needs work

I need a test case for this patch before it can be committed.