Steps to reproduce:

  1. Create a new email template
  2. Add email template to a moderation state transition
  3. Remove to email template

The moderation state transition is also removed!!

CommentFileSizeAuthor
#5 config_delete_warning.png78.77 KBdpi
#5 2852174-warn-removal.patch614 bytesdpi

Comments

fdyckhoff created an issue. See original summary.

larowlan’s picture

Status: Active » Closed (works as designed)

Right, because the transition config entity has third party settings that point to the template.
This means the transition config entity has a dependency on the template (you should see this in the yaml).
This is standard behaviour in core.
Eg. if you create view that depends on a field, and then delete the field, the view is also deleted.

The alternative is that it will be horribly broken.

E.g. the transition depends on a config entity that no longer exists.

fdyckhoff’s picture

Status: Closed (works as designed) » Active

Sorry, but then I don't think this is designed very well... ^^"

When I delete an email template, which I consider is only an addition to a moderation state transition entity, the whole transition entity is deleted? Why? When my transition has more than 1 relation to an email template and one of them is deleted, will the transition also be deleted?

If this is really the preferred behaviour, than - please - add an information about it in the delete form of the email template. We did have the use case that we wanted to delete an email, but we did not want the remove the transitions on the same time and were suprised by that

larowlan’s picture

Status: Active » Needs work
Issue tags: +8.x-1.0-alpha5 blocker

Yep, I think that it's a good idea to warn about what you're going to remove.

dpi’s picture

Status: Needs work » Needs review
StatusFileSize
new614 bytes
new78.77 KB

Added a patch that uses the config entity delete form so the user is warned (see screenshot) that dependent configuration is removed.

config_delete_warning.png

This should mitigate the problem that transitions are removed without warning. However I think this issue should still be open. Dependent transition configuration should not be deleted, but updated to remove the templates being deleted.

  • larowlan committed e669fb6 on 8.x-1.x authored by dpi
    Issue #2852174 by dpi: State transition removed, when template is...
larowlan’s picture

Status: Needs review » Fixed

Thanks, let's open a new issue for updating the dependents in a preDelete or some such.

Status: Fixed » Closed (fixed)

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