[BUGFIX] Fail silently in category registry 65/29765/3
authorHelmut Hummel <helmut.hummel@typo3.org>
Thu, 1 May 2014 21:22:40 +0000 (23:22 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Fri, 2 May 2014 10:06:36 +0000 (12:06 +0200)
The idea was to fail when the category registry
is used in a wrong way. This however causes troubles
when the core itself reloads extension tables during
extension installation process.

Remove the exceptions, fail silently on wrong usage
and let the installation work again.

Resolves: #58384
Releases: 6.2
Change-Id: Icd6ec77fea9d95c9a58e75a85546c0ecc2a5c6d7
Reviewed-on: https://review.typo3.org/29765
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
typo3/sysext/core/Classes/Category/CategoryRegistry.php

index 7f519a6..98ffd22 100644 (file)
@@ -39,11 +39,6 @@ use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 class CategoryRegistry implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
-        * @var bool
-        */
-       protected $preRegisteredTablesHaveBeenApplied = FALSE;
-
-       /**
         * @var array
         */
        protected $registry = array();
@@ -117,10 +112,8 @@ class CategoryRegistry implements \TYPO3\CMS\Core\SingletonInterface {
 
                        if (isset($GLOBALS['TCA'][$tableName]['columns'])) {
                                $this->applyTcaForTableAndField($tableName, $fieldName);
-                       } elseif ($this->preRegisteredTablesHaveBeenApplied) {
-                               throw new \RuntimeException('You tried to add a category column to a non-existing table "' . $tableName . '"!', 1397838817);
+                               $didRegister = TRUE;
                        }
-                       $didRegister = TRUE;
                }
 
                return $didRegister;
@@ -246,10 +239,6 @@ class CategoryRegistry implements \TYPO3\CMS\Core\SingletonInterface {
         * @throws \RuntimeException
         */
        public function applyTcaForPreRegisteredTables() {
-               if ($this->preRegisteredTablesHaveBeenApplied) {
-                       throw new \RuntimeException('applyTcaForPreRegisteredTables has already been called. It is not allowed to call it a second time.', 1397841334);
-               }
-               $this->preRegisteredTablesHaveBeenApplied = TRUE;
                $this->registerDefaultCategorizedTables();
                foreach ($this->registry as $tableName => $fields) {
                        foreach (array_keys($fields) as $fieldName) {