From b2fe1089afa6a6be5ab8cbaf935761fbabf4c61b Mon Sep 17 00:00:00 2001 From: Daniel Quinlan Date: Tue, 25 Jun 2002 08:05:37 +0000 Subject: [PATCH] Fixed bug in www_editImageGroup when adding a new group --- lib/WebGUI/Operation/Image.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/WebGUI/Operation/Image.pm b/lib/WebGUI/Operation/Image.pm index 1fe8d1fb2..d693705fa 100644 --- a/lib/WebGUI/Operation/Image.pm +++ b/lib/WebGUI/Operation/Image.pm @@ -149,6 +149,7 @@ sub www_listImages { $imageGroupId = $session{form}{gid}; } else { $imageGroupId = 0; + $session{form}{gid} = 0; } %data = WebGUI::SQL->quickHash("select parentId,name from imageGroup where imageGroupId=".$imageGroupId); if($session{form}{pid} ne "") { @@ -294,8 +295,6 @@ sub www_deleteImageGroupConfirm { my ($image, %data); tie %data, 'Tie::CPHash'; if (WebGUI::Privilege::isInGroup(9)) { - # FIXME reparent all children of this group to this group's parent - # or delete all children....this would also have to delete all images %data = WebGUI::SQL->quickHash("select parentId from imageGroup where imageGroupId=$session{form}{gid}"); WebGUI::SQL->write("update images set imageGroupId=$data{parentId} where imageGroupId=$session{form}{gid}"); WebGUI::SQL->write("update imageGroup set parentId=$data{parentId} where parentId=$session{form}{gid}"); @@ -318,7 +317,7 @@ sub www_editImageGroup { } else { %data = WebGUI::SQL->quickHash("select * from imageGroup where imageGroupId=$session{form}{gid}"); } - %parent_data = WebGUI::SQL->quickHash("select name from imageGroup where imageGroupId=$data{parentId}"); + %parent_data = WebGUI::SQL->quickHash("select name from imageGroup where imageGroupId=$session{form}{pid}"); $output = helpIcon(20); $output .= '

'.WebGUI::International::get(545).'

'; $f = WebGUI::HTMLForm->new;