Scenario: use media browser to attempt to embed multiple files into same WYSIWYG one at a time. Then disable rich-text and observe that all the instances have the same fid even though they were different files.

Sample code:

<p>[[{"fid":"62","view_mode":"default","fields":{"format":"default"},"type":"media","attributes":{"class":"file media-element file-default"},"link_text":"ScreenFlow.avi"}]]</p><p>[[{"fid":"62","view_mode":"default","fields":{"format":"default"},"type":"media","attributes":{"class":"file media-element file-default"},"link_text":"Untitled.mov"}]]</span></p>

First file in this case was an AVI and second a MOV, but I haven't noticed a difference based on file type. It always seems to happen. Checked media 1.x and did not see this occur there.

If you go ahead and save the node and then view it, you see the two links each with the correct link text, but the URL of the first one gets repeated for the second one (and others if > 2), presumably because the file ID stored in the field is the first one repeated for each file you attempted to add.

Thanks...

Comments

Status:Active» Closed (cannot reproduce)

I am not able to reproduce this issue.

I embedded multiple files into the WYSIWYG, and when I disable rich-text the fid's are unique as expected.

<p>[[{"fid":"1","view_mode":"default","fields":{"format":"default","field_file_image_alt_text[und][0][value]":"","field_file_image_title_text[und][0][value]":"","media_description[und][0][value]":"","field_tags[und]":""},"type":"media","link_text":"Druplicon.large.png","attributes":{"class":"file media-element file-default"}}]]</p><p>[[{"fid":"2","view_mode":"default","fields":{"format":"default","media_description[und][0][value]":"","field_tags[und]":""},"type":"media","link_text":"MediaGallery.mp4","attributes":{"class":"file media-element file-default"}}]]</p><p>[[{"fid":"3","view_mode":"default","fields":{"format":"default","media_description[und][0][value]":"","field_tags[und]":""},"type":"media","link_text":"TheDrupalSong.mp3","attributes":{"class":"file media-element file-default"}}]]</p><p>[[{"fid":"4","view_mode":"default","fields":{"format":"default","field_file_image_alt_text[und][0][value]":"","field_file_image_title_text[und][0][value]":"","media_description[und][0][value]":"","field_tags[und]":""},"type":"media","link_text":"tux.png","attributes":{"class":"file media-element file-default"}}]]</p>

Status:Closed (cannot reproduce)» Active

I have more information I hope will help. :) Further testing shows that the problem does not occur in Firefox, where it worked with both the Aug 1 dev release and the recently released alpha. But I did see it in both on Chrome (where I initially saw it), IE 9 and Safari.

Javascript debugging in Chrome showed some weirdness with Drupal.settings.tagmap, it contained multiple references to the same file even though different files were embedded, so this may be the source of the problem.

To confirm that this was not a side effect of anything in the project where I discovered this, I also reproduced it with a fresh install of 7.23, 2.0 alpha 1 of media and file_entity, wysiwyg 7.x-2.2 and TinyMCE 3.4.4, as well as ctools, views and admin_menu.

(edit) Also, this is using the private file system, though I haven't found yet if that makes a difference.

Hope this helps -- thanks :)

I was seeing the same issue as this, in FF too. Applying the patch from here: https://drupal.org/node/2126755 fixes it except for the case where the same file is added to a page more than once (see my comment).