\XF\Behavior\TreeStructured::deleteChildren method not deleting the nested children

Affected version
2.0.x, 2.1.x

AddonsLab

Well-known member
Hello,

While working with an add-on that is using the standard tree structure to represent a category tree, we tested the deletion of categories with deleteChildAction option being set to delete and noticed, that if the children of the category being deleted have some child categories on their own, these grand-children (and their children) remain in the database, with no possibility to access them later. I assume also the items associated with them would remain in the database, but did not test that case specifically.

The solution seems to be setting deleteChildAction option of XF:TreeStructured behavior for the child categories based on the option from the current behavior.

Thank you!
 
Top