When changing a user's name, the blog path should be updated--currently, it is not.

See attached patch for proposed solution.

CommentFileSizeAuthor
pathauto_16.patch751 bytesms2011

Comments

greggles’s picture

Status: Reviewed & tested by the community » Needs review

Can you explain why the update fails and why your patch fixes it?

ms2011’s picture

Existing code is referencing the wrong variable.
When the hook is invoked with $op='update', the new values are provided in the $edit variable.
The current version is looking in the $user variable, which contains the old values before the changes were made.
Thus, it detects no changes and fails to update the URL alias.

greggles’s picture

Title: Blog path update fails when changing username » path updates use old values on user edit
Version: 5.x-1.2 » 5.x-2.x-dev
Status: Needs review » Fixed

The fix for 5.x-2 was slightly different given the new style of that version, but I do now see the problem and appreciate your help and advice.

greggles’s picture

I committed this to the 5.x-1.x branch as well - thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)