TickTackk
Well-known member
- Affected version
- 2.2.4
PHP:
protected function deleteChildren()
{
$finder = $this->entity->em()->getFinder($this->entity->structure()->shortName);
$finder->where($this->config['parentField'], $this->entity->getEntityId());
foreach ($finder->fetch() AS $child)
{
/** @var Entity $child */
$treeStructure = $child->getBehavior('XF:TreeStructured');
$treeStructure->setOption('deleteChildAction', $this->getOption('deleteChildAction'));
$treeStructure->setOption('rebuildCache', false);
$child->delete(true, false);
}
}
src/XF/Behavior/TreeStructured.php
.