I am having a problem a) being able to update the path of a revision and/or being able to update them at the right time in the workflow. There are two workflows I've defined. Both are illustrated in my screencast.
https://dl.dropbox.com/u/4770698/Drupal-org/Workbench%20Moderation%20URL...
First workflow, using custom URL alias
- Create new node and, before saving for the first time, uncheck "Generate automatic URL alias" and enter a custom URL alias value.
- Save the node.
- If you try to access the node at the URL alias you've defined as an anonymous, you will get a "not found" error. This is right because the node is still in Draft.
- Change the node Published and now you can access the node at the URL alias was defined. Everything is fine to this point.
- Click on New Draft, change the URL alias and then save
- Click on View Published and you will see that the path is now the new path even though this version is still a Draft.
- If I go to the old path, I am redirected to the new path due to the Redirect module.
Second workflow, using Pathauto
- Create new node and, before saving for the first time, be sure that "Generate automatic URL alias" is checked. (Note that the path pattern for this node is simply the node title.)
- Save the node.
- If you try to access the node at the URL alias you've defined as an anonymous, you will get a "not found" error. This is right because the node is still in Draft.
- Change the node Published and now you can access the node at the URL alias was defined. Everything is fine to this point.
- Click on New Draft, change the title and then Save
- Click on View Published and you will see that the path is still the published version of the node which is right because the new version is still a Draft.
- Publish the draft and then access the old path and you'll be redirected to the new path (due to Redirect module). All is perfect up to this point.
- Click on New Draft and then uncheck "Generate automatic URL alias" and enter a custom URL alias value.
- Click on Save
- Reload the node in view mode and the path has not changed which is right because the new path is still in Draft mode.
- Publish the Draft and then click on View Published and you'll notice that the old path is still active. The new path does not take over as expected.
- Click on New Draft and you'll see your new path is defined as the URL alias-- so why isn't it accessible from that path?
- Note that if I access the new path, it refers me to the old path.
I am operating as user1
Modules that I have installed that might affect the outcome:
Workbench 7.x-1.1+7-dev
Workbench Moderation 7.x-1.2+13-dev
Redirect
Pathauto
Pathauto persistent state
Related cases:
#1087044: Custom URL path settings do not survive moderation
#1273408: Workbench looses path aliases
#1852244: Setting path to default Pathauto value
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 1896102-wb_mod-alias-tests-5.patch | 5.22 KB | bbinkovitz |
| #2 | 1896102-path-aliases-2.patch | 1.51 KB | bbinkovitz |
Comments
Comment #1
bbinkovitz commentedI tried the same steps with slightly different results.
Dramatis Personae:
Act 1: With Pathauto
(the scene: site "mysite.com" with workbench, workbench moderation, and pathauto enabled with default pattern of "/content/[title]")
Act 2: Without Pathauto
(the scene: site "mysite.com" with workbench, workbench moderation, and path but not pathauto enabled.)
Comment #2
bbinkovitz commentedI tried to write a failing test for your second scenario but I either misunderstood the problem or I am just not able to reproduce it. Attached is a patch consisting of a couple of tests only. They all pass on my sandbox, but I am curious to see what they do on the testbot.
Comment #3
capellicThe only reason that our "Using custom URL alias" results are different is because I'm using the URL redirect module (admin/config/search/redirect/settings) to avoid a user from hitting a 404 error when visiting an old alias. I have "Automatically create redirects when URL aliases are changed." checked in the settings for that module.
Looks like your tests passed. What's next?
As for my 2nd workflow, "Using Pathauto," I went through the steps again to see if I could still reproduce. I am still able to reproduce the error as defined at step 11. What's interesting is that this seems to be the opposite problem as what's happening in workflow 1. I noticed that you didn't record your steps for the workflow #2, is to possible you missed a step?
Comment #4
bbinkovitz commentedI am able to reproduce manually as well. I'm struggling to write tests that reproduce the problem, however, because of the vagaries of the DrupalWebTestCase functions and other testing woes, such as #1903740: drupal_lookup_path() breaks when called from within a simpletest..
Comment #5
bbinkovitz commentedThere is a plot twist! When attempting to duplicate Act 2 in a test rather than in the GUI, there are unexpected failures. Tests attached. Please note that when these steps are carried out manually, there are no failures. The failures only happen in simpletest, but the bug is in Workbench Moderation.
Comment #6
bbinkovitz commented... That shouldn't have passed. WTF.
Comment #7
hass commentedI've tried to disable redirect module, but it's still not possible to set a custom url alias :-(((
Critical, as I'm not able to organize a structure in a menu (local tabs need this /foo/bar1, /foo/bar2).
Comment #8
aschiwi commentedThere's proposed temporary fix with a custom module in a duplicate issue of this: https://drupal.org/node/1945558#comment-7500630 Leaving this here for anyone who needs it.
Comment #9
danny_joris commentedAside from tests, has the issue been traced in the code yet? While profiling I did see that the published node version got loaded and saved again while saving a draft. Probably something going wrong there. Let me know who I can help.
Comment #9.0
danny_joris commentedLinks
Comment #10
rafalenden commentedI've created module that adds versioning for path: Workbench Path Revision.
Comment #11
seemas commentedWhat about Drupal 8?