Trash breaks any local tabs on trashed content

Created on 2 November 2023, about 1 year ago

Problem/Motivation

If I have e.g. devel enabled, the local task for devel when viewing a trashed node is a 404.
If we manually go to devel/node/605?in_trash=1 works as expected.

Steps to reproduce

1. Enable trash
2. Enable devel
3. Trash some content
4. View the trashed content with a privileged user.
5. Click on "Devel" local task.

Proposed resolution

TBD

Remaining tasks

TBD

User interface changes

TBD

API changes

TBD

Data model changes

TBD

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇪🇸Spain penyaskito Seville 💃, Spain 🇪🇸, UTC+2 🇪🇺

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @penyaskito
  • 🇷🇴Romania amateescu

    I'm on the fence about this.. on one hand, a trashed node shouldn't be available to the system unless it is restored, so for that case it would be "works as designed" and the Devel tab shouldn't be visible at all(?), however the Devel tab might be useful for a developer or site builder for debugging purposes, so we might want to make an exception.

    What do you think?

  • 🇪🇸Spain penyaskito Seville 💃, Spain 🇪🇸, UTC+2 🇪🇺

    That's actually why I didn't add a proposed solution and classified as minor.

    This happens with any local task. For devel I wouldn't care that much, but if I use entity_clone: do I want to allow to clone trashed content? It should be on a case per case basis. I think we shouldn't care about exceptions for now, and hide all if possible, but if I have the "view deleted entities", tabs will be visible based on permissions.

  • 🇦🇺Australia pameeela

    Just noticed this with the 'Clone' tab. FWIW I don't think it is necessary to be able to clone trashed content, so probably the right solution is that the links shouldn't appear if they don't work.

  • 🇷🇴Romania amateescu

    Found a way to persist the "in trash" context for all links displayed on a page where a deleted entity is displayed. Tested with the Devel local task and it seems to be working great.

    @pameeela, I also tested with the Entity Clone module, but the Clone tab did not appear when I was viewing a deleted node. That's the correct behavior by the way because trash_entity_access() denies access to any entity operation, but now I'm curious how you were able to see it in your testing :)

  • Pipeline finished with Skipped
    30 days ago
    #347375
    • amateescu committed 943c6a91 on 3.x
      Issue #3398774 by amateescu: Trash breaks any local tabs on trashed...
  • 🇦🇺Australia pameeela

    It was probably Quick Node Clone since that was in Drupal CMS at the time!

  • 🇦🇺Australia pameeela

    FWIW, we are now using ECA for duplicating, and it works even on content that is in trash :)

  • 🇷🇴Romania amateescu

    I just checked Quick Node Clone and its tab is now working properly, you can clone a deleted node and create.. a new deleted node :) Not sure if that's actually an improvement (same for duplicating using ECA), but if those modules are not checking entity access there's not much we can do about it.

  • 🇦🇺Australia pameeela

    Thanks for checking that! I think it's OK that it works this way. It would be fine if the links weren't there, but as long as they work it doesn't seem like an issue.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024