From 820a400ae8caebffefeb15e9d9936ffc7fb38fa0 Mon Sep 17 00:00:00 2001 From: tomas Date: Wed, 12 Jan 2005 13:15:17 +0000 Subject: [PATCH] Some bugs in rename and copy operations fixed. --- .../modules/storageServer/var/BasicStor.php | 23 ++++++++++++------- .../modules/storageServer/var/GreenBox.php | 9 ++++---- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/livesupport/modules/storageServer/var/BasicStor.php b/livesupport/modules/storageServer/var/BasicStor.php index 9fd46cde0..08600caee 100644 --- a/livesupport/modules/storageServer/var/BasicStor.php +++ b/livesupport/modules/storageServer/var/BasicStor.php @@ -23,7 +23,7 @@ Author : $Author: tomas $ - Version : $Revision: 1.14 $ + Version : $Revision: 1.15 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/BasicStor.php,v $ ------------------------------------------------------------------------------*/ @@ -50,7 +50,7 @@ require_once "StoredFile.php"; * Core of LiveSupport file storage module * * @author $Author: tomas $ - * @version $Revision: 1.14 $ + * @version $Revision: 1.15 $ * @see Alib */ class BasicStor extends Alib{ @@ -151,13 +151,20 @@ class BasicStor extends Alib{ function bsRenameFile($id, $newName) { $parid = $this->getParent($id); - $ac =& StoredFile::recall(&$this, $id); - if(PEAR::isError($ac)){ - // catch nonerror exception: - if($ac->getCode() != GBERR_FOBJNEX) return $ac; + switch($this->getObjType($id)){ + case"audioclip": + case"playlist": + case"File": + $ac =& StoredFile::recall(&$this, $id); + if(PEAR::isError($ac)){ + #// catch nonerror exception: + #if($ac->getCode() != GBERR_FOBJNEX) + return $ac; + } + $res = $ac->rename($newName); + if(PEAR::isError($res)) return $res; + default: } - $res = $ac->rename($newName); - if(PEAR::isError($res)) return $res; return $this->renameObj($id, $newName); } diff --git a/livesupport/modules/storageServer/var/GreenBox.php b/livesupport/modules/storageServer/var/GreenBox.php index dbdd1fc64..3fda72e35 100644 --- a/livesupport/modules/storageServer/var/GreenBox.php +++ b/livesupport/modules/storageServer/var/GreenBox.php @@ -23,7 +23,7 @@ Author : $Author: tomas $ - Version : $Revision: 1.18 $ + Version : $Revision: 1.19 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/GreenBox.php,v $ ------------------------------------------------------------------------------*/ @@ -35,7 +35,7 @@ require_once "BasicStor.php"; * LiveSupport file storage module * * @author $Author: tomas $ - * @version $Revision: 1.18 $ + * @version $Revision: 1.19 $ * @see BasicStor */ class GreenBox extends BasicStor{ @@ -409,9 +409,10 @@ class GreenBox extends BasicStor{ * * @return id */ - function copyObj($id, $newParid, $after='') + function copyObj($id, $newParid, $after=NULL) { - $nid = parent::copyObj($id, $newParid, $after=''); + $nid = parent::copyObj($id, $newParid, $after); + if(PEAR::isError($nid)) return $nid; switch($this->getObjType($id)){ case"audioclip": case"playlist":