Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Rather than selecting a file via pre-built JSON and including all the possible files via drupal_add_js(), we should rather update the media thumbnail via AJAX request like file/%file/ajax/preview.
Comment | File | Size | Author |
---|---|---|---|
#6 | media-update_thumbnail_ajax-1701914-6-7.x-2.0-beta1.patch | 555 bytes | grom358 |
| |||
#4 | interdiff.txt | 760 bytes | kim.pepper |
#3 | media-update_thumbnail_ajax-1701914-3.patch | 555 bytes | mstrelan |
#2 | media.code_.1701914-2.patch | 527 bytes | larowlan |
Comments
Comment #1
Dave ReidMaybe as a next step beyond this, we should probably be updating the entire widget for that delta once a file is selected. Say for instance that the user changes a field value on the file, which is used to determine entity access.
Comment #2
larowlanThis works for me
Comment #3
mstrelan CreditAttribution: mstrelan commentedI'm getting "Strict warning: Only variables should be passed by reference in media_file_edit_modal()" with this patch. Updated patch attached.
Comment #4
kim.pepperAttaching interdiff between #2 and #3
Comment #5
m1r1k CreditAttribution: m1r1k at Propeople (now part of FFW) for Propeople (now part of FFW) commentedWorks great for me
Comment #6
grom358 CreditAttribution: grom358 commentedPatch for 7.x-2.0-beta1 release.
Comment #7
Dave ReidComment #9
Dave ReidCommitted #3 to 7.x-2.x. Nice work everyone, that ended up being way easier than expected!