Upgrading beta5 to beta6, my site got blank pages with an error:

Fatal error: Cannot use object of type stdClass as array in .../sites/all/modules/media_gallery/media_gallery.fields.inc on line 92

Comments

dhruvbaldawa’s picture

Its only because you are refering to an object of a class as an array
Can you show the line ?

Its mainly due to : $variable[$attribute] must be changed to $variable->$attribute

astra’s picture

The line 92 is $file = $item['file']; Here are a few lines before it:

89  // Prepare the referenced file entities for viewing.
90  $files = array();
91  foreach ($items as $delta => $item) {
92    $file = $item['file'];
astra’s picture

Status: Active » Fixed

First upgrade Media to 7.x-1.0-beta5, then install Media Gallery 7.x-1.0-beta6. My site works and seems no problem.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.