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

davidee’s picture

Assigned: davidee » Unassigned
davidee’s picture

Priority: Major » Normal
criznach’s picture

I'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.

davidee’s picture

The 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!

davidee’s picture

I 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.

davidee’s picture

Does anyone have a solution? It would be so nice if anyone knows more about this!
Thanks

omnia.ibrahim’s picture

i'm having the same error is it fixed?

fugazi’s picture

same problem

kappaluppa’s picture

Issue summary: View changes

I"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)

fraweg’s picture

Hello,

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

ttronslien’s picture

I 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){
.......
}

RavindraSingh’s picture

Status: Needs work » Needs review

This 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.

  • zengenuity committed 42e61fe on 7.x-1.x
    Issue #1977556: Bug: Trying to get property of non-object in...
zengenuity’s picture

Status: Needs review » Fixed

I've still not been able to replicate this, but I committed some changes as discussed in #11.

Status: Fixed » Closed (fixed)

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

mibfire’s picture

Status: Closed (fixed) » Active

The 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

        $type_info = node_type_load($item_type);
        $items['node/%node_gallery_api_gallery/upload/' . $item_type] = array(
          'title' => $type_info->name,
          'page callback' => 'node_gallery_api_upload_items_form',
          'page arguments' => array(1, $item_type),
          'access callback' => 'node_gallery_api_upload_access',
          'access arguments' => array(1, $item_type),
          'file' => 'node_gallery_api.pages.inc',
          'weight' => -2,
          'type' => (empty($item_types)) ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK,
        );

should be the below:

        $type_info = node_type_load($item_type);
        if ($type_info) {
          $items['node/%node_gallery_api_gallery/upload/' . $item_type] = array(
            'title' => $type_info->name,
            'page callback' => 'node_gallery_api_upload_items_form',
            'page arguments' => array(1, $item_type),
            'access callback' => 'node_gallery_api_upload_access',
            'access arguments' => array(1, $item_type),
            'file' => 'node_gallery_api.pages.inc',
            'weight' => -2,
            'type' => (empty($item_types)) ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK,
          );
        }

  • zengenuity committed d5fb7ae on 7.x-1.x
    Issue #1977556: Bug: Trying to get property of non-object in...
zengenuity’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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