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.
Hello everybody,
I installed this very nice module Node Gallery. But i got this bug and i can't find out how to solve this:
Notice: Trying to get property of non-object in node_gallery_api_menu() (line 166 of /sites/all/modules/node_gallery/node_gallery_api.module).
I hope someone can help me!
Thanks
Comments
Comment #1
davidee CreditAttribution: davidee commentedComment #2
davidee CreditAttribution: davidee commentedComment #3
criznach CreditAttribution: criznach commentedI'm not seeing this with my install of 7.x-1.0-beta3. Can you give us some steps to reproduce? Also, a list of enabled modules would help.
Comment #4
davidee CreditAttribution: davidee commentedThe list of enabled modules:
ctools-7.x-1.3
entity-7.x-1.0
entityreference-7.x-1.0
file_entity-7.x-2.0-unstable7
libraries-7.x-2.1
plupload-7.x-1.1
views-7.x-3.7
views_slideshow-7.x-3.0
This are all the required modules to make an image slideshow (I think). That is what i want. All the modules are the latest versions.
What I did is the following: I made an new imagetype for a gallery and an new imagetype for a gallery item and made a new view to show this in a slideshow.
New problem:
I just found out that I got two more errors:
Notice: Undefined property: stdClass::$unknown in node_gallery_api_get_item_nids() (line 793 of /sites/all/modules/node_gallery/node_gallery_api.inc).
Notice: Undefined index: 46 in node_gallery_api_get_item_position() (line 825 of /sites/all/modules/node_gallery/node_gallery_api.inc).
It's very kind of you that you want to help me!
Comment #5
davidee CreditAttribution: davidee commentedI forgot to say one thing: The '46' in this error: 'Notice: Undefined index: 46 in node_gallery_api_get_item_position() (line 825 of /sites/all/modules/node_gallery/node_gallery_api.inc).' is the number of the node. And i got this error for several nodes.
Comment #6
davidee CreditAttribution: davidee commentedDoes anyone have a solution? It would be so nice if anyone knows more about this!
Thanks
Comment #7
omnia.ibrahim CreditAttribution: omnia.ibrahim commentedi'm having the same error is it fixed?
Comment #8
fugazi CreditAttribution: fugazi commentedsame problem
Comment #9
kappaluppa CreditAttribution: kappaluppa commentedI"M having he same problem and it comes up when I try to manage images in a gallery.
UPDATE: I completely uninstalled 7.x-1.xdev3 and installed 7x.1.0 and have been able to create and manage a photo gallery w/o the error or crashing my site.
(i'll be working on integrating with colorbox node, so I'll probably break it again! lol)
Comment #10
fraweg CreditAttribution: fraweg commentedHello,
I have the same problem when I use the Gallery as a block in the user account and delete one of the galleries. Did someone solve this issue?
Best regards
Frank
Comment #11
ttronslien CreditAttribution: ttronslien commentedI experience the same error and I have narrowed it down to appear when I edit/view Gallery Items that have not been associated with a gallery.
Line 498 states
$gallery_path = drupal_get_path_alias('node/' . $gallery_node->nid);
However, since the gallery item is not associated with a gallery, there is no gallery node object.
Could be fixed by surrounding the code with an if statement
if($gallery_node){
.......
}
Comment #12
RavindraSingh CreditAttribution: RavindraSingh commentedThis problem is getting resolved using latest a release of all the required module. Please do that and let me know if you are still facing same problem. I had tested on my local.
Comment #14
zengenuity CreditAttribution: zengenuity commentedI've still not been able to replicate this, but I committed some changes as discussed in #11.
Comment #16
mibfire CreditAttribution: mibfire commentedThe last dev version didnt solve the problem, but i figured out what causes this and it happens when a content type is referenced in node gallery is deleted. So there should be an if in hook_menu that checks if content type exists or not.
In node_gallery_api.module this
should be the below:
Comment #18
zengenuity CreditAttribution: zengenuity at DrupalTutor / Zengenuity commented