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.
As a module developer, I would expect that pathauto would set this value in it's implementation. But it does not. Hilarity does not ensure, as $node->path is always blank on node insert.
Comment | File | Size | Author |
---|---|---|---|
#1 | 816434-pathauto-reference.patch | 560 bytes | agentrickard |
Comments
Comment #1
agentrickardAnd a patch against 1.3.
Comment #2
Dave ReidSetting to 6.x-1.x so it can be run against tests.
Comment #3
gregglesMakes sense to me.
Comment #4
Dave ReidCommitted to all three branches:
http://drupal.org/cvs?commit=377178
http://drupal.org/cvs?commit=377180
http://drupal.org/cvs?commit=377182
Comment #6
Dave ReidSeems some abstractions removed this from 6.x-2.x and 7.x-1.x.
Comment #7
Dave ReidRe-applied to 6.x-2.x.
Comment #8
danielb CreditAttribution: danielb commentedsubscribed, I see no $node->path in Drupal 7. Need it for the node_export module to work.
Comment #9
danielb CreditAttribution: danielb commentedLooks like I found an explanation for why this is the case
http://drupal.org/node/332333#comment-2163634
Comment #10
ExTexan CreditAttribution: ExTexan commentedOk, so... with no replies after the "found an explanation" of 22 Sep 2011, I'm not sure the status of this. Should I apply patches in the thread linked to in #9, or has that been added to core?
And, regardless of that, I'm still not getting the aliased path in my hook_node_insert function (D7 of course), so if it *has* been fixed in core, I guess *this* module still needs a fix, or I need to know how to do this.
I'm sending email notifications when certain nodes are created or (sometimes) updated. The emails include a link to the node and I naturally want that to be the aliased path instead of "node/{nid}". I'm doing this in hook_node_insert() and hook_node_update(). "update" is not a problem as the alias field is populated, but in hook_node_insert it is NULL.
I've tried setting the weight of my module to a higher value than pathauto, that didn't work. I tried reloading the node (via node_load) just before sending notifications. The only thing that did is make the "path" field disappear entirely from the node object.
Please advise.