Closed (duplicate)
Project:
D7 Media
Version:
7.x-1.0-beta5
Component:
User interface
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Aug 2011 at 19:51 UTC
Updated:
26 Sep 2011 at 04:19 UTC
Jump to comment: Most recent file
Comments
Comment #1
phenaproximaI was having this exact same problem. After some searching through the code, I found the problem (and the solution)!
Check out modules/media/includes/media.theme.inc, line 309:
The problem is that $variables['element']['#file'] might not be an object, which causes $variables['element']['#name'] to be NULL, rather than the filename. Change the function to look like this, and the problem goes away :)
Comment #2
phai commentedReally thanks... I hope it will be included in the new release.
Comment #3
phai commentedMmm... I don't know why... but it was necessary to add the following line
$element['#file'] = (object)$element['#file'];
to avoid a similar warning at 286.
I put it at 278:
$element = $variables['element'];
$element['#file'] = (object)$element['#file'];
I attach the new version of the file (with both the modifications) renaming it .txt.
Comment #4
arthurf commentedThe same issue (and similar fix) is posted here: http://drupal.org/node/1141374
I'm not seeing this issue on 1.x or 2.x anymore (and I'm unclear why $variables['element']['#file'] would be an array in the first place) so perhaps updating to latest dev or 2.x will fix this.
I'm closing this as a dupe but if the issue is not fixed, please post on the other issue.