diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-05-12 23:18:02 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-05-12 23:18:02 +0000 |
commit | d05e7a05e9d1a785856503ddee8b98649e38a539 (patch) | |
tree | 73fbbeac4285af9c88bf7480ae71348aa3eb52c5 /core | |
parent | 1a36d4fec45242dd3443dd2ced489a593c0cac88 (diff) |
Fix a bug where deleting an album sometimes deletes everything in var. Fixes ticket #282
Diffstat (limited to 'core')
-rw-r--r-- | core/libraries/ORM_MPTT.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/libraries/ORM_MPTT.php b/core/libraries/ORM_MPTT.php index f64ec200..f263d64a 100644 --- a/core/libraries/ORM_MPTT.php +++ b/core/libraries/ORM_MPTT.php @@ -80,7 +80,10 @@ class ORM_MPTT_Core extends ORM { $children = $this->children(); if ($children) { foreach ($this->children() as $item) { - $item->delete(); + // Deleting children affects the MPTT tree, so we have to reload each child before we + // delete it so that we have current left/right pointers. This is inefficient. + // @todo load each child once, not twice. + $item->reload()->delete(); } // Deleting children has affected this item |