There is a bug in URL alias AliasStorage for Drupal core version 8.6 & 8.7
On path update, the "pid" is set to the affected rows return value, which is "1" not the actual path id.
This means the alias save return value and also hook_path_update gets the incorrect path id value of "1"
https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Path%21Al...
Previously, in 8.5 the $fields['pid'] = $pid; was set before the path update query:
https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Path%21Al...
Patch pending.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3095545-path-update-pid-fix.patch | 743 bytes | davidwhthomas |
| Screen Shot 2019-11-20 at 5.40.05 PM.png | 139.02 KB | davidwhthomas |
Comments
Comment #2
davidwhthomas commentedHere's the patch
Comment #3
davidwhthomas commentedComment #4
davidwhthomas commentedComment #5
davidwhthomas commentedComment #6
davidwhthomas commentedComment #7
longwaveNote that path aliases were converted to entities in #2336597: Convert path aliases to full featured entities so this appears to be no longer an issue in 8.8.x onwards, and 8.7.x is no longer receiving patch releases (except security issues) so it is unlikely this will be fixed here.
Comment #8
davidwhthomas commentedYes, it's presumably fixed in 8.8 but 8.6 and the current Drupal 8.7.x version shipped for download here https://www.drupal.org/download has the bug.
We're using the fix with v8.6.
The patch can be applied manually if needed in
composer.jsone.g:Comment #12
tintoMarking this as closed (outdated). This issue was fixed by the changes committed to 8.8.x, when paths were converted to entities. See: #2336597: Convert path aliases to full featured entities.