I included the Static Template file before the Fluid Styled content
I inserted an image in the text field with the plugin. It is working in the backend.
If I view the page in the frontend I get an error: Netresearch\RteCKEditorImage\Controller\ImageRenderingController::getLazyLoadingConfiguration(): Return value must be of type ?array, string returned
Expected behavior
That I can see the image in the text.
The function getLazyLoadingConfiguration is just one line and has to return an array or null:
private function getLazyLoadingConfiguration(): ?array { return $GLOBALS['TSFE']->tmpl->setup['lib.']['contentElement.']['settings.']['media.']['lazyLoading'] ?? null; }
lazyLoading gets set in typo3/sysext/fluid_styled_content/Configuration/TypoScript/Helper/ContentElement.typoscript with the value of the constant {$styles.content.image.lazyLoading}. This constant is initialized in typo3/sysext/fluid_styled_content/Configuration/TypoScript/constants.typoscript with the string value 'lazy'. So the getLazyLoadingConfiguration function needs to return a string or null.
It seems the error was introduced in commit 4ddb62d1df5b2c45bb4d60217f0a9dc2cc67cde2
Screenshots or logs
Environment
TYPO3 version:
PHP version: 8.0.19
Extension version: 11.0.7
Documentation
Have you checked the readme/documentation?
Bug description if I add an image to a rich text field I get an error in the frontend.
Steps to reproduce To reproduce the problem:
I installed the extension on an existing site according to the README.md
Expected behavior That I can see the image in the text.
The function getLazyLoadingConfiguration is just one line and has to return an array or null:
private function getLazyLoadingConfiguration(): ?array { return $GLOBALS['TSFE']->tmpl->setup['lib.']['contentElement.']['settings.']['media.']['lazyLoading'] ?? null; }
lazyLoading gets set in typo3/sysext/fluid_styled_content/Configuration/TypoScript/Helper/ContentElement.typoscript with the value of the constant {$styles.content.image.lazyLoading}. This constant is initialized in typo3/sysext/fluid_styled_content/Configuration/TypoScript/constants.typoscript with the string value 'lazy'. So the getLazyLoadingConfiguration function needs to return a string or null.
It seems the error was introduced in commit 4ddb62d1df5b2c45bb4d60217f0a9dc2cc67cde2
Screenshots or logs
Environment
Documentation Have you checked the readme/documentation?