From b083019332c43f75f944f6e06d043c9859381a20 Mon Sep 17 00:00:00 2001 From: Martin Kamerbeek Date: Mon, 16 Aug 2004 22:48:12 +0000 Subject: [PATCH] Fixing a bug where moveUp would fail due to the new GUID system --- lib/WebGUI/Page.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/WebGUI/Page.pm b/lib/WebGUI/Page.pm index 999a478e9..266cf2d29 100644 --- a/lib/WebGUI/Page.pm +++ b/lib/WebGUI/Page.pm @@ -1263,8 +1263,8 @@ sub moveUp { return 0 if (!defined $mother); # Don't allow to move up if node is already a webguiroot; - return 0 if ($mother->get('pageId') == 0); - + return 0 if ($mother->get('pageId') =~ /^\d+$/ && $mother->get('pageId') == 0); + # Update depth, we do this before the move because now we know the nestedSetRight range of nodes # that change in depth. WebGUI::SQL->write("update page set depth=depth-1 where nestedSetRight between ".$self->get('nestedSetLeft')." and ".$self->get('nestedSetRight')); @@ -1291,8 +1291,8 @@ sub moveUp { nestedSetRight end, parentId = case pageId - when ". $self->get('pageId') ." - then ".$mother->get('parentId')." + when ". quote($self->get('pageId')) ." + then ". quote($mother->get('parentId'))." else parentId end