Steps to reproduce:

Create revision as user (without publish rights!) with custom path, say "correct/URL"
Save to moderation queue.

As user with publication promotion rights, nav to moderation tab. Publish from workbench moderation interface. (Click on Publish in current revision)
Hey, URL is weird now! Custom URL information set by revision author is lost, now set to $baseurl/$nodetitle

Comments

dave reid’s picture

Going to mark #1085228: Manually entered URL not sticking through Moderation as a duplicate of this one. What I think is going to have to happen is we'll need either code in workbench_moderation or some kind of workbench_alias_revisions module that adds support for revision-able aliases. This is such a sore spot in core and I'm going to fix this in D8.

eatings’s picture

Component: User interface » Code
Priority: Normal » Critical

This is a pretty major bug especially if you are using menu to define sections. Also, this is not really a UI issue...

agentrickard’s picture

Project: Workbench » Workbench Moderation

This is a core limitation that we need to find a solution for.

Certain things in Drupal are simply not revisionable (Menu, Path), which creates these problems. I wonder if we could register those with a module (Workbench Revisions, as Dave suggests) to overcome the limitation.

For now, moving to Workbench Moderation, since this really bites us when that module is enabled. (Note, however, that Workbench Access is deliberately stateless and will likely remain so.)

dave reid’s picture

agentrickard’s picture

I don't think this needs actual revisioning, I just think that pathauto is form dependent in some ways we need to fix.

dave reid’s picture

agentrickard’s picture

Status: Active » Needs review
StatusFileSize
new4.04 KB

Here's a patch which does two things (bad, perhaps).

1) Ensures that $node->path is loaded during moderation. Core doesn't use path_node_load() and sometimes hilarity ensues.

2) Moves the moderated version save routing to drupal_register_shutdown_function(). This means we don't have to call node_save() during node_save() and helps protect data that is _not_ subject to revisions.

agentrickard’s picture

StatusFileSize
new4 KB

Slight revision to remove reference to a deprecated function in the docblock.

kirby14’s picture

This patch breaks functionality using the drupal_register_shutdown_function(). The live revision is no longer staying live. As soon as I create a new revision, it is automatically set to the current published revision.

This block of code seems to be the main factor in a lot of the issues for this module.

#1084436: doesn't seem to handle file attachments at all is dealing with this exact issue as well.

agentrickard’s picture

It doesn't look like the shutdown function is getting called.

You should see log messages. I don't.

agentrickard’s picture

StatusFileSize
new3.88 KB

Ah, faulty understanding of how arguments are passed to the shutdown function.

Try this one.

The problem (as I see it), is the node_save() which may happen within a node_save(). This approach tries to bypass that issue.

(The other way to view the issue is that Drupal core's inconsistent use of revisions and node_load() properties cauases all kinds of problems that we have to work around.)

kirby14’s picture

The last patch does restore functionality, I didn't test to see if it actually fixes the URL path issue though.

Unfortunately this doesn't fix the file attachment issue I linked above but since this patch isn't for that issue, no big deal.

I do agree with your statement about revisions, node_load and the nested node_saves causing a lot of issues, though... that is why I assumed this would fix the attachment issue as well. I'll look in to it further and see if we can build off of this to fix that.

mfer’s picture

Status: Needs review » Reviewed & tested by the community

The path is being saved between revisions and it applies cleanly.

mfer’s picture

Also note, I'm using http://drupal.org/project/pathauto_persist too. If you are using pathauto you have to have this or you cannot manually set a path. pathauto and workbench moderation will always trump your custom path without pathauto persist.

becw’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, everyone. I've committed the patch from comment #11 in d4487.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.