If Workbench Moderation is enabled, saving a draft under a new name results in a redirect being created for the new name, not just an alias.

Steps with Pathauto, Redirect, Token, Ctools, Views, Workbench, Workbench Moderation enabled:

1. Enable moderation for basic page content type
2. Add content > basic page
3. Title: test page 1
4. Save as draft
5. Set draft to published
6. Visit /admin/config/search/path

Actual and expected: Alias content/test-page-1 to system node/1

7. Visit /admin/config/search/redirect

Actual and expected: No entries

8. Edit page 1
9. Change title to wonderful test page 1
10. Save as draft
11. Visit /admin/config/search/path

Actual and expected: Alias content/test-page-1 to system node/1

12. Visit /admin/config/search/redirect

Actual:
From content/test-page-1 to node/1
From content/wonderful-test-page-1 to node/1

Expected:
From content/test-page-1 to node/1

13. Set draft to published
14. Visit /admin/config/search/path

Actual and expected: Alias content/wonderful-test-page-1 to system node/1

15. Visit /admin/config/search/redirect

Actual:
From content/test-page-1 to node/1
From content/wonderful-test-page-1 to node/1

Expected:
From content/test-page-1 to node/1

16. Visit /content/wonderful-test-page-1 as anonymous visitor.

Actual result: Browser refuses to display page

That is, given a rename of node/123 from name-1 to name-2 to name-3 to name-4, I expect the end result to be active redirects from name-1, name-2, and name-3 to node/123 which then gets aliased as name-4. The current problem is that name-4 is also present in the redirect table.

If, after node/123 has been renamed someone else creates a node/124 and attempts to use name-1, I would expect it to get aliased as name-1-0 instead, to prevent conflict. I was planning to test this today with the production version to see if that actually happens.

If node/123 is subsequently named back to name-1, then I would expect one of the following programming options to happen, although not necessarily in the sequence listed, just as part of the same transaction:

Option 1: Can re-activate an alias
name-4 redirect to node/123 added to the redirect table
name-4 alias of node/123 removed from the alias table
name-1 redirect to node/123 removed from the redirect table (because it would create an infinite redirect; I suppose you could disable it if you need an audit record or if you want to retain the hit count, but it can't be reactivated without re-creating the infinite loop)
name-1 alias of node/123 added to the alias table

name-2 and name-3 redirects to node/123 would remain untouched in the redirect table

or

Option 2: Aliases can only be used once
name-4 redirect to node/123 added to the redirect table
name-4 alias of node/123 removed from the alias table
name-1-1 alias of node/123 added to the alias table

name-1, name-2 and name-3 redirects to node/123 would remain untouched in the redirect table.

Comments

charles belov’s picture

Issue summary: View changes
Leeteq’s picture

Version: 7.x-1.0-rc1 » 7.x-1.x-dev
ladybug_3777’s picture

This is a bit confusing to follow. First, to test this it should be pointed out that you must have path-auto in place and have the pattern for basic pages set up to use the node title as the URL alias. However I went through your steps and after the fix was committed on the related issue (https://www.drupal.org/node/1796596) I think it also fixed this.

Using 7.x-1.0-rc3, the results for steps #12 and #15 have changed and they are now what you listed as "expected". The issue where the browser does not display the page is not occurring for me either.

I believe this has been fixed so I am marking this issue as closed (duplicate). If you feel that is incorrect please feel free to indicate your test path and re-open and I'll run through it again.

ladybug_3777’s picture

Status: Active » Closed (duplicate)
charles belov’s picture

Confirming that it is now a duplicate and fixed by #1796596: Fix and prevent circular redirects, thank you.

It should say Pathauto needed to be in place because it did.

I shouldn't have posted "have the pattern for basic pages set up to use the node title as the URL alias." because I didn't. I can't post what I don't know. Now I know, thank you.

ladybug_3777’s picture

Great! Glad to hear it's working for you as well! No worries about the left out details, I wanted to add them in case others also wanted to confirm test results.