Closed (works as designed)
Project:
Revisioning
Version:
6.x-3.9
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Anonymous (not verified)
Created:
21 Mar 2010 at 22:37 UTC
Updated:
9 Jul 2015 at 21:26 UTC
Jump to comment: Most recent
Comments
Comment #1
rdeboerCan you please provide more details about which link where? On what page, which tab? Please provide the full URL.
Also, if you have Smart tabs enabled, please make sure you installed the very latest (6.x-1.5), as the previous version of Smart tabs did indeed not honor the Path alias for the URL of the View tab.
Comment #2
Anonymous (not verified) commentedHello
I don't have smart tabs enabled.
The node in question is node/5
It is a title-linked-to-full-node field in a block view that I noticed is now node/5
The block is visible on all pages.
It's pathauto alias is petition/node-title-name in the URL alias list.
Petition is a content type created by the Petition module.
This node was already created prior to installation of Revisioning.
It was edited afterwards.
Upon editing the node now, I can see the automatic alias is still petition/node-title-name
Upon saving the path in the address bar is /node/5/revisions/5/view
I am editing the page as a role that has full permissions for the Revisioning module.
[The site is not yet live.]
Comment #3
rdeboerAhaa.... thanks for the details. I get it now.
This has nothing to do with Revisioning, except that people tend to notice this core behaviour more on Revisioning pages.
Drupal's aliasing system only works for the base path (URL), in your case /node/5 (and its default View tab, /node/5/view).
Any other path, e.g. /node/5/edit is NOT covered.
The path you mention, /node/5/revisions/5/view, is a path to a specific revision, which in the case of Revisioning is not the default (i.e current) revision. It's the new one just created when you pressed save, the previous, live revision, one remains the current one when Revisioning is enable. In drupal there is no aliased path to any revision, except to the current (live) revision, the one that can be referred to by /node/5 or /node/5/view.
However, what you may want to try is the little module (not yet released) from this thread (comment #4): #711032: URL aliases not used after saving a page.
I think you'll find it does exactly what you expect... plus more!
Comment #4
Anonymous (not verified) commentedThanks for getting back to me so quickly and explaining this core quirk - makes it easy to continue the site development rather than stall it! ;)
Your module certainly looks intuitive and I will install it later tonight and see if it 'reverts' the node/xx in the block view back to the petition/node-title-name that it was.
Comment #5
puddyglumI am having a problem where after I revert a revision, the path changes to an automatic alias instead of the one I typed in.
Here's the scenario:
It seems like during the reverting process it just ignores the overridden URL
I plan on looking into the code, but I thought I'd post here first to let you know.
Thanks
Comment #6
rdeboerHi jmonkfish,
Just to clarify... What do you want the URL to be after the revert of step 6?
/page/content/my-new-page-title or /page/content/[title-raw] ?
Rik
Comment #7
puddyglumIt should be /my-new-page-title
It WAS /my-new-page-title, but when I revert it gets changed to /page/content/my-new-page-title
Thanks for looking into this! It seems like maybe there needs to be a Path auto hook in the process of reverting content. It sounds like the Revert process eliminates the hard-coded url alias, consequently forcing the node to use the automated path alias settings.
Comment #8
rdeboerI can confirm the behaviour in #5 and am looking into it.
Comment #9
rdeboerComment #10
rdeboerGuess what? The same happens when Revisioning is uninstalled!
So the issue is with Pathauto.
On the Edit form, under URL path settings the "Automatic alias" box comes back ticked after you have reverted to an older revision (via the link on the Revisions page), thus clobbering the override you put in for the automatic alias.
I have created an issue against the Pathauto module: #845158: Design flaw: manual aliases won't work without storing auto alias setting in the DB
Comment #11
Alexander Matveev commentedThe same problem,
Subscribing.
Comment #12
trulygood commentedI encountered the same problem while developing a module. Essentially I was programatically reverting / approving revisions by calling
$n = node_load($nid, $vid);
node_save($n);
The problem boils down to this. In the pathauto module's implementation of hook_nodapi() the code
checks for the value of the 'automatic alias' checkbox in the 'insert' and 'update' hooks (for non developers, this means that pathauto checks for that checkbox every time a page is inserted or updated). The code checks to see if either the user checked the automatic alias checkbox OR the value of the automatic alias checkbox has not been set for the node (i.e. the automatic alias checkbox doesn't have any value at all) (pathauto.module line 249).
The problem is with the second part of that condition. If you perform a node_load() call, it will not load up a value for
$node->pathauto_perform_alias
which is the value the above condition checks. I image the same process happens when reverting to an old revision using the built in drupal revision functionality. A quick fix for this (the one I used) was to add a value for $node->pathauto_perform_alias before calling node_save. I.e.
$node->pathauto_perform_alias = 0;
node_save($node);
However it seems like the pathauto module should be altered so that it stores the value of the pathauto_perform_alias (the 'automatic alias' checkbox) and / or loads a value with the 'load' hook. This was a bit confusing for a bit. I hope this helps.
Jeff @ TGD.
www.trulygooddesign.com
Comment #13
jcandan commentedactually, the problem lies with the Path module.
deactivate Pathauto.
Modify a Node, with revision, and path alias.
modify again, with revision, and path alias.
revert to the original revision.
notice that the path remained as in the second revision.
This bug carries across to Pathauto, since Pathauto piggy-backs off Path in this regard.
Comment #14
rdeboerSee http://drupal.org/project/pathauto_persist.