Problem/Motivation

Trash context leak on missing entity — src/Controller/ListUsageController.php:224-241

getRows() sets $this->trashManager->setTrashContext('ignore') before loading the target entity, but if $entity fails to load, the method returns early (if (!$entity) { return $rows; }) before the restore block at line 375. The trash context stays 'ignore' for the rest of the request, which can make trashed entities visible elsewhere on the same page/request.

Proposed resolution

wrap the load-and-build logic in try/finally, or restore before the early return.

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

alexpott created an issue. See original summary.

  • alexpott committed 08865ed3 on 5.x
    fix: #3612533 Ensure trash context is reset
    
    By: alexpott
    

  • alexpott committed b9d485d4 on 8.x-2.x
    fix: #3612533 Ensure trash context is reset
    
    By: alexpott
    
alexpott’s picture

Status: Active » Fixed

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.