Some bugs in rename and copy operations fixed.

This commit is contained in:
tomas 2005-01-12 13:15:17 +00:00
parent 5850a9bba1
commit 820a400ae8
2 changed files with 20 additions and 12 deletions

View file

@ -23,7 +23,7 @@
Author : $Author: tomas $ 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 $ 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 * Core of LiveSupport file storage module
* *
* @author $Author: tomas $ * @author $Author: tomas $
* @version $Revision: 1.14 $ * @version $Revision: 1.15 $
* @see Alib * @see Alib
*/ */
class BasicStor extends Alib{ class BasicStor extends Alib{
@ -151,13 +151,20 @@ class BasicStor extends Alib{
function bsRenameFile($id, $newName) function bsRenameFile($id, $newName)
{ {
$parid = $this->getParent($id); $parid = $this->getParent($id);
switch($this->getObjType($id)){
case"audioclip":
case"playlist":
case"File":
$ac =& StoredFile::recall(&$this, $id); $ac =& StoredFile::recall(&$this, $id);
if(PEAR::isError($ac)){ if(PEAR::isError($ac)){
// catch nonerror exception: #// catch nonerror exception:
if($ac->getCode() != GBERR_FOBJNEX) return $ac; #if($ac->getCode() != GBERR_FOBJNEX)
return $ac;
} }
$res = $ac->rename($newName); $res = $ac->rename($newName);
if(PEAR::isError($res)) return $res; if(PEAR::isError($res)) return $res;
default:
}
return $this->renameObj($id, $newName); return $this->renameObj($id, $newName);
} }

View file

@ -23,7 +23,7 @@
Author : $Author: tomas $ 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 $ 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 * LiveSupport file storage module
* *
* @author $Author: tomas $ * @author $Author: tomas $
* @version $Revision: 1.18 $ * @version $Revision: 1.19 $
* @see BasicStor * @see BasicStor
*/ */
class GreenBox extends BasicStor{ class GreenBox extends BasicStor{
@ -409,9 +409,10 @@ class GreenBox extends BasicStor{
* *
* @return id * @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)){ switch($this->getObjType($id)){
case"audioclip": case"audioclip":
case"playlist": case"playlist":