[BUGFIX] Fix warning in adapter service 01/18701/2
authorHelmut Hummel <h.hummel@bitmotion.de>
Tue, 5 Mar 2013 16:39:26 +0000 (17:39 +0100)
committerHelmut Hummel <helmut.hummel@typo3.org>
Tue, 5 Mar 2013 16:44:17 +0000 (17:44 +0100)
The merge of #45415 introduced a warning
because the new meta column name was
used as array key.

Skip this step when the meta column
is found to fix this issue.

Fixes: #45415
Releases: 6.1, 6.0

Change-Id: I5446104359816d0ccacf6c239b86b9b073783174
Reviewed-on: https://review.typo3.org/18700
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
Reviewed-on: https://review.typo3.org/18701

typo3/sysext/core/Classes/Resource/Service/FrontendContentAdapterService.php

index 4716dea..57c4535 100644 (file)
@@ -44,7 +44,7 @@ class FrontendContentAdapterService {
                                'captions' => 'imagecaption',
                                'links' => 'image_link',
                                'alternativeTexts' => 'altText',
-                               'typeMatch' => array(
+                               '__typeMatch' => array(
                                        'typeField' => 'CType',
                                        'types' => array('image', 'textpic'),
                                )
@@ -52,7 +52,7 @@ class FrontendContentAdapterService {
                        'media' => array(
                                'paths' => 'media',
                                'captions' => 'imagecaption',
-                               'typeMatch' => array(
+                               '__typeMatch' => array(
                                        'typeField' => 'CType',
                                        'types' => array('uploads'),
                                )
@@ -111,6 +111,9 @@ class FrontendContentAdapterService {
                                                $fileFieldContents[$migrateFieldName .  '_fileUids'][] = $file->getOriginalFile()->getUid();
                                        }
                                        foreach ($oldFieldNames as $oldFieldType => $oldFieldName) {
+                                               if ($oldFieldType === '__typeMatch') {
+                                                       continue;
+                                               }
                                                // For paths, make comma separated list
                                                if ($oldFieldType === 'paths' || substr($oldFieldType, -9) == '_fileUids') {
                                                        $fieldContents = implode(',', $fileFieldContents[$oldFieldType]);
@@ -136,10 +139,10 @@ class FrontendContentAdapterService {
         */
        static protected function fieldIsInType($fieldName, $table, array $row) {
                $fieldConfiguration = static::$migrateFields[$table][$fieldName];
-               if (empty($fieldConfiguration['typeMatch'])) {
+               if (empty($fieldConfiguration['__typeMatch'])) {
                        return TRUE;
                } else {
-                       return in_array($row[$fieldConfiguration['typeMatch']['typeField']], $fieldConfiguration['typeMatch']['types']);
+                       return in_array($row[$fieldConfiguration['__typeMatch']['typeField']], $fieldConfiguration['__typeMatch']['types']);
                }
        }
 }