This problem can occur when using uuid_features, in conjunction with a node access module like content_access.module. If you are exporting nodes for a content type for which access is being controlled, for following errors will occur when running cron.php from an unauthenticated client:
WD php: Notice: Trying to get property of non-object in uuid_node_features_export_render() (line 76 of [error]
/NetBeansProjects/wpg/sites/all/modules/uuid_features/includes/uuid_node.features.inc).
WD php: Notice: Trying to get property of non-object in content_uuid_node_features_export_render_alter() (line 16 of [error]
/NetBeansProjects/wpg/sites/all/modules/uuid_features/includes/modules/content.inc).
WD php: Notice: Trying to get property of non-object in nodereference_uuid_node_features_export_render_alter() (line 44 of [error]
/NetBeansProjects/wpg/sites/all/modules/uuid_features/includes/modules/nodereference.inc).
WD php: Notice: Trying to get property of non-object in filefield_uuid_node_features_export_render_alter() (line 44 of [error]
/NetBeansProjects/wpg/sites/all/modules/uuid_features/includes/modules/filefield.inc).
It's very easy to see the problem if you simply execute "drush core-cron".
The problem, AFAICT, is that node_get_by_uuid() uses db_rewrite_sql(). Subsequently node access grant clauses are written into the query that loads the node. Since we are anonymous, no node object will be returned (and rightly so).
I'm not entirely sure why hook_features_export_render() gets called on cron runs, but I'll assume Features does it by design.
The attached patch checks for an empty $node object after attempting to load.
| Comment | File | Size | Author |
|---|---|---|---|
| node_access_errors.patch | 814 bytes | ryan_courtnage |
Comments
Comment #1
JeremyFrench commentedI think that this module should perhaps warn if no UID is present. I was having an issue with the path not being set on imported nodes when running via drush. This was again a permissions issue.
For the record when using drush you can get round this with the parameter
-u 1Comment #2
ryan_courtnage commentedAlso relevant: http://drupal.org/node/1072246
Comment #3
vectoroc commented#1261196: node_get_by_uuid should not pass query through db_rewrite_sql
Comment #4
avpadernoI am closing this issue, as Drupal 6 is now not supported.