Skip to content

Commit

Permalink
Use is_descendant() API inside move_to() for clarity.
Browse files Browse the repository at this point in the history
  • Loading branch information
bharat committed Aug 30, 2009
1 parent 53390ba commit dee0abf
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions modules/gallery/libraries/ORM_MPTT.php
Expand Up @@ -212,8 +212,7 @@ function descendants_count($where=array()) {
* @return ORM_MTPP
*/
function move_to($target) {
if ($this->left_ptr <= $target->left_ptr &&
$this->right_ptr >= $target->right_ptr) {
if ($this->is_descendant($target)) {
throw new Exception("@todo INVALID_TARGET can't move item inside itself");
}

Expand Down

0 comments on commit dee0abf

Please sign in to comment.