do not try to rename folder that has not changed
authorPhilipp Schüle <p.schuele@metaways.de>
Mon, 20 Jun 2016 09:04:08 +0000 (11:04 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Mon, 20 Jun 2016 11:39:15 +0000 (13:39 +0200)
Change-Id: I6288a329deeccca1eb3580622aaadffaa497ffc4
Reviewed-on: http://gerrit.tine20.com/customers/3255
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Felamimail/Controller/Folder.php

index 9c98c77..925d7d7 100644 (file)
@@ -384,8 +384,15 @@ class Felamimail_Controller_Folder extends Tinebase_Controller_Abstract implemen
         
         $newLocalName = $this->_prepareFolderName($_newLocalName);
         $newGlobalName = $this->_buildNewGlobalName($newLocalName, $_oldGlobalName);
+
+        if ($_oldGlobalName === $newGlobalName) {
+            if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__
+                . ' No change required, new name = old name.');
+            return $this->getByBackendAndGlobalName($account, $newGlobalName);
+        }
         
-        if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Renaming ... ' . $_oldGlobalName . ' -> ' . $newGlobalName);
+        if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__
+            . ' Renaming ... ' . $_oldGlobalName . ' -> ' . $newGlobalName);
         
         $this->_renameFolderOnIMAP($account, $newGlobalName, $_oldGlobalName);
         $folder = $this->_renameFolderInCache($account, $newGlobalName, $_oldGlobalName, $newLocalName);