Open MatteoPiovanelli-Laser opened 1 year ago
Sounds good
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?
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.
I see, thanks! I had a hunch it has something to do with translations, especially since you suggested it. :)
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. This is a screenshot of a taxonomy in a tenant on my dev box. When I hit delete:
OnRemoving<TaxonomyPart>()
it should check whether the taxonomy is selected in the settings of anyTaxonomyField
: 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'")cc @sebastienros @HermesSbicego-Laser