Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By poker10 on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
7.x
Introduced in version:
7.92
Issue links:
Description:
In case there are multiple URL aliases for the same path, the path_load()
function will consistently load the newest alias now. This behavior was aligned with the drupal_lookup_path()
, which already does the same.
The old behavior for the path_load()
function was inconsistent and returned alias was dependent on the used database engine and its internal routines.
If we consider two URL aliases:
$alias1 = array(
'source' => 'user/1',
'alias' => 'foo',
);
path_save($alias1);
$alias2 = array(
'source' => 'user/1',
'alias' => 'bar',
);
path_save($alias2);
Then before this change:
drupal_lookup_path('alias', 'user/1'); // will return 'bar'
path_load(array('source' => 'user/1')); // returned alias cannot be predicted (could return 'foo' and also 'bar')
After this change:
drupal_lookup_path('alias', 'user/1'); // will return 'bar'
path_load(array('source' => 'user/1')); // will return 'bar'
Impacts:
Site builders, administrators, editors
Module developers
Themers
Distribution developers