While providing the hook_pathauto_user(), I saw that the pathauto_node uses usernames as placeholder and thus, when a user is updated, the nodes should be updated too in case [user] is used and the admin states you update the aliasses...

In the same way, when terms are updated, the node aliasses should be altered too...
Thus the hook_pathauto_taxonomy() should be extended with operations: insert, update and delete.
Next the pathauto_node.inc should use that hook_pathauto_taxonomy() to alter the paths of the nodes that contain [cat], [catpath], etc...

attached: patch for pathauto_taxonomy.inc

Comments

ednique’s picture

StatusFileSize
new1.22 KB

attached: patch for pathauto_node.inc

RobRoy’s picture

For many cases this is undesirable because this will create broken links. For users I think it's no big deal, but with nodes it matters. This is what the bulk update functionality is in there for.

ednique’s picture

You can define the behaviour of the update in the admin settings and everyone who doesn't need automatically updating, can choose "Do nothing, leave the old alias intact".
And people who are afraid of dead links can choose "create new alias in addition to the old alias"

But when people, like me, choose "create new alias, replacing the old one",
then the code should behave as such
and when a user changes his name,
all paths that use the [user] tag must be updated,
inclusive user paths, blog paths, tracker paths, node tags, etc...

greggles’s picture

Version: 4.7.x-1.x-dev » 6.x-1.x-dev

I see both sides of this issue that you have presented and I'm not sure which is the best solution to follow. If we do change this I think it should be done in HEAD so that the new functionality doesn't catch anyone by surprise. Beyond that, I guess I'd like to hear more input from other people on how to handle this, so if you can help raise the visibility of this issue in some manner that would be great.

ednique’s picture

Maybe a better fix - but some more coding - would be to enable the possibility to select the updating mechanisme for the path settings parts or even in more depth for each pattern.

For example the "User Path settings" part could have a dropdown to select the updating mechanism for all the user paths underneath the bulk update checkbox
The same for all the other path settings: node, blog, category, ...
Gooing deeper we could have the dropdown for each single pattern...

Another solution could be:
keep the update action in the general settings part as is.
+ add checkboxes for each path settings part underneath the bulk update checkbox stating: update on user change, update on node change, update on category change
We know that the code provides these 3 options...

Then one can choose only to check "update on node changes" within "node path settings"
And another could select all 3 for "node path settings"

greggles’s picture

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

Reviewing this again now I think that "won't fix" is the appropriate status. I don't like the idea of further cluttering the UI with settings about how updates will happen (especially not per pattern).

I do believe that with the new bulk update page and bulk updating the old way and bulk updating on cron we can provide similar functionality in a way that also has a Reasonable UI on its own.

#201151: Use batch API to perform path alias bulk updates
#206949: Bulk update the old way (replacing aliases)