Notice: Undefined property: stdClass::$nodehierarchy_menu_links in _nodehierarchy_save_node() (line 714 of sites/all/modules/nodehierarchy/nodehierarchy.module).

Comments

jumpingship’s picture

Occured when creating new group content (Organic Groups). Are there any patches for this error?

lebachai’s picture

Same error, same version. Happened when attempting to use the module to assign multiple parents to a book page. Wondered if the problem was with the content type I was assigning it to?

BenPoole’s picture

Same error, same version. It happens to me when creating a basic page. Based on the previous two comments, it doesn't seem limited to any one content type. I also got a similar error earlier when trying to create a menu, so it seems related to this similar error: http://drupal.org/node/1143328.

Also, since I installed Node Hierarchy, I can't change the weights of my menu. In most cases, after saving, it simply doesn't implement the new order. If I try moving too many items around, then saving, I can get it to throw a 500 Internal Server error.

zarudnyi’s picture

Same here.
After saving new content I get error:
Notice: Undefined property: stdClass::$nodehierarchy_menu_links in _nodehierarchy_save_node() (line 714 of /sites/all/modules/nodehierarchy/nodehierarchy.module).

Tim Jones Toronto’s picture

Issue tags: +Undefined property

I have the same problem on creating a Basic Page. Thanks.

Notice: Undefined property: stdClass::$nodehierarchy_menu_links in _nodehierarchy_save_node() (line 714 of C:\xampp\htdocs\sites\all\modules\nodehierarchy\nodehierarchy.module).


TreyeDesigns’s picture

Status: Needs review » Active

.

TreyeDesigns’s picture

Status: Active » Needs review
MrPhilbert’s picture

Status: Active » Needs review

Same here.
Disabling module till fixed.
Subscribing

MrPhilbert’s picture

Disabled Node Hierarchy Widgets and error is gone.

TreyeDesigns’s picture

I have removed it as well. I am using this module on other sites without this problem.

Also on the site I did get the error on I was not useing this Widget porition,

zarudnyi’s picture

Status: Needs review » Active
CreativeLlama’s picture

subscribe

Courtney.B’s picture

Subscribe.

jvandooren’s picture

Subscribing...

To make the error disappear, I wrapped a temporary condition around the for loop (nodehierarchy.module line 710):

<?php
if (isset($node->nodehierarchy_menu_links)) {
...
}
?>

Just to be clear: this is not a fix, just getting rid of the annoying error message :-)

jvandooren’s picture

The patch in #1168348: Warnings produced when creating nodes fixed this issue for me...

tevans’s picture

subscribing

shaisamuel’s picture

Just had a similar error after applying the patch 1168348-4.patch at #15. The error message was:
Notice: Undefined property: stdClass::$nodehierarchy_menu_links in _nodehierarchy_save_node() (line 712 of /home1/myagelef/public_html/ecologicalintl/drupal/dev/sites/all/modules/nodehierarchy/nodehierarchy.module).

I then added a line like #14, to rep the internal of the function _nodehierarchy_save_node :

if (isset($node->nodehierarchy_menu_links)) {
...
}

and the messages is gone. I am a newbe, and dont know much about how to write a patch, but this might be a code for a patch.

schnippy’s picture

Had the exact same error as shaisamuel at #14 and implemented the fix suggested but instead of bypassing the entire insert/update functionality if the variable is undefined, I went ahead and set it so the remaining functionality would work ex:

if (!isset($node->nodehierarchy_menu_links)) { $node->nodehierarchy_menu_links = array(); }

Tested this on a number of edit / create situations and it is working for non-nodehierarchy and nodehierarchy nodes, on both edit and create with the attached patch.

lightjuice’s picture

Assigned: Unassigned » lightjuice

Thanks, this fix worked perfectly and hopefully the module will address this with the next update

ronan’s picture

Status: Active » Fixed

I've put in the guard clause, but since there is no other functionality in that function if the array is empty I'm simply returning in that case rather than setting a default.

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