As a follow up to #2062721: Add a white list of file fields that can be overwritten when the file is added in the wysiwyg

It appears that sites which had the media embed code created before this was resolved still throw fatal errors when rendering WYSIWYG media elements that have multi-cardinality reference fields (ie: taxonomy reference).

For example, the following in the following, field_signage_type (unlimited cardinality taxonomy reference) causes the error, whereas field_project_gallery (single cardinality taxonomy reference) does not.

[[{"fid":"22820","view_mode":"default","fields":{"format":"default","field_file_image_alt_text[und][0][value]":"Portland Eastbank Esplanade Design by Bruce Forster and Mayer Reed","field_file_image_title_text[und][0][value]":"Portland Eastbank Esplanade Design by Bruce Forster and Mayer Reed","media_description[und][0][value]":"","field_tags[und]":"","field_materials[und][]":"11112","field_signage_type[und][]":"11229","field_sign_fabrication_methodolo[und][]":"11160","field_sign_color[und][]":"11173","field_practice_areas[und]":"6730","field_industry_verticals[und]":"6745","field_project_gallery[und]":"11180"},"type":"media","attributes":{"alt":"Portland Eastbank Esplanade Design by Bruce Forster and Mayer Reed","title":"Portland Eastbank Esplanade Design by Bruce Forster and Mayer Reed","height":500,"width":835,"class":"media-element file-default"},"link_text":null}]]

field_signage_type does not have correct array keys.

I'm guessing we can rework media_wysiwyg_filter_field_parser() to build the array properly

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

andyg5000 created an issue. See original summary.

andyg5000’s picture

Here's a patch that still triggers field_info_field whenever the array key is blank (non-numeric) as in my example above.

joseph.olstad’s picture

without having yet tested, patch does look reasonable, thanks!

joseph.olstad’s picture

Status: Needs review » Fixed

committed to 7.x-2.x dev

Status: Fixed » Closed (fixed)

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