From 30ce154ef4b2665a7ec29c5f1b87f695d49137a8 Mon Sep 17 00:00:00 2001 From: kevin_fourie Date: Thu, 31 May 2007 21:09:03 +0000 Subject: [PATCH] KTS-1417 "The "Root Folder" is not supposed to have a name, and thus it should disappear." Updated. --- plugins/ktcore/folder/Rename.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/plugins/ktcore/folder/Rename.php b/plugins/ktcore/folder/Rename.php index 781553a..eb21e43 100644 --- a/plugins/ktcore/folder/Rename.php +++ b/plugins/ktcore/folder/Rename.php @@ -47,7 +47,6 @@ class KTFolderRenameAction extends KTFolderAction { } function getInfo() { - if ($this->oFolder->getId() == 1) { return null; } return parent::getInfo(); } @@ -76,15 +75,17 @@ class KTFolderRenameAction extends KTFolderAction { $sFolderName = $this->oValidator->validateString($sFolderName, $aErrorOptions); $sOldFolderName = $this->oFolder->getName(); - $oParentFolder =& Folder::get($this->oFolder->getParentID()); - if(PEAR::isError($oParentFolder)) { - $this->errorRedirectToMain(_kt('Unable to retrieve parent folder.'), $aErrorOptions['redirect_to'][1]); - exit(0); - } + if ($this->oFolder->getId() != 1) { + $oParentFolder =& Folder::get($this->oFolder->getParentID()); + if(PEAR::isError($oParentFolder)) { + $this->errorRedirectToMain(_kt('Unable to retrieve parent folder.'), $aErrorOptions['redirect_to'][1]); + exit(0); + } - if(KTFolderUtil::exists($oParentFolder, $sFolderName)) { - $this->errorRedirectToMain(_kt('A folder with that name already exists.'), $aErrorOptions['redirect_to'][1]); - exit(0); + if(KTFolderUtil::exists($oParentFolder, $sFolderName)) { + $this->errorRedirectToMain(_kt('A folder with that name already exists.'), $aErrorOptions['redirect_to'][1]); + exit(0); + } } $res = KTFolderUtil::rename($this->oFolder, $sFolderName, $this->oUser); -- libgit2 0.21.4