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

proposal: cascade delete taxonomy -> terms #8736

Open
MatteoPiovanelli-Laser opened this issue Nov 15, 2023 · 4 comments
Open

proposal: cascade delete taxonomy -> terms #8736

MatteoPiovanelli-Laser opened this issue Nov 15, 2023 · 4 comments

Comments

@MatteoPiovanelli-Laser
Copy link
Contributor

When deleting a taxonomy, all terms in it should also be deleted: these operations should probably be "gated" by checks to make sure references in the system don't break.

Example of what I have in mind.
image
This is a screenshot of a taxonomy in a tenant on my dev box.
When I hit delete:

  • The UI should ask for confirmation
  • OnRemoving<TaxonomyPart>() it should check whether the taxonomy is selected in the settings of any TaxonomyField: if that is the case, the operation should fail, and report the reason (e.g. "Taxonomy is selected in field 'foo' in Content Type 'bar'")
  • If the taxonomy may be deleted so far, it should invoke the Remove for all Terms belonging to it.
  • 'OnRemoving()' it should check whether the term is selected in any TaxonomyField: if that is the case, the depending on a setting on the ContentType for the term, the operation may fail.

cc @sebastienros @HermesSbicego-Laser

@sebastienros
Copy link
Member

Sounds good

@BenedekFarkas
Copy link
Member

Can this

'OnRemoving()' it should check whether the term is selected in any TaxonomyField: if that is the case, the depending on a setting on the ContentType for the term, the operation may fail.

be true if the parent Taxonomy is not selected for a field?

@MatteoPiovanelli-Laser
Copy link
Contributor Author

be true if the parent Taxonomy is not selected for a field?

yes, it may be true even if the taxonomy is not selected for a field. For example, in the case of a tenant with multiple Cultures, in the definition of a TaxonomyField you' likely select the taxonomy in you main culture; if later you delete a translation of that taxonomy, you may find its terms have been selected in fields whose "selected" taxonomy is a different one.
I can't guarantee that's the only case, but that's one off the top of my head.

@BenedekFarkas
Copy link
Member

I see, thanks! I had a hunch it has something to do with translations, especially since you suggested it. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants