Problem/Motivation

Currently only single-value fields will show up in the pop-up "format form" that editors use to configure embedded media. Multi-value fields will not show up in this form, even if they are set to "Override in WYSIWYG". However, there is actually code in the module now that provides some support for multi-value fields. So we're losing out on a nice bit of functionality that's already working.

The only catch is that is doesn't work for ALL field widgets. I haven't tested everything, but in my testing it DOES work for the more common widgets, like text areas, text fields, select lists, and checkboxes. But I did notice at least one example where it did NOT work: autocomplete taxonomy term references.

Proposed resolution

Rather than keep this functionality hidden just because it doesn't work on all field widgets, I propose we make it configurable, the same as was done for the field types themselves. An additional checkbox for "Allow multi-value fields to be overridden in WYSIWYG" would be fine. It should default to FALSE so that nobody gets surprised by a change in behavior.

Remaining tasks

Write a patch.
Review patch.

User interface changes

New checkbox option on /admin/config/media/browser to allow this feature. If checked, multi-value fields allowed in the media_wysiwyg's format form.

API changes

None.

Data model changes

This will have an effect on future embedded media tokens, in that the code that is supporting multi-value fields will actually be used. So we should test this thoroughly.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

brockfanning created an issue. See original summary.

brockfanning’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
2.65 KB
brockfanning’s picture

FileSize
3.37 KB

Tweaked the comments in the section of code that actually supports multi-value fields. (it was specifically referencing "multi-value select lists" but actually applies to any type of field).

For reference and testing, that code is in the Drupal.media.formatForm.getOptions() function in media_wysiwyg.format_form.js.

brockfanning’s picture

I've been manually testing this as part of #2832540: WYSIWYG encoding/token issues - general approach, and have not seen any regressions for either the Media CKEditor module or WYSWIYG module approaches.

brockfanning’s picture

Status: Needs review » Reviewed & tested by the community
joseph.olstad’s picture

Status: Reviewed & tested by the community » Fixed

commit to follow shortly, release to follow shortly

Status: Fixed » Closed (fixed)

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