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

Command icon 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

welly created an issue. See original summary.

welly’s picture

Issue summary: View changes
welly’s picture

Status: Active » Needs review
StatusFileSize
new921 bytes

Patch attached.

dieterholvoet made their first commit to this issue’s fork.

dieterholvoet’s picture

Status: Needs review » Fixed

Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • dieterholvoet committed 20f9a354 on 1.x
    fix: #3612511 Fatal error "Call to a member function getPath() on null"...