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.
Hi,
in my watchdog log, I'm getting numerous notices like this:
Notice: Trying to get property of non-object in pathauto_token_values() (line 142 of /var/www/drupal/sites/all/modules/pathauto/pathauto.module).
Since the severity is marked as "error" I'd like to get rid of this.
Probably related:
Notice: Trying to get property of non-object in node_token_values() (line 34 of /var/www/drupal/sites/all/modules/token/token_node.inc).
The referrer for both groups or errors is a View at ./image/recent
.
Versions: Pressflow 6.22.x, views 6.x-2.12, token 6.x-1.16. Please feel free to adjust the issue queue if it might fit somewhere else better.
Thanks!
Comment | File | Size | Author |
---|---|---|---|
#1 | pathauto-1319666-1.patch | 782 bytes | smokris |
Comments
Comment #1
smokrispathauto.module shouldn't assume that the object hook_token_values() is non-null. Patch attached.
Comment #2
Dave ReidA node object that doesn't have a value for $node->vid wouldn't be a valid node object would it? Under what conditions is this happening?
Comment #3
smokrisAccording to the hook_token_values() documentation, the object parameter is optional (defaults to NULL), so it's valid for modules making use of tokens to try to fetch tokens for the 'node' type without specifying any particular node object. That seems to be what was happening here.
Comment #4
Dave ReidIt's only optional if you use $type = 'global'. It is not optional if $type = 'node'.