Conversation
[ci skip]
# Conflicts: # src/templates/_elements/cardsview/elements.twig # src/templates/_elements/tableview/elements.twig # src/templates/_elements/thumbsview/elements.twig # src/web/assets/cp/dist/cp.js # src/web/assets/cp/dist/cp.js.map
There was a problem hiding this comment.
This looks great!
I only found one proper bug, and the rest are questions/suggestions:
- it's not possible to delete assets via element index action on this branch (using local FS)
- when the deletion modal is presented, could we make the whole “accordion” title clickable (to expand), not just the icon?
- is it intended behaviour that you can’t use double-click to open, e.g. entries in the element index in the deletion modal? (the pencil icon works as expected)
- lets say you have a setup where some entries were authored by the user you want to delete; is there a reason why the “delete entries” action takes immediate effect, and reassign/remove author ones don’t?
- if it needs to stay like this, could we tweak the confirmation message to say that this will take immediate effect? (I know most people rarely read those messages at all/in full, but it might be beneficial if/when they do)
“Reassign” also takes immediate effect; “remove” doesn’t actually do anything and just lets the relationship remove itself on user delete. The buttons are labelled to imply immediate action will be taken, so in general the behavior should be clear. The exception cases like “remove” should clarify that no action has been taken yet via their resolution message (e.g. “The entries will be updated once the users are deleted.”). |
# Conflicts: # CHANGELOG-WIP.md # src/web/assets/cp/dist/cp.js # src/web/assets/cp/dist/cp.js.map
# Conflicts: # src/web/assets/cp/dist/cp.js # src/web/assets/cp/dist/cp.js.map
Description
Adds the ability for elements to define blockers that should prevent their own deletion.
When the element is deleted via a supporting UI control, the element will be checked for blockers, and if there are any, a modal will be shown to the user that lists them, along with various options to resolve them.
Elements can define their own deletion blockers via the new
ElementInterface::deletionBlockers()method, and plugins can register additional blockers via a newElement::EVENT_DEFINE_DELETION_BLOCKERSevent.Element deletion blocker classes must implement
craft\elements\deletionblockers\DeletionBlockerInterface. A base implementation is provided bycraft\elements\deletionblockers\BaseDeletionBlocker.See for documentation on blocker/action definitions, and
craft\elements\deletionblockers\EntryAuthorsBlockerfor an example.Related issues