Index: trunk/kernel/include/image.php =================================================================== diff -u -r13 -r18 --- trunk/kernel/include/image.php (.../image.php) (revision 13) +++ trunk/kernel/include/image.php (.../image.php) (revision 18) @@ -1065,7 +1065,15 @@ { global $objSession; - $edit_table = $objSession->GetEditTable($this->SourceTable); + $edit_table = $objSession->GetEditTable($this->SourceTable); + $dummy =& $this->GetDummy(); + if( !$dummy->TableExists($edit_table) ) + { + echo 'ERROR: Table "'.$edit_table.'" missing (class: '.get_class($this).')
'; + //exit; + return; + } + $rs = $this->adodbConnection->Execute("SELECT * FROM $edit_table WHERE ResourceId=0"); while($rs && !$rs->EOF) { Index: trunk/admin/category/addcategory_permissions.php =================================================================== diff -u -r13 -r18 --- trunk/admin/category/addcategory_permissions.php (.../addcategory_permissions.php) (revision 13) +++ trunk/admin/category/addcategory_permissions.php (.../addcategory_permissions.php) (revision 18) @@ -208,7 +208,7 @@ $objGroupList->Clear(); $sql = "SELECT ResourceId, g.name as Name, ELT(g.Personal+1,'Group ','User ') as UserGroup FROM ".GetTablePrefix()."Permissions as p "; -$sql .="LEFT JOIN ".GetTablePrefix()."PortalGroup as g ON p.GroupId=g.GroupId WHERE p.CatId=".$c->Get("CategoryId")." GROUP BY Name"; +$sql .="LEFT JOIN ".GetTablePrefix()."PortalGroup as g ON p.GroupId=g.GroupId WHERE p.CatId=".(int)$c->Get("CategoryId")." GROUP BY Name"; //$sql = "SELECT GroupId, count(*) as PermCount FROM ".GetTablePrefix()."Permissions WHERE CatId=".$c->Get("CategoryId")." GROUP BY GroupId"; $objGroupList->Query_Item($sql); @@ -249,7 +249,8 @@ ">
- + + ">
Index: trunk/admin/category/addcategory.php =================================================================== diff -u -r13 -r18 --- trunk/admin/category/addcategory.php (.../addcategory.php) (revision 13) +++ trunk/admin/category/addcategory.php (.../addcategory.php) (revision 18) @@ -90,6 +90,13 @@ unset($objEditItems); +if($_REQUEST['item']) +{ + // smulate like normal edit button pressed + $tmp_cat =& $objCatList->GetItemByField('ResourceId', $_REQUEST['item']); + $_POST['catlist'][] = $tmp_cat->UniqueId(); +} + $objEditItems = new clsCatList(); $objEditItems->SourceTable = $objSession->GetEditTable("Category"); $objCustomFields = new clsCustomFieldList(1); Index: trunk/kernel/action.php =================================================================== diff -u -r13 -r18 --- trunk/kernel/action.php (.../action.php) (revision 13) +++ trunk/kernel/action.php (.../action.php) (revision 18) @@ -1995,16 +1995,23 @@ $objCatList->CopyFromEditTable("CategoryId"); $objCustomDataList->CopyFromEditTable("CustomDataId"); $objCatList->Clear(); - $objImages = new clsImageList(); - $objImages->CopyFromEditTable("ImageId"); + + if($_REQUEST['CategoryId'] > 0) // not root category is updated + { + $objImages = new clsImageList(); + $objImages->CopyFromEditTable("ImageId"); + } } if( GetVar('CatEditStatus') == 2 ) { $objCatList->PurgeEditTable("CategoryId"); $objCustomDataList->PurgeEditTable("CustomDataId"); - $objImages = new clsImageList(); - $objImages->PurgeEditTable("ImageId"); + if($_REQUEST['CategoryId'] > 0) // not root category is updated + { + $objImages = new clsImageList(); + $objImages->PurgeEditTable("ImageId"); + } $objCatList->Clear(); }