Commit 30ce154ef4b2665a7ec29c5f1b87f695d49137a8
1 parent
566bbf0a
KTS-1417
"The "Root Folder" is not supposed to have a name, and thus it should disappear." Updated. Committed By: Kevin Reviewed By: Conrad git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@6647 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
10 additions
and
9 deletions
plugins/ktcore/folder/Rename.php
| ... | ... | @@ -47,7 +47,6 @@ class KTFolderRenameAction extends KTFolderAction { |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | function getInfo() { |
| 50 | - if ($this->oFolder->getId() == 1) { return null; } | |
| 51 | 50 | return parent::getInfo(); |
| 52 | 51 | } |
| 53 | 52 | |
| ... | ... | @@ -76,15 +75,17 @@ class KTFolderRenameAction extends KTFolderAction { |
| 76 | 75 | $sFolderName = $this->oValidator->validateString($sFolderName, $aErrorOptions); |
| 77 | 76 | $sOldFolderName = $this->oFolder->getName(); |
| 78 | 77 | |
| 79 | - $oParentFolder =& Folder::get($this->oFolder->getParentID()); | |
| 80 | - if(PEAR::isError($oParentFolder)) { | |
| 81 | - $this->errorRedirectToMain(_kt('Unable to retrieve parent folder.'), $aErrorOptions['redirect_to'][1]); | |
| 82 | - exit(0); | |
| 83 | - } | |
| 78 | + if ($this->oFolder->getId() != 1) { | |
| 79 | + $oParentFolder =& Folder::get($this->oFolder->getParentID()); | |
| 80 | + if(PEAR::isError($oParentFolder)) { | |
| 81 | + $this->errorRedirectToMain(_kt('Unable to retrieve parent folder.'), $aErrorOptions['redirect_to'][1]); | |
| 82 | + exit(0); | |
| 83 | + } | |
| 84 | 84 | |
| 85 | - if(KTFolderUtil::exists($oParentFolder, $sFolderName)) { | |
| 86 | - $this->errorRedirectToMain(_kt('A folder with that name already exists.'), $aErrorOptions['redirect_to'][1]); | |
| 87 | - exit(0); | |
| 85 | + if(KTFolderUtil::exists($oParentFolder, $sFolderName)) { | |
| 86 | + $this->errorRedirectToMain(_kt('A folder with that name already exists.'), $aErrorOptions['redirect_to'][1]); | |
| 87 | + exit(0); | |
| 88 | + } | |
| 88 | 89 | } |
| 89 | 90 | |
| 90 | 91 | $res = KTFolderUtil::rename($this->oFolder, $sFolderName, $this->oUser); | ... | ... |