By berdir on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.0.x
Issue links:
Description:
hook_path_update() now receives an 'original' key with the old path alias data, so that modules implementing that hook can react to the change that happened.
This was added to solve a regression caused when converting path_save() to a service, as it is no longer possible to pass along additional information.
Example:
function mymodule_path_update($path) {
if ($path['alias'] != $path['original']['alias']) {
db_update('mytable')
->fields(array('alias' => $path['alias']))
->condition('pid', $path['pid'])
->execute();
}
}
Impacts:
Module developers