Katsuro
Member
- Affected version
- 2.2.15
In XF\Entity\Style::_postDelete()
Developers made a effective style id reset like this:
so effective_style_id won't get recalculated, because XF\Entity\Node behavior XF:TreeStructured won't get triggered
I kinda understand why they made reset as above and shouldn't be that critical (but fix would be fine), but as per as I use the same feature for my own addon, I wanted to know the possible solution how would be better to solve this "feature" and made the correct reset of effective_style_id. Should I just iterate over each Node and set style_id within entity to behavior will get triggered, or there's some better solution?
Developers made a effective style id reset like this:
PHP:
$db->update('xf_node', [
'style_id' => 0,
'effective_style_id' => 0
], "style_id = ? OR effective_style_id = ?", [$id, $id]);
I kinda understand why they made reset as above and shouldn't be that critical (but fix would be fine), but as per as I use the same feature for my own addon, I wanted to know the possible solution how would be better to solve this "feature" and made the correct reset of effective_style_id. Should I just iterate over each Node and set style_id within entity to behavior will get triggered, or there's some better solution?