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.
After upgrading to latest media, media_gallery & file_entity 2.x on drupal 7.16, trying to view an existing gallery gives:
Notice: Undefined property: stdClass::$media_gallery_file in media_gallery_node_load() (line 254 of ...\sites\all\modules\media_gallery\media_gallery.module).
Notice: Undefined property: stdClass::$media_gallery_file in media_gallery_node_load() (line 254 of ...\sites\all\modules\media_gallery\media_gallery.module).
Warning: array_filter() [function.array-filter]: The first argument should be an array in media_gallery_view() (line 319 of ...\sites\all\modules\media_gallery\media_gallery.module).
EntityMalformedException: Missing bundle property on entity of type file. in entity_extract_ids() (line 7562 of ...\includes\common.inc).
Please any ideas? Thanks
Comment | File | Size | Author |
---|---|---|---|
#13 | media-gallery-media-file-upgrade-path-1883270-13.patch | 2.55 KB | markpavlitski |
Comments
Comment #1
zeezhao CreditAttribution: zeezhao commentedSame issue when I create a new gallery too. Image added but can't see anything when viewing the gallery. Get similar error above.
I am using dev version of 2012-12-26. Should I be using an earlier version?
Comment #2
oregonwebsiteservices CreditAttribution: oregonwebsiteservices commentedI am getting the same exact errors with Drupal 7.18 and these modules which are all current:
ACL 7.x-1.0
Calendar 7.x-3.4
CAPTCHA 7.x-1.0-beta2
CAPTCHA Pack 7.x-1.0-alpha1
Chaos tool suite (ctools) 7.x-1.2
CKEditor - WYSIWYG HTML editor 7.x-1.12
Colorbox 7.x-1.4
Content Access 7.x-1.2-beta1
Date 7.x-2.6
Entity API 7.x-1.0
File entity (fieldable files) 7.x-2.0-unstable7
Gallery formatter 7.x-1.3
Google Analytics 7.x-1.3
Libraries API 7.x-1.0
Media 7.x-2.0-unstable7
Media Browser Plus 7.x-2.x-dev (2013-Jan-03)
Media Gallery 7.x-2.x-dev (2012-Dec-25)
Media Gallery Extra 7.x-1.x-dev (2012-Jul-30)
Module Filter 7.x-1.7
Multiple forms 7.x-1.0
Node access node reference 7.x-1.22
Node access user reference 7.x-3.9
Pathauto 7.x-1.2
Plupload integration 7.x-1.0
References 7.x-2.0
Rules 7.x-2.2
Token 7.x-1.4
URL field 7.x-1.0-rc1
Views 7.x-3.5
Views Media Browser 7.x-1.0
Webform 7.x-3.18
AdaptiveTheme 7.x-2.3
AT Commerce 7.x-2.0-rc3
Help?!?
Comment #3
vthirteen CreditAttribution: vthirteen commentedsame here
Comment #4
aniebel CreditAttribution: aniebel commentedSame here. Upgraded and now not working.
Comment #5
mgth CreditAttribution: mgth commentedsame problem here
Comment #6
denddenkt CreditAttribution: denddenkt commentedSame problem here
Comment #7
camdarley CreditAttribution: camdarley commentedI may be wrong but I think the bug could be there:
In media_gallery.fields.inc,
Here, $files is filled with items, but it should be filled with file objects:
$files[$file->fid] = $file->file;
Comment #8
camdarley CreditAttribution: camdarley commentedIgnore my previous comment... there was an error in the update process from 7.x-1.x to 7.x-2.x and the gallery media field was not updated to file field.
Comment #9
wrd CreditAttribution: wrd commentedWere you able to fix the field?
Comment #10
camdarley CreditAttribution: camdarley commentedI fixed it manually in the database.
Comment #11
vthirteen CreditAttribution: vthirteen commentedhow did you do it?
Comment #12
camdarley CreditAttribution: camdarley commentedI don't remember all the steps, but basically, I changed the name and the type in field_config and field_config_instance. After that I renamed field_data_media_gallery_media table in field_data_media_gallery_file (same action for revision tables), then I created a temporary file field (with the content type UI) to see how it's structured in database... and I renamed the fields (the last three) in the table field_data_media_gallery_file as in the file field (and again, the same in the revision table). Then I cleared the cache.
Comment #13
markpavlitski CreditAttribution: markpavlitski commentedWe had the same issue when upgrading an older version to 2.x
I've attached a patch which adds a hook_update_N() function to create the new media_gallery_file field and convert all of the existing data.
Comment #14
rickdonohoe CreditAttribution: rickdonohoe commentedI've just used the patch in #13 by markpavlitski and that fixed my problems!
Comment #15
stinky CreditAttribution: stinky commented#13 didn't work for me. What did you do after you installed the patch?
Comment #16
rickdonohoe CreditAttribution: rickdonohoe commentedI Installed it, then ran the awaiting database updates with the site in maintenance mode. This fixed it for me!
Comment #17
fallenturtle CreditAttribution: fallenturtle commentedI installed it, but I don't see any awaiting database updates. Does this only work the initial time you upgrade from 1 to 2?
Comment #18
rickdonohoe CreditAttribution: rickdonohoe commentedThe patch itself should add updates, that is the sole point of it. Can you double check the patch applied correctly? If I remember correctly I may have had to manually help applying the patch, however the actual content is perfect.
@markpavlitski Could you double check that patch?
Comment #19
fallenturtle CreditAttribution: fallenturtle commentedFWIW, I manually installed the patch directly to the module on my server.
I rolled back my database to before I initially went from Media/MG to ver 2 and did and ran the update again with your patch in place. I did see the updates this time and they appeared to run fine but I'm still getting the same errors that the OP reported.
Actually the did initial get an errors about Media not being able to find the View module (which is installed) but after updating Media from Alpha 1 to todays dev release it did the upgrade fine. Would the Media modules updates not being run at the same time maybe cause the patch not to work right.
Comment #20
ansorg CreditAttribution: ansorg commentedAwesome, applied #13 and got rid of the errors. Thanks a bunch.
Can this get integrated in the code?
Comment #21
botrisWorks!
Comment #22
gaellafond CreditAttribution: gaellafond commentedThanks, patch #13 fixed it!
Comment #23
saltednutUpdate functions are always welcome! Thank you!
http://drupalcode.org/project/media_gallery.git/commit/6a94da6
Comment #25
hansvaneylen CreditAttribution: hansvaneylen commentedI updated from 7.x-1.x to 7.x-2.x-dev (2014-Jan-31 version) and experience the same issues. Each time I try to open a gallery, I get these errors :
Notice: Undefined property: stdClass::$media_gallery_file in media_gallery_node_load() (line 254 van D:\HostingSpaces\xyz\domainname\wwwroot\sites\all\modules\media_gallery\media_gallery.module).
Notice: Undefined property: stdClass::$media_gallery_file in media_gallery_node_load() (line 254 van D:\HostingSpaces\xyz\domainname\wwwroot\sites\all\modules\media_gallery\media_gallery.module).
Notice: Undefined property: stdClass::$media_gallery_file in media_gallery_node_load() (line 254 van D:\HostingSpaces\xyz\domainname\wwwroot\sites\all\modules\media_gallery\media_gallery.module).
Notice: Undefined property: stdClass::$media_gallery_file in media_gallery_node_load() (line 254 van D:\HostingSpaces\xyz\domainname\wwwroot\sites\all\modules\media_gallery\media_gallery.module).
Notice: Undefined property: stdClass::$media_gallery_file in media_gallery_node_load() (line 254 van D:\HostingSpaces\xyz\domainname\wwwroot\sites\all\modules\media_gallery\media_gallery.module).
Warning: array_filter() expects parameter 1 to be array, null given in media_gallery_view() (line 319 van D:\HostingSpaces\xyz\domainname\wwwroot\sites\all\modules\media_gallery\media_gallery.module).
EntityMalformedException: Missing bundle property on entity of type file. in entity_extract_ids() (line 7721 van D:\HostingSpaces\xyz\domainname\wwwroot\includes\common.inc).
Looking at media_gallery.install it looks like patch #13 is not included. Can I safely apply the patch to this new version? (Drupal 7.26)
Comment #26
saltednutIt looks like I messed up the original commit - I'm sorry guys.
I have fixed it: http://drupalcode.org/project/media_gallery.git/commit/65cc212
Comment #28
simovic00 CreditAttribution: simovic00 as a volunteer and commentedhello
i have the seem problem , how i applying the paych #13 ?
https://www.drupal.org/files/media-gallery-media-file-upgrade-path-18832...