[BUGFIX] Fix PHP Warning in updateRefIndexTable() 40/42640/2
authorStephan Großberndt <stephan@grossberndt.de>
Thu, 13 Aug 2015 17:50:35 +0000 (19:50 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Sat, 15 Aug 2015 11:42:09 +0000 (13:42 +0200)
This patch fixes a PHP Warning occurring if
ReferenceIndex::updateRefIndexTable() is called with a tableName of a
table without a TCA definition.

Resolves: #68503
Releases: master, 6.2
Change-Id: I2fd755703199a4d76ef29082e9306833a18be130
Reviewed-on: http://review.typo3.org/42640
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/core/Classes/Database/ReferenceIndex.php

index 53f4ffa..fdbbd05 100644 (file)
@@ -1050,6 +1050,10 @@ class ReferenceIndex {
         * @return string Fields which could contain a relation
         */
        protected function fetchTableRelationFields($tableName) {
+               if (!isset($GLOBALS['TCA'][$tableName])) {
+                       return '';
+               }
+
                $fields = array();
 
                foreach ($GLOBALS['TCA'][$tableName]['columns'] as $field => $fieldDefinition) {