Change record status: 
Project: 
Introduced in branch: 
7.x
Introduced in version: 
7.92
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