diff --git a/Classes/Hooks/PageLayoutView/PluginRenderer.php b/Classes/Hooks/PageLayoutView/PluginRenderer.php index d0a8de4a53149454ccd26d2dbfd1bf7cead17d8a..40961485e18cff7afc078cbf19c06bc027785298 100644 --- a/Classes/Hooks/PageLayoutView/PluginRenderer.php +++ b/Classes/Hooks/PageLayoutView/PluginRenderer.php @@ -59,23 +59,25 @@ class PluginRenderer implements PageLayoutViewDrawItemHookInterface { // Set plugin options array $pluginOptions = GeneralUtility::xml2array($row['pi_flexform'], 'T3:'); $templateOptions = []; - foreach ($pluginOptions['data']['sDEF']['lDEF'] as $option => $value) { - if ($option !== 'settings.showApiResult') { - // $option has the format 'settings.<key>', but in the template we want the language label which - // has the format 'flexform.<key>'. - $templateOptions[str_replace('settings.', '', $option)] = $value['vDEF']; + if (is_array($pluginOptions)) { + foreach ($pluginOptions['data']['sDEF']['lDEF'] as $option => $value) { + if ($option !== 'settings.showApiResult') { + // $option has the format 'settings.<key>', but in the template we want the language label which + // has the format 'flexform.<key>'. + $templateOptions[str_replace('settings.', '', $option)] = $value['vDEF']; + } } - } - $languageService = GeneralUtility::makeInstance(LanguageService::class); - $templateOptions['flexform.thumbnailType'] = $languageService->sL( - 'LLL:EXT:sg_youtube/Resources/Private/Language/locallang.xlf:flexform.thumbnailType.' . $templateOptions['flexform.thumbnailType'] - ); + $languageService = GeneralUtility::makeInstance(LanguageService::class); + $templateOptions['flexform.thumbnailType'] = $languageService->sL( + 'LLL:EXT:sg_youtube/Resources/Private/Language/locallang.xlf:flexform.thumbnailType.' . $templateOptions['flexform.thumbnailType'] + ); - $view->assignMultiple([ - 'pluginOptions' => $templateOptions, - 'showApiResult' => $pluginOptions['data']['sDEF']['lDEF']['settings.showApiResult']['vDEF'] - ]); + $view->assignMultiple([ + 'pluginOptions' => $templateOptions, + 'showApiResult' => $pluginOptions['data']['sDEF']['lDEF']['settings.showApiResult']['vDEF'] + ]); + } // Content element labels $pluginName = BackendUtility::getLabelFromItemListMerged( diff --git a/Configuration/FlexForms/flexform_sgyoutube_youtube.xml b/Configuration/FlexForms/flexform_sgyoutube_youtube.xml index 5522d30ce4cd2353731f6055e7d4fa351a27c723..167177cf0d68901edb4ed6d6a1f9ae56f922f467 100644 --- a/Configuration/FlexForms/flexform_sgyoutube_youtube.xml +++ b/Configuration/FlexForms/flexform_sgyoutube_youtube.xml @@ -58,6 +58,7 @@ <label>LLL:EXT:sg_youtube/Resources/Private/Language/locallang.xlf:flexform.aspectRatio</label> <config> <type>select</type> + <renderType>selectSingle</renderType> <items type="array"> <numIndex index="0" type="array"> <numIndex index="0">16:9</numIndex> @@ -76,6 +77,7 @@ <label>LLL:EXT:sg_youtube/Resources/Private/Language/locallang.xlf:flexform.thumbnailType</label> <config> <type>select</type> + <renderType>selectSingle</renderType> <items type="array"> <numIndex index="0" type="array"> <numIndex index="0">LLL:EXT:sg_youtube/Resources/Private/Language/locallang.xlf:flexform.thumbnailType.byAspectRatio</numIndex>