diff --git a/Classes/Elements/ImagePointElement.php b/Classes/Elements/ImagePointElement.php index 0f88a03..7cb6a20 100644 --- a/Classes/Elements/ImagePointElement.php +++ b/Classes/Elements/ImagePointElement.php @@ -4,6 +4,8 @@ namespace Clickstorm\CsImagePoint\Elements; +use Override; +use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity; use TYPO3\CMS\Backend\Form\Element\AbstractFormElement; use TYPO3\CMS\Backend\Form\NodeFactory; use TYPO3\CMS\Backend\Routing\Exception\RouteNotFoundException; @@ -23,6 +25,17 @@ */ class ImagePointElement extends AbstractFormElement { + /** + * Summary of templateView + * @var StandaloneView + */ + protected StandaloneView $templateView; + + /** + * Summary of uriBuilder + * @var UriBuilder + */ + protected UriBuilder $uriBuilder; /** * Default field information enabled for this element. @@ -55,6 +68,7 @@ public function __construct(NodeFactory $nodeFactory, array $data) $this->uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); } + #[Override] public function render(): array { $parameterArray = $this->data['parameterArray']; @@ -71,7 +85,7 @@ public function render(): array $this->getLanguageService()->sL( 'LLL:EXT:cs_image_point/Resources/Private/Language/locallang.xlf:error.wrongNumberOfImages.header' ), - FlashMessage::ERROR, + ContextualFeedbackSeverity::ERROR, true ); @@ -82,13 +96,7 @@ public function render(): array $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_file_reference'); $result = $queryBuilder ->select('uid') - ->from('sys_file_reference') - ->where( - $queryBuilder->expr()->eq('uid_foreign', $queryBuilder->createNamedParameter($uidForeign)), - $queryBuilder->expr()->eq('fieldname', $queryBuilder->createNamedParameter($imageFieldName)), - $queryBuilder->expr()->eq('tablenames', $queryBuilder->createNamedParameter($tablename)) - ) - ->execute(); + ->from('sys_file_reference')->where($queryBuilder->expr()->eq('uid_foreign', $queryBuilder->createNamedParameter($uidForeign)), $queryBuilder->expr()->eq('fieldname', $queryBuilder->createNamedParameter($imageFieldName)), $queryBuilder->expr()->eq('tablenames', $queryBuilder->createNamedParameter($tablename)))->executeQuery(); $result = $result->fetchAllAssociative(); $sysFileReferenceUid = $result[0]['uid'] ?? 0; @@ -115,8 +123,8 @@ public function render(): array $attributes = [ 'id' => $fieldId, - 'name' => htmlspecialchars($parameterArray['itemFormElName']), - 'data-formengine-input-name' => htmlspecialchars($parameterArray['itemFormElName']), + 'name' => htmlspecialchars((string) $parameterArray['itemFormElName']), + 'data-formengine-input-name' => htmlspecialchars((string) $parameterArray['itemFormElName']), ]; $attributes['placeholder'] = 'Coordinates'; @@ -136,7 +144,7 @@ public function render(): array 'uri' => $this->getWizardUri($sysFileReferenceUid), 'id' => $fieldId, 'fieldInformationHtml' => $fieldInformationHtml, - 'itemValue' => htmlspecialchars($itemValue, ENT_QUOTES), + 'itemValue' => htmlspecialchars((string) $itemValue, ENT_QUOTES), 'attributesString' => GeneralUtility::implodeAttributes($attributes, true), 'attributes' => $attributes, 'iconHtml' => $this->iconFactory->getIcon('actions-thumbtack', Icon::SIZE_SMALL)->render(), diff --git a/composer.json b/composer.json index 5257320..f70b6a6 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "GPL-2.0-or-later" ], "require": { - "typo3/cms-core": "^11.5" + "typo3/cms-core": "^12.4" }, "require-dev": { "typo3/testing-framework": "*" diff --git a/ext_localconf.php b/ext_localconf.php index a32275d..079ef4f 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -2,7 +2,7 @@ use Clickstorm\CsImagePoint\Elements\ImagePointElement; -defined('TYPO3_MODE') || die(); +defined('TYPO3') || die(); (function () { $GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1650359230] = [