Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[D8][WP] Move to trash instead of deleting. #2498

Open
klonos opened this issue Jan 26, 2017 · 4 comments
Open

[D8][WP] Move to trash instead of deleting. #2498

klonos opened this issue Jan 26, 2017 · 4 comments

Comments

@klonos
Copy link
Member

klonos commented Jan 26, 2017

This is part of #1388 and #378

WordPress

WordPress has had this feature for ages: https://en.support.wordpress.com/trash

When you delete a post, page, or comment from your blog, it will be moved to the Trash folder. You have separate trash folders for posts, pages and comments. This feature makes it extremely difficult to accidentally delete a post or page from your WordPress.com blog.

wp-move-to-trash-icon

Drupal 8

According to the Trash is a new experimental module change record, this should be already in core since 8.3.0. At the time of writing though, there is no such module listed in a fresh installation of 8.6.2, so I could not test nor provide actual screenshots of the UI.

d.org issue: WI: Phase E: Introduce Trash module

This phase will leverage the new archive and purge API and implement a new experimental module called Trash which gives the ability to "undo" or "restore" the deletion of content entities.
See Trash module for current implementation in contrib.

https://www.drupal.org/project/drupal/issues/2797247 is the core issue that is tracking the progress of this, and it is currently against 8.7.x, marked as needs work.

WI: UX prototypes for Trash module is the issue for the UI bit. Here are some screenshots from that issue:

image

image

...and here are some goals defined:

  1. Undo - add ability to undo “Move to trash” action

  2. Single list of trashed items - currently every entity type has it’s own separate list of trashed items

  3. Unifying when to show confirmation page

  • When deleting content from /admin/content using checkboxes - user is redirected to the confirmation screen “Are you sure you want to delete these items?” When selecting “Delete” option from the “Operations” column on the same page or clicking on “Delete” on the node page itself moves content to trash directly
  1. Wording: “Delete” vs “Move to trash” vs “Purge”
  • “Delete” is used in the tab on node/edit and as an option under the “Operations” column on the /admin/content
  • “Move to trash” is used in the confirmation message after deleting an item
  • “Purge” is used in context of removing deleted item from the Trash. My feeling is that “Purge” may sound too technical to general user
  • Proposal is to use Move to trash” & “Empty trash”
  1. Settings page for trash
  • set if the trash should be automatically emptied after some time
  • set the number of days after which the trash will be emptied
  • default content moderation state after moving items to trash
  • default content moderation stat after restoring items
  • set if you want to configure this for each entity type
    ^ if the last is set to yes - all of these settings could be overridden on the content moderation settings page per entity type

Related articles:

Unpublish, don't delete -> Deleting Drupal nodes

Contrib modules

  • Trash module: This contrib project has versions only for D8, D6 and D5 - not sure as to why D7 was skipped. This is what is being ported to D8 core.

    This module adds a trash bin for all content entities.

  • Trash Flag

    Provides trash functionality using flag, views, and node access combined with (a lot) of permissions

  • Killfile / Entity Soft Delete (fork of Killfile):

    Provides soft-deletion/trash bin functionality for Drupal. Content (node/comments/taxonomies/etc) is "soft-deleted" instead of deleted outright, and can be retained for a configurable span of time before being permanently purged. All this is opaque to end-users as all soft-deleted content is pervasively hidden from them, but administrators can access and restore soft-deleted content when necessary. ... Module is fully integrated with Rules, Views , Node UI.
    The module also records the user whom soft-deleted the content and also deletion time.

    image

    image

@Dinornis
Copy link

If you decide adding this feature, please consider making it easy to be turned off.

This feature makes it extremely difficult to accidentally delete a post or page from your WordPress.com blog.

They way the trash is implemented in WP also adds to many steps for users to completely delete content.

@klonos
Copy link
Member Author

klonos commented Jan 26, 2017

If you decide adding this feature, please consider making it easy to be turned off.

It could be implemented as a separate trash.module I guess. That way, people that don't like this could turn it off (like I do with contextual.module).

They way the trash is implemented in WP also adds to many steps for users to completely delete content.

We could have a dropbutton with two commands: "Move to trash" and "Delete permanently" the default being to move to trash. Disabling the trash.module would make the dropbutton render as a single button with the good ol' "Delete" action.

@Dinornis
Copy link

That sounds reasonable.

@klonos
Copy link
Member Author

klonos commented Oct 27, 2018

It seems that this is being planned for D8 core as part of their Workflow Initiative. I have updated the issue summary and I have added this as part of the #378 meta.

@jenlampton jenlampton changed the title Move to trash instead of deleting. [WP] Move to trash instead of deleting. Apr 28, 2019
@jenlampton jenlampton changed the title [WP] Move to trash instead of deleting. [D8][WP] Move to trash instead of deleting. Apr 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants