Search code examples
drupal-7ckeditorwysiwygdrupal-field-collection

Drupal 7 CKEditor while replacing from textarea media files are not rendering


I'm working with Drupal 7 + WYSIWYG module + CKEditor + Field Collection.

My issue is, CKEditor is not rendering the media files which is included through media browser.

Steps to reproduce:

  1. Create field collection field with unlimited occurrence.

  2. Add some text and audio/video/document file using media browser with media teaser setting.

  3. Now click "Add another item" button.

  4. That's it now new field will be added, but the previous field will only have the text you entered, the media will be gone.

My tries:

I manually included a textarea with the value

[[{"fid":"5","view_mode":"preview","fields":{},"type":"media","link_text":"video 1 test.mp4","attributes":{"class":"file media-element file-preview"}}]]

and tried to replace with CKEditor in browser CKEDITOR.replace('edit-textarea'); but the result was, my result

Any idea what is going wrong here?


Solution

  • After a long research I found one solution from here.

    The patch they provided works for me.

    https://www.drupal.org/files/issues/interdiff_8413.txt

    I will leave this question open, so that others can get some help from this.