- Clear All Cache also for the cached imagesizes (see clear_cacheCmd)
[Packages/TYPO3.CMS.git] / t3lib / class.t3lib_tcemain.php
index b1968c4..2da4bba 100755 (executable)
@@ -40,7 +40,7 @@
  *  190: class t3lib_TCEmain   
  *  275:     function start($data,$cmd,$altUserObject='')      
  *  308:     function setMirror($mirror)       
- *  333:     function setDefaultsFromUserTS($userTS)   
+ *  333:     function setDefaultsFromUserTS($userTS)
  *  357:     function process_uploads($postFiles)      
  *  387:     function process_uploads_traverseArray(&$outputArr,$inputArr,$keyToSet)   
  *
@@ -86,7 +86,7 @@
  *
  *              SECTION: Storing data to Database Layer
  * 2076:     function updateDB($table,$id,$fieldArray) 
- * 2122:     function compareFieldArrayWithCurrentAndUnset($table,$id,$fieldArray)     
+ * 2122:     function compareFieldArrayWithCurrentAndUnset($table,$id,$fieldArray)
  * 2170:     function insertDB($table,$id,$fieldArray) 
  * 2224:     function checkStoredRecord($table,$id,$fieldArray,$action)        
  * 2259:     function dbAnalysisStoreExec()    
@@ -333,9 +333,8 @@ class t3lib_TCEmain {
        function setDefaultsFromUserTS($userTS) {
                global $TCA;
                if (is_array($userTS))  {
-                       reset($userTS);
-                       while(list($k,$v)=each($userTS))        {
-                               $k=substr($k,0,-1);
+                       foreach($userTS as $k => $v)    {
+                               $k = substr($k,0,-1);
                                if ($k && is_array($v) && isset($TCA[$k]))      {
                                        if (is_array($this->defaultValues[$k])) {
                                                $this->defaultValues[$k] = array_merge($this->defaultValues[$k],$v);
@@ -2195,7 +2194,8 @@ class t3lib_TCEmain       {
 
                                // Unset the fields which are similar:
                        foreach($fieldArray as $col => $val)    {
-                               if (!isset($currentRecord[$col]) ||             // Unset fields which were NOT found in the current record!
+                               if (
+                                               #!isset($currentRecord[$col]) ||                // Unset fields which were NOT found in the current record! [Uncommented because NULL fields will not return an entry in the array!]
                                                !strcmp($val,$currentRecord[$col]) ||   // Unset fields which matched exactly.
                                                ($cRecTypes[$col]=='int' && $currentRecord[$col]==0 && !strcmp($val,''))        // Now, a situation where TYPO3 tries to put an empty string into an integer field, we should not strcmp the integer-zero and '', but rather accept them to be similar.
                                        )       {
@@ -4004,6 +4004,7 @@ class t3lib_TCEmain       {
                                        if (t3lib_extMgm::isLoaded('cms'))      {
                                                $GLOBALS['TYPO3_DB']->exec_DELETEquery('cache_pages','');
                                                $GLOBALS['TYPO3_DB']->exec_DELETEquery('cache_pagesection','');
+                                               $GLOBALS['TYPO3_DB']->exec_DELETEquery('cache_imagesizes','');
                                        }
                                        $GLOBALS['TYPO3_DB']->exec_DELETEquery('cache_hash','');
                                }