Fixed bug em task or for update fixed
authorSteffen Kamper <info@sk-typo3.de>
Wed, 17 Nov 2010 18:55:04 +0000 (18:55 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Wed, 17 Nov 2010 18:55:04 +0000 (18:55 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9466 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/em/classes/database/class.tx_em_database.php

index bad626a..4d324a1 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,7 @@
 
 2010-11-17  Steffen Kamper  <steffen@typo3.org>
 
+       * Fixed bug em task or for update fixed
        * Added feature #16295: Optimize stdWrap usage for TypoScript content element FORM (Thanks to Jo Hasenau)
        * Added feature #16287: Optimize stdWrap usage for TypoScript content element IMGTEXT (Thanks to Jo Hasenau)
        * Added feature #16382: Optimize stdWrap usage for TypoScript content element MULTIMEDIA (Thanks to Jo Hasenau)
index 6f13721..fe44fc2 100644 (file)
@@ -131,7 +131,9 @@ final class tx_em_Database {
         * @return  void
         */
        public function updateRepository(tx_em_Repository $repository) {
-               $GLOBALS['TYPO3_DB']->exec_UPDATEquery(self::TABLE_REPOSITORY, $repository->getId(),
+               $GLOBALS['TYPO3_DB']->exec_UPDATEquery(
+                       self::TABLE_REPOSITORY,
+                       'uid=' . $repository->getId(),
                        array(
                                'title' => $repository->getTitle(),
                                'description' => $repository->getDescription(),
@@ -164,6 +166,22 @@ final class tx_em_Database {
                return $GLOBALS['TYPO3_DB']->sql_insert_id();
        }
 
+       /**
+        * Updates ExtCount and lastUpdated  in Repository eg after import
+        * @param  int $extCount
+        * @param int $uid
+        * @return void
+        */
+       public function updateRepositoryCount($extCount, $uid = 1) {
+               $GLOBALS['TYPO3_DB']->exec_UPDATEquery(
+                        self::TABLE_REPOSITORY,
+                        'uid=' . intval($uid),
+                        array (
+                               'lastUpdated' => time(),
+                               'extCount' => intval($extCount)
+                        ));
+       }
+
        /**
         * Insert version
         *
@@ -187,8 +205,9 @@ final class tx_em_Database {
                        'repository=' . intval($repositoryUid),
                        'extkey'
                );
+               $extensions = count($groupedRows);
 
-               if (count($groupedRows)) {
+               if ($extensions > 0) {
                        // set all to 0
                        $GLOBALS['TYPO3_DB']->exec_UPDATEquery(
                                'cache_extensions',
@@ -205,6 +224,8 @@ final class tx_em_Database {
                                );
                        }
                }
+
+               return $extensions;
        }