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

[4.x]: Delete For Site behavior for multi-site entries is inconsistent (hard-/soft-deletion) #13645

Closed
michaelrog opened this issue Sep 5, 2023 · 3 comments
Assignees

Comments

@michaelrog
Copy link

michaelrog commented Sep 5, 2023

What happened?

The Delete For Site behavior appears to be inconsistent with respect to soft-/hard-deletion:

  • If I delete an entry that is only enabled in one site, the entry is soft-deleted and appears in Trashed.
  • If I delete a multi-site-enabled entry that is currently only active on one site, the entry is soft-deleted and appears in Trashed.
  • If I delete a multi-site-enabled entry that is currently active on multiple sites, the entry (for that site) is hard-deleted and cannot be restored.

This behavior is confusing; It feels like a bug.

As a content editor, I would expect that, if soft-deletes are enabled for entries, an entry I delete from a site should be recoverable from Trashed, no matter how many sites it's active in at the time of deletion.

Steps to reproduce

  1. Accidentally Delete-For-Site an entry that is only enabled in one site. See that you can restore the entry from Trashed.
  2. Accidentally Delete-For-Site an entry that is enabled in multiple sites. See that it's irrecoverably gone. Cry. 😢

Craft CMS 4.5.3
PHP 8.1.20
MySQL 8.0

@michaelrog
Copy link
Author

(Apologies, this should have been tagged craft4. Although I suspect the same issue affects craft3, too.) 😬

@i-just i-just self-assigned this Sep 8, 2023
@i-just
Copy link
Contributor

i-just commented Sep 8, 2023

Hi, thanks for getting in touch!

Deleting an entry for a site when that entry exists for other sites doesn’t go through the same delete mechanism as in other cases. When you delete a multi-site element for just one site, it still exists for the other sites. That’s why it behaves differently.

We'll discuss this one internally and I'll get back to you once I have an update.

@brandonkelly
Copy link
Member

Yeah this is currently working as intended, and it would take some schema changes to make this possible. Going to close, but feel free to open up a discussion requesting soft deletion for site-specific entry content.

@brandonkelly brandonkelly closed this as not planned Won't fix, can't repro, duplicate, stale Sep 11, 2023
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

3 participants