When referencing fieldable file entities, the selected items are rendered incorrectly. I don't know if this is an issue with the File Entity module or Entity Reference View Widget. The first selected item renders as 4 draggable rows (one "remove" checkbox, two empty rows and one showing the rendered entity). Additional selected items show up only as "remove" checkboxes.
Structure > File types > Image > Manage File Display is set to "Image." Changing this doesn't seem to help.
Using all latest dev versions of Views, Entity API, File Entity, Entity Reference and Entity Reference View Widget
Also, I've tried this with the latest version of ERVW from the git repository, but the the problem still exists.
See attached screenshot and exported view.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | entityreference_view_widget-fix_display_of_selected_entities-1875190-2.patch | 715 bytes | jonraedeke |
| view.txt | 3.04 KB | jonraedeke | |
| screen_shot.png | 72.42 KB | jonraedeke |
Comments
Comment #1
seanrPrecisely the same issue here. jonraedeke, thanks for narrowing it down to fieldable - that gives me some good debugging ideas, which I will attempt tomorrow.
Comment #2
seanrAlready found the fix. Issue is on line 298 f the module file. Why are we doing this there?:
The second line of that is screwing up the $entity_view array so it contains only one full entity rather than the list of entities. Comment that line out and the display works perfectly.
Comment #3
jonraedeke commentedGreat work seanr! Worked for me. Here's a patch. (It's my first Drupal patch, so let me know if I did anything wrong.)
Comment #4
seanrPatch looks good to me. Don't want to mark this RTBC yet though until someone can test with a file field without extra fields.
Comment #5
bojanz commentedThe reset is definitely needed for some entity types so the proposed fix is wrong.
Comment #6
bojanz commentedSince there is no working patch, and the 1.x branch is no longer maintained, marking this as "won't fix".
Please use the 2.x branch instead. It should not have the described problem. Thank you for your patience.