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.
Comment | File | Size | Author |
---|---|---|---|
#3 | allow_for_decoding_html-2903528-2-v2.1.patch | 551 bytes | JoshaHubbers |
Comments
Comment #2
askibinski CreditAttribution: askibinski as a volunteer and at ezCompany commentedComment #3
JoshaHubbers CreditAttribution: JoshaHubbers at ezCompany commentedPatch for v2.1
Comment #5
Chris Matthews CreditAttribution: Chris Matthews as a volunteer commentedRecent 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