Drupal 7 beta2, Pathauto 7.x-1.x-dev (10-26-10), Token 7.x-1.x-dev (10-26-10)
After showing the preview of a node, and then saving it (with Url path settings - Automatic alias checked), the alias is created but it's not linked to the node. Everything appears to be configured correctly, and this is not the first time I've used Pathauto. The pattern I'm using for Article paths is articles/[node:title].
See the attached screenshot - articles/test-pathauto-2 was created by just saving the node and is correctly linked to node/5. articles/test-pathauto-3 was first previewed then saved and is not linked to it's corresponding node (node/6).
(This also happens with Pathauto 7.x-1.x-alpha2 and Token 7.x-1.x-alpha3)
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 955926-preview-node-empty-uri.patch | 2.19 KB | dave reid |
| #9 | 955926-preview-node-empty-uri.patch | 4.35 KB | dave reid |
| #7 | 955926-preview-node-empty-uri.patch | 625 bytes | dave reid |
| pathauto issue.png | 8.02 KB | mjohnq3 |
Comments
Comment #1
Sparky Marky commentedI have the same issue as this, when a preview is made and then the node saved the alias is saved as
news/<node_id> => node/
If I edit the new content, the automatic alias isn't checked. Checking it and doing a preview/save saves it correctly, but as
news/<node_id>-0 => node/<node_id>
if I haven't deleted the incorrect alias.
Deleting the node doesn't delete the incorrect alias.
Running Drupal 7 Beta 2
Pathauto 7.x-1.0-alpha2
Token 7.x-1.0-alpha3
Comment #2
basicmagic.net commentedsame issue... same components as noted above
- when previewing a node, and then saving-
url alias is created for the node, but for the system path of: node/ (not node/x as it should, x being node id)
works fine when just saving the node without previewing it...
Comment #3
Taxoman commentedWith the recent D7 release, this needs some attention...
Comment #4
SilentAlarm commentedI realy could use a sullution?
Comment #5
dave reidHuh, interesting. I can confirm this bug.
Comment #6
dave reidWell interesting. It turns out this is still a core bug: #1025870: Previewing a node causes $node->uri['path'] to be set to 'node/' in hook_node_insert() but I think we can work around it in Pathauto for now.
Comment #7
dave reidPlease test the following patch, working on a test for it.
Comment #9
dave reidAnd now I have a test to back it up. I've confirmed without the change to pathauto_node_insert() that the test fails, and with the change it passes 100%.
Comment #10
dave reidwithout the extra hunk of code this time.
Comment #11
mjohnq3 commentedLooks good. Thanks, Dave.
Comment #12
dave reidCommitting #10 to CVS!
http://drupal.org/cvs?commit=480990
Please everyone take a moment to subscribe, re-roll, or help work on #1025870: Previewing a node causes $node->uri['path'] to be set to 'node/' in hook_node_insert() so it can be fixed in core before the 7.1 release.
Comment #14
james.williams#12 - The taxonomy test fails because taxonomy needs hook_field_formatter_prepare_view() to be called, but this won't be called since the $node object is altered *before* it is cloned by this patch. This appears to be quite a deep issue, see #844388: Taxonomy terms disappear from node preview if previewed more than once. I've left a patch & comment (#55) calling for it to be fixed.
Comment #15
lotyrin commentedRe: #14
I'm pulling any discussion of this into #1025870: Previewing a node causes $node->uri['path'] to be set to 'node/' in hook_node_insert(), as I don't think it belongs in #844388: Taxonomy terms disappear from node preview if previewed more than once
Comment #16
james.williamsThanks lotyrin. Sorry for re-opening #844388: Taxonomy terms disappear from node preview if previewed more than once, it does sound like a new 8.x issue to sort out entities without URIs is needed. It looks like the patch in #10 will be the fix for pathauto until D8 then.