Nothing changes to the list of redirects ('{host}/admin/build/path-redirect'), whenever I manually manage (add/ create, edit or delete) an URL alias ('{host}/admin/build/path'), even though, I have enabled the options:

  1. 'Clean URLs: Enabled in the configuration form '{host}/admin/settings/clean-urls'
  2. 'Create a new alias. Delete the old alias.' in the configuration form '{host}/admin/build/path/pathauto'
  3. 'Automatically create redirects when URL aliases are changed.' in the configuration form '{host}/admin/build/path-redirect/settings'

Ad 2) Disabling the Pathauto module did NOT resolve the issue. So, that module isn't the cause, probably.

Running D6.16

CommentFileSizeAuthor
#11 pathauto_change.patch2.94 KBsreynen

Comments

not_Dries_Buytaert’s picture

Title: Option 'Automatically create redirects when URL aliases are changed.' doesn't work and clarify description » Make option 'Automatically create redirects when URL aliases are changed.' compatible with Pathauto 6.x-1.3

ad 2) The Pathauto module (http://drupal.org/project/pathauto) automatically updates any aliased/ clean URLs/ paths. Beats me, but now it DOES turn out that disabling the Pathauto module DOES prevent the issue from occurring!!! So, these two modules seem to be some how incompatibility with each other. Hence, the topic title change.
ad 3) I also have the core module Path (6.16) enabled, which is required for this option.

fidot’s picture

I have just hit this problem too.

The redirects are created correctly when nodes are updated and the "Automatic alias" checkbox within "URL path settings" is not set. However, as soon as that checkbox is set, the redirects are not created.

HTH
Terry

Mac Clemmens’s picture

I can confirm we are having this issue as well. It is causing broken links on our site when titles of nodes are updated.

checker’s picture

+1

Or port these patches to d6 #358315: drupal_lookup_path() not respects alias' order Then you need not this module for some situations.

tayzlor’s picture

if you change the setting at admin/build/path/pathauto in the general settings fieldset to -

Create a new alias. Redirect from old alias.

this works.

roderik’s picture

@ #4: apparently #358315: drupal_lookup_path() not respects alias' order has been ported long ago (and is included in D6.17).
Just an FYI for who stumbles upon this issue.

dave reid’s picture

Status: Active » Closed (works as designed)

The 'Automatically create redirects when URL aliases are changed.' only works when you manually change an alias, not using pathauto.

not_Dries_Buytaert’s picture

Why? Please, describe uses-cases. NB: also other modules may automatically change aliases.

dave reid’s picture

Category: bug » feature
Priority: Critical » Normal
Status: Closed (works as designed) » Active

The reason is there is no hook in D6 to let me know when an alias changes. We can only rely on manually checking node submission.

not_Dries_Buytaert’s picture

It is vital that redirects remains 'in sync with/ linked to' (automatically) updated aliases. Please, consider submitting a feature request for the required hook* in the D6 core. I wish I could submit this myself, but lack the technical knowledge to describe exactly, what you need for my request.
*) http://api.drupal.org/api/group/hooks/6

As a workaround, couldn't a cron job be created to periodically check which aliases have been changed, (e.g., using a function like http://api.drupal.org/api/function/drupal_get_path_alias/6)?

sreynen’s picture

Status: Active » Needs review
StatusFileSize
new2.94 KB

I don't think a new hook is necessary. The attached patch gets the old alias before pathauto changes it in the presave op and compares it to the new alias pathauto has set in the insert and update ops.

Status: Needs review » Needs work

The last submitted patch, pathauto_change.patch, failed testing.

sreynen’s picture

Version: 6.x-1.0-beta6 » 6.x-1.0-beta7
Status: Needs work » Needs review

I think maybe the patch failed automated testing because it was against beta7 rather than beta6.

sreynen’s picture

#11: pathauto_change.patch queued for re-testing.

subir_ghosh’s picture

Any update on this? Stilled queued up?

sreynen’s picture

@newswatch, the patch passed automated testing, but that only tests that it doesn't break anything covered under automated tests. The patch still needs people (like you) to test and confirm it solves the problem.

thetoast’s picture

YK85’s picture

+1 subscribing

subir_ghosh’s picture

not_Dries_Buytaert:

In case of your (2), I use "Create a new alias. Redirect from old alias."

It works. And works fine.

akalata’s picture

Patch working for me on Drupal 6.25, Path Redirect 6.x-1.0-rc2 and Pathauto 6.x-1.6.

dave reid’s picture

Status: Needs review » Closed (duplicate)

This options is only for when Pathauto is not used. You must use the "Create a new alias. Redirect from old alias." for this functionality and I don't want to duplicate code that already exists and works in Pathauto.