Problem/Motivation
#3370639: Prevent trashed entities from being returned by entity_load during updates can be problematic. E.g. if I need to alter N entities in a hook_update_N/post_udpdate (or a contrib module does), the trashed entities won't be affected.
This is a case-per-case decision, but I think the safer bet is including trashed entities by default.
Proposed resolution
Per amateescu, we can hook into the update kernel and switch to the 'ignore' trash context during updates by default.
Remaining tasks
TBD
User interface changes
TBD
API changes
TBD
Data model changes
TBD
Issue fork trash-3398794
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
penyaskitoThis might be a release blocker too.
Comment #3
penyaskito@amateescu I've never done this before, should it be in ServiceProvider like WorkspacesServiceProvider does?
Comment #4
amateescu commentedLooked a bit into this and it seems we need an event subscriber that reacts to the
KernelEvents::REQUESTevent, checks whether$event->getKernel() instanceof UpdateKerneland sets the trash context on the trash manager toinactive.Comment #6
penyaskitoThat looks definitely cleaner. Created MR with proposed solution.
Comment #8
amateescu commentedMerged into 3.x, thanks!