[BUGFIX] Check correctly if showitem key exists in TcaMigration 52/46852/2
authorWouter Wolters <typo3@wouterwolters.nl>
Tue, 23 Feb 2016 19:02:18 +0000 (20:02 +0100)
committerAndreas Fernandez <typo3@scripting-base.de>
Tue, 23 Feb 2016 19:27:41 +0000 (20:27 +0100)
Resolves: #73529
Releases: master, 7.6
Change-Id: Id4f6558b1130bcff8e70f1f0e0dfe38645d33c7f
Reviewed-on: https://review.typo3.org/46852
Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
typo3/sysext/core/Classes/Migrations/TcaMigration.php
typo3/sysext/core/Tests/Unit/Migrations/TcaMigrationTest.php

index 2401618..d418590 100644 (file)
@@ -132,7 +132,7 @@ class TcaMigration
                 continue;
             }
             foreach ($tableDefinition['types'] as $typeName => $typeArray) {
-                if (!is_string($typeArray['showitem']) || strpos($typeArray['showitem'], ';') === false) {
+                if (!isset($typeArray['showitem']) || !is_string($typeArray['showitem']) || strpos($typeArray['showitem'], ';') === false) {
                     // Continue directly if no semicolon is found
                     continue;
                 }
index f3fab06..a41a30f 100644 (file)
@@ -382,6 +382,7 @@ class TcaMigrationTest extends UnitTestCase
                     0 => array(
                         'showitem' => 'aField;;;',
                     ),
+                    1 => array()
                 ),
             ),
         );