I am using Media Module 7.x-2.0-unstable 6 & File Entity 7.x-2.0-unstable6
The Log Messages shows me following error:

Unable to render media from {"type":"media","view_mode":"media_original","fid":"26","attributes":{"alt":"","class":"media-image","height":"330","width":"260"}}. Error: Could not load media object

Only one node causes this problem. I think a used the Media Module with the WYSIWYG Editor and removed the file because I dont need it anymore. The node now contains no media files. It´s pure text.

How can I get rid of the problem? It´s a very important node and my Log Messages are full of that.

thanks in advance!

Comments

Kristen Pol’s picture

I'm seeing this as well with those unstable6 versions.

Dave Reid’s picture

Category: bug » support

This typically means that the file entity no longer exists (was deleted). You should edit the raw version of the text field (turn off or disable the WYSIWYG temporarily), and remove the media tags that reference that FID.

Goekmen’s picture

I have deleted all fields (everything is empty) and turn off the editor but I still have the error in the logs.

Goekmen’s picture

I have some referenced nodes to this special node.
Every node connected to this node output this error messages.

Can I upload a new image and edit the fid manually in the MySQL Database?

dddave’s picture

Version: 7.x-2.0-unstable6 » 7.x-2.x-dev

#1676780: Uploaded media file disappears after node save marked as dupe although it seems to be a bigger issue for him.

Setting to dev as I am too seeing this from time to time.

dasfuller’s picture

Issue summary: View changes

Any movement on this issue? We just experienced it with Media 7.x-2.0-alpha2 and File Entity 7.x-2.0-alpha3.

Unable to render media from {"fid":"21080","view_mode":"default","fields":{"format":"default"},"type":"media","attributes":{}}. Error: Could not load media object

This happened for all three media elements embedded in the single node's description.

MediaFormat’s picture

Category: Support request » Bug report

Media 7.x-2.0-alpha4
File Entity 7.x-2.0-beta1.

This typically means that the file entity no longer exists (was deleted). You should edit the raw version of the text field (turn off or disable the WYSIWYG temporarily), and remove the media tags that reference that FID.

This was happening even though the file entity was not deleted.

It seems that media has trouble escaping characters in the alt field.

The following contains single and double quotes. Though not visible here, the first double-quote was triple escaped and the last quote unescaped.

Unable to render media from {"fid":"107","view_mode":"default","fields":{"format":"default","field_file_image_alt_text[und][0][value]":"","field_file_image_title_text[und][0][value]":"","field_tags[und]":""},"type":"media","attributes":{"alt":"Est-ce qu'il m'apporte différents points de vue sur la question? Des solutions dans la section \\\"Objectvité de l'information"","height":300,"width":700,"class":"media-element file-default"},"link_text":null}. Error: No file Id

Edited for clarity.

nickBumgarner’s picture

I'm running into this problem anytime I add a link to my media image via WYSIWYG's Media Uploader interface. It won't display the image and I'm getting the same issue.

charnibp’s picture

I'm having a very similar issue and getting the same error in my logs.

My modules:
Media 7.x-2.0-alpha4
File Entity 7.x-2.0-beta1

Steps to reproduce:

  1. In basic content page, embed media within the RTE (in this example, my media is a Youtube video, using Media:Youtube)
  2. Save
  3. Visit content page
  4. Page doesn't load, error in Drupal log:

    Unable to render media from {"fid":"1254","view_mode":"default","type":"media","attributes":{"class":"media-youtube-video media-youtube-1 media-element file-default"}}. Error: Could not lo

The only way I can stop this error from happening is removing the media reference from the body text of the node (manually in the database), and clearing the drupal cache. Clearing the cache is a very important step to get it working again! Unfortunately, this means I am unable to embed media items in my content without a fix!

martinwrightinfo’s picture

I'm also having this issue. The image appears when I'm editing then when I click save, it disappears.

I've have to switch to a plain text editor and remove the alt and title info from the media embed code.

But is I edit the node again alt and title get automatic put back in. then the image disappears again.

PraetorianFX’s picture

Issue summary: View changes

#7 was happening to me... yes bug with esc character for alt text, title text..

especialy for double quote char..

thx in advance..

PraetorianFX’s picture

Issue summary: View changes
PraetorianFX’s picture

#7 was happening to me... yes bug with esc character for alt text, title text..

especialy for double quote char..

thx in advance..

michaelmallett’s picture

We also get this almost randomly ever since updating media to 7.x-2.0-alpha4. Clearing the cache returns it to normal, but bizarrely I can't seem to find any media errors for those pages in the logs.

However, in our case, instead of just disappearing, it outputs the media object itself to the page. It's really strange as the issue just appears again a seemingly random time later.

PatchRanger’s picture

According to https://www.drupal.org/node/2378315#comment-9707471 , it looks like the issue is related to "Convert Media tags to markup" feature. Disabling it at admin/config/content/formats/full_html looks to eliminate the annoying log message appearing. So I guess we need to look deep into the converting Media tags code - the root of the issue is definitely there.

Rob_Feature’s picture

I'm still seeing this in the latest dev of both media and file entity. The majority of our wysiwyg embedded media disappears when viewing the node (due to a bug somewhere in the input filter, I guess)

Rob_Feature’s picture

Component: Code » Media WYSIWYG
Priority: Normal » Major

Folks may disagree, but I'm going to mark this as 'major' since it is completely preventing images we're putting into the wysiwyg from appearing (ie. the filter just doesn't work as it should). In our case, there's a 'caption' field on the file entity. If this field has any html in it, it breaks the display as mentioned in this issue.

jpoesen’s picture

Just seconding #17 here: we have a caption field on file entities too.
As soon as someone adds a simple html link in the caption field, which is often done to refer back to copyright holders, it breaks.

michaelmallett’s picture

Sorry for the late follow up to mine, we solved this because it seemed the update had disabled the convert media tags checkbox. We were also behind a couple of caching layers so when that was being enabled again, one of the layers wasn't clearing and we ended up with a cached json object on the page. Fully clearing the caching solved the issue with the checkbox enabled for us.

Rob_Feature’s picture

For the record (at least in my case): I found that if you leave 'www' out of any links you put into the caption field, then the image appears and links work correctly. Yeah..wacky. But it works for us!

brockfanning’s picture

@Rob_Feature: I don't know if you're using Ckeditor, but this issue might be relevant for your problem: #2720997: Overridden filtered-text fields not encoded in token