After restoring a node from the trash, if the `in_trash` query parameter remains in the URL, subsequent delete actions bypass the trash and permanently delete the node. This happens because the trash context is incorrectly set to `ignore`, likely due to the lingering `in_trash` query parameter from the restore route.
Update `TrashRouteProcessor::processOutbound()` to remove the `in_trash` query parameter from the URL when generating links for the restore route.
if (str_ends_with($request->getPathInfo(), '/restore')) {
unset($parameters['in_trash']);
}
This prevents an incorrect trash context, which causes the bypass in:
trait TrashStorageTrait {
/**
* {@inheritdoc}
*/
public function delete(array $entities) {
if ($this->getTrashManager()->getTrashContext() !== 'active') {
parent::delete($entities);
return;
}
None
None
None
Active
3.0
Code