CRAFTERCMS-857
Fixed stack overflow exception caused by circular dependencies on delete