Closed DeividasDavidav closed 1 year ago
We can port your suggested fix to a ElementCascadingDeleter
in the transformer. Given you already have sample fix code in your original core issue, would you be willing to make a PR?
Do we need to add additional sanity checks though that the transformer should only delete this element if its other references (the scope one that currently errors) are also being deleted?
Okay, I will make a PR and add a sanity check that ensures that this element would only be deleted if all code scope references are also being deleted.
this was fixed by #75, closing
Describe the bug When using onDeleteElement() function from IModelImporter to delete an element, if an element is referenced by other elements in their code scopes, it throws Foreign key constraint error. That is because ElementTreeDeleter doesn't find elements with code scope references to specific element when deleting it. (Already created an issue with possible solution in itwins-core (https://github.com/iTwin/itwinjs-core/issues/5576) but they said that ElementTreeDeleter shouldn't solve this relationship issue)
To Reproduce
Expected behavior When deleting an element, it should also process the elements that reference the element in their code scopes.
Desktop (please complete the applicable information):