Does Revisioning override automatic path aliasing perhaps?

A page that I revised after installation of this module is now referenced by its node/xx name from a block, and not it's pathauto alias.

Is there something else I need to check/configure to allow Revisioning to work with path aliases?

Comments

rdeboer’s picture

Can 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.

Anonymous’s picture

Hello

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.]

rdeboer’s picture

Ahaa.... 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!

Anonymous’s picture

Thanks 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.

puddyglum’s picture

I 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:

  1. I set Page nodes to automatically get /page/content/[title-raw]
  2. I create a Page but override the automatic alias and give it "my-new-page"
  3. I edit the page, which keeps the "my-new-page" URL
  4. I publish the page, everything is still working great
  5. I do more edits and more publishes, everything is still working great
  6. I revert back to any one of the previous revisions, the URL goes back to /page/content/my-new-page-title

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

rdeboer’s picture

Hi 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

puddyglum’s picture

It 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.

rdeboer’s picture

Assigned: Unassigned » rdeboer
Category: support » bug
Status: Active » Needs work

I can confirm the behaviour in #5 and am looking into it.

rdeboer’s picture

Title: Path auto / Alias » Node reverts to PathAuto alias when reverting to archived revision.
rdeboer’s picture

Title: Node reverts to PathAuto alias when reverting to archived revision. » Node reverts to PathAuto Automatic alias when reverting to archived revision.
Version: 6.x-3.6 » 6.x-3.9
Status: Needs work » Closed (won't fix)

Guess 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

Alexander Matveev’s picture

The same problem,

Subscribing.

trulygood’s picture

I 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

jcandan’s picture

Priority: Normal » Critical
Status: Closed (won't fix) » Needs review

actually, 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.

rdeboer’s picture

Status: Needs review » Closed (works as designed)