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.
Upgrading from media-2.0-alpha4 to media-2.x-dev resulted in all images are replaced with false after saving or switching to plain text mode.
These images only have a data-fid attribute and not using the new placeholder format.
See attached patch for the fix.
Comment | File | Size | Author |
---|---|---|---|
media_wysiwyg.filter.js_.patch | 1.63 KB | Anonymous (not verified) | |
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #2
Devin Carlson CreditAttribution: Devin Carlson commentedComment #3
theMusician CreditAttribution: theMusician commentedI am experiencing this as well. However the files I have turning to "false" are those that have a data-file_info attribute.
Here is an old file that now renders as false.
<img width="500" height="279" typeof="foaf:Image" title="" style="width: 220px; height: 123px; border-width: 1px; border-style: solid; margin: 5px 10px; float: right;" src="http://website.com/sites/website.com/files/path/filename.png" data-file_info="%7B%22fid%22:%223819%22,%22view_mode%22:%22default%22,%22fields%22:%7B%22format%22:%22default%22,%22field_file_image_alt_text%5Bund%5D%5B0%5D%5Bvalue%5D%22:%22%22,%22field_file_image_title_text%5Bund%5D%5B0%5D%5Bvalue%5D%22:%22%22,%22field_folder%5Bund%5D%22:%22559%22%7D,%22type%22:%22media%22,%22link_text%22:null%7D" class="media-element file-default" alt="">
Now a new one that renders just fine.
<p><a href="/node/3271">[[{"fid":"4348","view_mode":"preview","fields":{"format":"preview","field_folder[und]":"_none"},"type":"media","attributes":{"alt":"CF2irWRvV_4","style":"height:100px; width:100px","class":"file-preview media-element"}}]]</a></p>
The attached patch if I am reading it correctly seems to look for file_info and if it isn't there it assigns it fid.
I wonder if something else is causing exisiting images to be rendered as false?
Comment #5
Dave ReidComment #6
Chris Matthews CreditAttribution: Chris Matthews as a volunteer commentedClosing this issue as outdated. However, if you think this issue is still important, please let us know and we will gladly re-open it for review.
sincerely,
- the Drupal Media Team