[BUGFIX] Do not fetch extension list on every request
[Packages/TYPO3.CMS.git] / typo3 / sysext / extensionmanager / Classes / Controller / UpdateFromTerController.php
index 3f62a79..1724b14 100644 (file)
@@ -95,18 +95,16 @@ class Tx_Extensionmanager_Controller_UpdateFromTerController extends Tx_Extensio
        /**
         * Update extension list from TER
         *
+        * @param boolean $forceUpdateCheck
         * @return void
         */
-       public function updateExtensionListFromTerAction() {
+       public function updateExtensionListFromTerAction($forceUpdateCheck) {
                $updated = FALSE;
-               $forceUpdateCheck = FALSE;
                $errorMessage = '';
-               if ($this->request->hasArgument('forceUpdateCheck') && (int)$this->request->getArgument('forceUpdateCheck') == 1) {
-                       $forceUpdateCheck = TRUE;
-               }
+
                /** @var $repository Tx_Extensionmanager_Domain_Model_Repository */
                $repository = $this->repositoryRepository->findOneByUid((int)$this->settings['repositoryUid']);
-               if ($repository->getLastUpdate() < ($GLOBALS['EXEC_TIME'] - 24 * 60 * 60) || $forceUpdateCheck) {
+               if ($repository->getLastUpdate()->getTimestamp() < ($GLOBALS['EXEC_TIME'] - 24 * 60 * 60) || $forceUpdateCheck) {
                        try {
                                $updated = $this->repositoryHelper->updateExtList();
                        } catch (Tx_Extensionmanager_Exception_ExtensionManager $e) {