Closed (duplicate)
Project:
Drupal core
Version:
7.18
Component:
node system
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
11 Mar 2012 at 16:52 UTC
Updated:
9 Mar 2013 at 09:08 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
itz_andr3 commentedI try anschinsan patch, and it works for baypass the error notice,
as described by others at the very same problem here http://drupal.org/node/1318210
the cause for this bug is unknown,
and i got this bug, on my fresh D7 complete install, and add my first link to management
Comment #2
Anonymous (not verified) commentedThis solved the bug for me as well. I can't seem to trace where the call is coming from.
Comment #3
marcingy commentedPlease describe how to replicate this issue with a core drupal install.
Comment #4
kristen polI've seen these notices as well though I'm unsure which contrib modules are the culprits in my case. I think it is always a good idea to check data being passed into a function before acting on that data even it's simply:
Here's a related issue:
#1709914: Notice: Trying to get property of non-object in node_page_title() (Zeile 2108 von /var/www/modules/node/node.module).
though there are several others in specific contrib module issue queues.
I'm not sure what the core policy is about checking data prior to using it. I always add in
empty()andisset()checks in my code.Comment #5
marcingy commentedContrib modules are responsible for working with core not the other way round. If this can't be replicated in a core in install it isn't a core bug.
Comment #6
kristen polI did look at some of the other functions and noticed that, in general, parameters are not checked for empty data. I think the error only is due to contrib modules calling the function with a null parameter so I think it makes sense to mark "works as designed".
Comment #7
mindbat commentedThis bug was still happening for me in 7.18, and it was causing links to nodes in the Management Menu (for admins) to not have any titles (the links were blank).
I've attached the patch I used to fix both the notices and the missing link titles. It checks to see if the incoming param is a number, and treats it as a node id if that's the case.
I've seen Drupal functions that take both nids and objects and respond properly to both. Seems like this function should either handle multiple inputs, or explicitly throw an exception if it gets an improper input.
Marking as needs review.
Comment #9
marcingy commentedAs per http://drupal.org/node/1477608#comment-6374472 please provide steps to recreate with a core test. Otherwise this a contrib bug that should be fixed in appropriate contribute module. Some functions do, do checks but that is when both inputs are valid.
Comment #10
rooby commentedThis seems to be a duplicate of #1697570: _menu_load_objects() is not always called when building menu trees
Feel free to re-open this if you think otherwise.
Comment #11
rix.kostenko commentedHi,
I had this error, quick fix was prefixing custom call to menu_build_tree() with @menu_build_tree().
Hardly a real solution but worked for me.