| Project: | Pathauto |
| Version: | 7.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Dave Reid |
| Status: | closed (fixed) |
Issue Summary
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)
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| pathauto issue.png | 8.02 KB | Ignored: Check issue status. | None | None |
Comments
#1
I 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
#2
same 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...
#3
With the recent D7 release, this needs some attention...
#4
I realy could use a sullution?
#5
Huh, interesting. I can confirm this bug.
#6
Well 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.
#7
Please test the following patch, working on a test for it.
#8
The last submitted patch, 955926-preview-node-empty-uri.patch, failed testing.
#9
And 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%.
#10
without the extra hunk of code this time.
#11
Looks good. Thanks, Dave.
#12
Committing #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.
#13
Automatically closed -- issue fixed for 2 weeks with no activity.
#14
#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.
#15
Re: #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
#16
Thanks 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.