Problem/Motivation

In media_wysiwyg.filter.js, info.link_text can contain HTML entities which do not get replaced correctly. In our case we have a custom download link using theme_file_entity_download_link(). Inserting media works as expected but when switching source in CKEditor or reloading the page, the link_text markup contains HTML entities.

Proposed resolution

A simple solution is to use a technique as in attached patch, but that can be insecure with older versions of jQuery.

I also noticed in #2833205 related problems and there seems to be a Drupal.media.formatForm.escapeFieldInput() function specifically for overriding input, but I'm not sure if this applies here.

Remaining tasks

Review and test, or propose a different solution.

User interface changes

None.

API changes

None.

Data model changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

askibinski created an issue. See original summary.

askibinski’s picture

Component: Code » Media WYSIWYG
Status: Active » Needs review
FileSize
641 bytes
JoshaHubbers’s picture

Patch for v2.1

Status: Needs review » Needs work

The last submitted patch, 3: allow_for_decoding_html-2903528-2-v2.1.patch, failed testing. View results

Chris Matthews’s picture

Status: Needs work » Closed (outdated)

Recent versions of media have resolved most of peoples concerns and is compatible with entity translation, multilingual and various advanced configurations. Due to the high volume of inactive and most often irrelevant issues we are Closing this as (outdated). If for whatever reason this issue is important to you AND you still have issues after checking the media recipe documentation, then let us know and we will review your concerns.

Otherwise, see the recipe documentation for how to configure media and for troubleshooting tips OR refer to the media_dev distribution if you want to see a working media setup.

As mentioned, feel free to make some noise in this issue if you still feel it is important to you or someone else.

Thanks,

Media team