Problem/Motivation
Deleting a node (or any aliased entity) can trigger a fatal error when the Trash module is installed, or more generally whenever a `PathAliasDependency` row references a path alias that no longer exists:
Error: Call to a member function getPath() on null in Drupal\pathauto_update\PathAliasDependencyRepository->updatePathAliasesByType() (line 244 of modules/contrib/pathauto_update/src/PathAliasDependencyRepository.php).
Steps to reproduce
1. Install trash alongside pathauto_update.
2. Have content whose alias is a dependency of another alias.
3. Delete (send to trash) a node. Trash soft-deletes the associated path alias, which re-fires an entity update; "updatePathAliasesByType()" then iterates the dependencies and hits a dependency whose alias has been removed.
(Not strictly Trash-specific, any state where a PathAliasDependency points at a deleted alias reproduces it, since `getPathAlias()` is documented to return NULL in that case.)
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3612511-pathauto_update-null-pathalias-on-trash-delete.patch | 921 bytes | welly |
Issue fork pathauto_update-3612511
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
welly commentedComment #3
welly commentedPatch attached.
Comment #5
dieterholvoet commentedThanks!