[BUGFIX][EM] Fix of last update time after update 33/19633/3
authorJost Baron <jost.baron@gmx.de>
Fri, 22 Mar 2013 21:23:20 +0000 (22:23 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 5 Apr 2013 21:37:52 +0000 (23:37 +0200)
The time of the last update in the extension manager was not displayed
correctly immediately after an update, an additional refresh was needed.

Fixes: #46573
Releases: 6.1, 6.0
Change-Id: I51b0c966ddb3dda522cc68573d440e24273e96bc
Reviewed-on: https://review.typo3.org/19633
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/extensionmanager/Classes/Controller/UpdateFromTerController.php
typo3/sysext/extensionmanager/Classes/Domain/Repository/RepositoryRepository.php

index f10649a..fd27078 100644 (file)
@@ -109,7 +109,7 @@ class UpdateFromTerController extends \TYPO3\CMS\Extensionmanager\Controller\Abs
                        }
                }
                /** @var $repository \TYPO3\CMS\Extensionmanager\Domain\Model\Repository */
-               $repository = $this->repositoryRepository->findOneByUid((int)$this->settings['repositoryUid']);
+               $repository = $this->repositoryRepository->findByUid((int)$this->settings['repositoryUid']);
                $this->view->assign('updated', $updated)
                                ->assign('repository', $repository)
                                ->assign('errorMessage', $errorMessage);
index e167824..3316f5e 100644 (file)
@@ -50,10 +50,12 @@ class RepositoryRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
         * @return void
         */
        public function updateRepositoryCount($extCount, $uid = 1) {
-               $GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_extensionmanager_domain_model_repository', 'uid=' . intval($uid), array(
-                       'last_update' => time(),
-                       'extension_count' => intval($extCount)
-               ));
+               $repository = $this->findByUid($uid);
+
+               $repository->setLastUpdate(new \DateTime());
+               $repository->setExtensionCount(intval($extCount));
+
+               $this->update($repository);
        }
 
        /**