From 0bbb52439372c7de78b04159e9fd61d32e1325ea Mon Sep 17 00:00:00 2001 From: Sebastian Fischer Date: Fri, 19 Dec 2025 16:07:05 +0100 Subject: [PATCH 1/8] [TASK] Add // @extensionScannerIgnoreLine where needed to avoid warnings --- Classes/Controller/BackendModuleController.php | 7 +++++++ Classes/Controller/SessionController.php | 2 ++ Classes/Controller/SpeakerController.php | 3 +++ Classes/Controller/TagController.php | 2 ++ Classes/Domain/Factory/SuggestFormFactory.php | 1 + Classes/ViewHelpers/Link/Be/DayViewHelper.php | 1 + Classes/ViewHelpers/Link/Be/RoomViewHelper.php | 1 + Classes/ViewHelpers/Link/Be/SessionViewHelper.php | 1 + Classes/ViewHelpers/Link/Be/SlotViewHelper.php | 1 + Classes/ViewHelpers/Link/Be/SpeakerViewHelper.php | 1 + Classes/ViewHelpers/Link/Be/TagViewHelper.php | 1 + 11 files changed, 21 insertions(+) diff --git a/Classes/Controller/BackendModuleController.php b/Classes/Controller/BackendModuleController.php index 9cc46ed..355b712 100644 --- a/Classes/Controller/BackendModuleController.php +++ b/Classes/Controller/BackendModuleController.php @@ -70,6 +70,7 @@ public function showAction(): ResponseInterface $parsedBody = []; } $queryParams = $this->request->getQueryParams(); + // @extensionScannerIgnoreLine $this->id = (int)($parsedBody['id'] ?? $queryParams['id'] ?? 0); $day = (int)($parsedBody['day'] ?? $queryParams['day'] ?? 0); @@ -96,6 +97,7 @@ public function showAction(): ResponseInterface } $view->setTitle($title); + // @extensionScannerIgnoreLine $page = BackendUtility::getRecord('pages', $this->id); if ($page !== null && isset($page['doktype']) && (int)$page['doktype'] === Constants::STORAGE_FOLDER_TYPE) { $docHeaderComponent = $view->getDocHeaderComponent(); @@ -133,6 +135,7 @@ protected function registerMenuDays(MenuRegistry $menuRegistry): void protected function registerButtonNewSession(ButtonBar $buttonBar): void { $parameters = [ + // @extensionScannerIgnoreLine 'edit' => ['tx_sessionplaner_domain_model_session' => [$this->id => 'new']], 'returnUrl' => $this->createModuleUri(), ]; @@ -148,6 +151,7 @@ protected function registerButtonNewSession(ButtonBar $buttonBar): void protected function registerButtonNewSpeaker(ButtonBar $buttonBar): void { $parameters = [ + // @extensionScannerIgnoreLine 'edit' => ['tx_sessionplaner_domain_model_speaker' => [$this->id => 'new']], 'returnUrl' => $this->createModuleUri(), ]; @@ -163,6 +167,7 @@ protected function registerButtonNewSpeaker(ButtonBar $buttonBar): void protected function registerButtonNewRoom(ButtonBar $buttonBar): void { $parameters = [ + // @extensionScannerIgnoreLine 'edit' => ['tx_sessionplaner_domain_model_room' => [$this->id => 'new']], 'returnUrl' => $this->createModuleUri(), ]; @@ -178,6 +183,7 @@ protected function registerButtonNewRoom(ButtonBar $buttonBar): void protected function registerButtonNewDay(ButtonBar $buttonBar): void { $parameters = [ + // @extensionScannerIgnoreLine 'edit' => ['tx_sessionplaner_domain_model_day' => [$this->id => 'new']], 'returnUrl' => $this->createModuleUri(), ]; @@ -199,6 +205,7 @@ public function createModuleUri(array $params = []): string } $baseParams = [ + // @extensionScannerIgnoreLine 'id' => (string)$this->id, 'day' => $this->currentDay !== null ? (string)$this->currentDay->getUid() : '', ]; diff --git a/Classes/Controller/SessionController.php b/Classes/Controller/SessionController.php index b5d7c64..7cf61ca 100644 --- a/Classes/Controller/SessionController.php +++ b/Classes/Controller/SessionController.php @@ -68,9 +68,11 @@ public function showAction(?Session $session = null): ResponseInterface $metaTagRegistry = GeneralUtility::makeInstance(MetaTagManagerRegistry::class); $ogMetaTagManager = $metaTagRegistry->getManagerForProperty('og:title'); + // @extensionScannerIgnoreLine $ogMetaTagManager->addProperty('og:title', $session->getTopic()); $twitterMetaTagManager = $metaTagRegistry->getManagerForProperty('twitter:title'); + // @extensionScannerIgnoreLine $twitterMetaTagManager->addProperty('twitter:title', $session->getTopic()); $this->view->assign('session', $session); diff --git a/Classes/Controller/SpeakerController.php b/Classes/Controller/SpeakerController.php index 8358275..f614167 100644 --- a/Classes/Controller/SpeakerController.php +++ b/Classes/Controller/SpeakerController.php @@ -35,6 +35,7 @@ public function __construct(SpeakerRepository $speakerRepository) protected function initializeAction(): void { if (!isset($this->settings['speakerSinglePid']) || $this->settings['speakerSinglePid'] === '') { + // @extensionScannerIgnoreLine // @phpstan-ignore property.deprecatedClass $this->settings['speakerSinglePid'] = (string) ($this->getTypoScriptFrontendController()->id ?? ''); } @@ -74,9 +75,11 @@ public function showAction(Speaker $speaker): ResponseInterface $metaTagRegistry = GeneralUtility::makeInstance(MetaTagManagerRegistry::class); $ogMetaTagManager = $metaTagRegistry->getManagerForProperty('og:title'); + // @extensionScannerIgnoreLine $ogMetaTagManager->addProperty('og:title', $speaker->getName()); $twitterMetaTagManager = $metaTagRegistry->getManagerForProperty('twitter:title'); + // @extensionScannerIgnoreLine $twitterMetaTagManager->addProperty('twitter:title', $speaker->getName()); $this->view->assign('speaker', $speaker); diff --git a/Classes/Controller/TagController.php b/Classes/Controller/TagController.php index c9cf124..a1235fa 100644 --- a/Classes/Controller/TagController.php +++ b/Classes/Controller/TagController.php @@ -36,9 +36,11 @@ public function showAction(?Tag $tag = null): ResponseInterface $metaTagRegistry = GeneralUtility::makeInstance(MetaTagManagerRegistry::class); $ogMetaTagManager = $metaTagRegistry->getManagerForProperty('og:title'); + // @extensionScannerIgnoreLine $ogMetaTagManager->addProperty('og:title', $tag->getLabel()); $twitterMetaTagManager = $metaTagRegistry->getManagerForProperty('twitter:title'); + // @extensionScannerIgnoreLine $twitterMetaTagManager->addProperty('twitter:title', $tag->getLabel()); $this->view->assign('tag', $tag); diff --git a/Classes/Domain/Factory/SuggestFormFactory.php b/Classes/Domain/Factory/SuggestFormFactory.php index 89f5267..1a13673 100644 --- a/Classes/Domain/Factory/SuggestFormFactory.php +++ b/Classes/Domain/Factory/SuggestFormFactory.php @@ -193,6 +193,7 @@ public function build(array $configuration, ?string $prototypeName = null, ?Serv $stringLengthValidator = GeneralUtility::makeInstance(StringLengthValidator::class, ['minimum' => 5]); } else { $stringLengthValidator = GeneralUtility::makeInstance(StringLengthValidator::class); + // @extensionScannerIgnoreLine $stringLengthValidator->setOptions(['minimum' => 5]); } $descriptionField->addValidator($stringLengthValidator); diff --git a/Classes/ViewHelpers/Link/Be/DayViewHelper.php b/Classes/ViewHelpers/Link/Be/DayViewHelper.php index a53b5c5..3a24954 100644 --- a/Classes/ViewHelpers/Link/Be/DayViewHelper.php +++ b/Classes/ViewHelpers/Link/Be/DayViewHelper.php @@ -46,6 +46,7 @@ public function render(): string $params = [ 'edit' => ['tx_sessionplaner_domain_model_day' => [(int)$day->getUid() => 'edit']], + // @extensionScannerIgnoreLine 'returnUrl' => $request->getAttribute('normalizedParams')->getRequestUri(), ]; $uri = (string)$uriBuilder->buildUriFromRoute('record_edit', $params); diff --git a/Classes/ViewHelpers/Link/Be/RoomViewHelper.php b/Classes/ViewHelpers/Link/Be/RoomViewHelper.php index 1afc5fd..f7810e8 100644 --- a/Classes/ViewHelpers/Link/Be/RoomViewHelper.php +++ b/Classes/ViewHelpers/Link/Be/RoomViewHelper.php @@ -46,6 +46,7 @@ public function render(): string $params = [ 'edit' => ['tx_sessionplaner_domain_model_room' => [(int)$room->getUid() => 'edit']], + // @extensionScannerIgnoreLine 'returnUrl' => $request->getAttribute('normalizedParams')->getRequestUri(), ]; $uri = (string)$uriBuilder->buildUriFromRoute('record_edit', $params); diff --git a/Classes/ViewHelpers/Link/Be/SessionViewHelper.php b/Classes/ViewHelpers/Link/Be/SessionViewHelper.php index 841a8c5..d1f35db 100644 --- a/Classes/ViewHelpers/Link/Be/SessionViewHelper.php +++ b/Classes/ViewHelpers/Link/Be/SessionViewHelper.php @@ -46,6 +46,7 @@ public function render(): string $params = [ 'edit' => ['tx_sessionplaner_domain_model_session' => [(int)$session->getUid() => 'edit']], + // @extensionScannerIgnoreLine 'returnUrl' => $request->getAttribute('normalizedParams')->getRequestUri(), ]; $uri = (string)$uriBuilder->buildUriFromRoute('record_edit', $params); diff --git a/Classes/ViewHelpers/Link/Be/SlotViewHelper.php b/Classes/ViewHelpers/Link/Be/SlotViewHelper.php index 14d2fd0..0746317 100644 --- a/Classes/ViewHelpers/Link/Be/SlotViewHelper.php +++ b/Classes/ViewHelpers/Link/Be/SlotViewHelper.php @@ -46,6 +46,7 @@ public function render(): string $params = [ 'edit' => ['tx_sessionplaner_domain_model_slot' => [(int)$slot->getUid() => 'edit']], + // @extensionScannerIgnoreLine 'returnUrl' => $request->getAttribute('normalizedParams')->getRequestUri(), ]; $uri = (string)$uriBuilder->buildUriFromRoute('record_edit', $params); diff --git a/Classes/ViewHelpers/Link/Be/SpeakerViewHelper.php b/Classes/ViewHelpers/Link/Be/SpeakerViewHelper.php index ecf5fc0..79a6b9a 100644 --- a/Classes/ViewHelpers/Link/Be/SpeakerViewHelper.php +++ b/Classes/ViewHelpers/Link/Be/SpeakerViewHelper.php @@ -46,6 +46,7 @@ public function render(): string $params = [ 'edit' => ['tx_sessionplaner_domain_model_speaker' => [(int)$speaker->getUid() => 'edit']], + // @extensionScannerIgnoreLine 'returnUrl' => $request->getAttribute('normalizedParams')->getRequestUri(), ]; $uri = (string)$uriBuilder->buildUriFromRoute('record_edit', $params); diff --git a/Classes/ViewHelpers/Link/Be/TagViewHelper.php b/Classes/ViewHelpers/Link/Be/TagViewHelper.php index 5954a75..b2eab41 100644 --- a/Classes/ViewHelpers/Link/Be/TagViewHelper.php +++ b/Classes/ViewHelpers/Link/Be/TagViewHelper.php @@ -46,6 +46,7 @@ public function render(): string $params = [ 'edit' => ['tx_sessionplaner_domain_model_tag' => [(int)$tag->getUid() => 'edit']], + // @extensionScannerIgnoreLine 'returnUrl' => $request->getAttribute('normalizedParams')->getRequestUri(), ]; $uri = (string)$uriBuilder->buildUriFromRoute('record_edit', $params); From afc50f2b6cb0a1337823d00902a3fe91f7eeec5f Mon Sep 17 00:00:00 2001 From: Sebastian Fischer Date: Fri, 19 Dec 2025 16:31:02 +0100 Subject: [PATCH 2/8] [TASK] Replace annotation with attribute for lazy --- Classes/Domain/Factory/SuggestFormFactory.php | 27 ++++++------------- .../Domain/Finisher/SuggestFormFinisher.php | 2 +- Classes/Domain/Model/Day.php | 12 +++++---- Classes/Domain/Model/Room.php | 7 ++--- Classes/Domain/Model/Session.php | 9 ++++--- Classes/Domain/Model/Slot.php | 10 +++---- Classes/Domain/Model/Speaker.php | 3 ++- Classes/Domain/Model/Tag.php | 18 ++----------- 8 files changed, 33 insertions(+), 55 deletions(-) diff --git a/Classes/Domain/Factory/SuggestFormFactory.php b/Classes/Domain/Factory/SuggestFormFactory.php index 1a13673..1910ef2 100644 --- a/Classes/Domain/Factory/SuggestFormFactory.php +++ b/Classes/Domain/Factory/SuggestFormFactory.php @@ -17,7 +17,7 @@ use Evoweb\Sessionplaner\Enum\SessionRequestTypeEnum; use Evoweb\Sessionplaner\Enum\SessionTypeEnum; use Psr\Http\Message\ServerRequestInterface; -use TYPO3\CMS\Core\Information\Typo3Version; +use RuntimeException; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface; use TYPO3\CMS\Extbase\Utility\LocalizationUtility; @@ -29,7 +29,6 @@ use TYPO3\CMS\Form\Domain\Model\FormDefinition; use TYPO3\CMS\Form\Domain\Model\FormElements\GenericFormElement; use TYPO3\CMS\Form\Domain\Model\FormElements\Section; -use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; class SuggestFormFactory extends AbstractFormFactory { @@ -189,13 +188,9 @@ public function build(array $configuration, ?string $prototypeName = null, ?Serv ); $descriptionField->addValidator(GeneralUtility::makeInstance(NotEmptyValidator::class)); - if ((GeneralUtility::makeInstance(Typo3Version::class))->getMajorVersion() < 12) { - $stringLengthValidator = GeneralUtility::makeInstance(StringLengthValidator::class, ['minimum' => 5]); - } else { - $stringLengthValidator = GeneralUtility::makeInstance(StringLengthValidator::class); - // @extensionScannerIgnoreLine - $stringLengthValidator->setOptions(['minimum' => 5]); - } + $stringLengthValidator = GeneralUtility::makeInstance(StringLengthValidator::class); + // @extensionScannerIgnoreLine + $stringLengthValidator->setOptions(['minimum' => 5]); $descriptionField->addValidator($stringLengthValidator); if (isset($settings['suggest']['fields']['length']['enable']) && (bool)$settings['suggest']['fields']['length']['enable'] === true) { @@ -245,7 +240,7 @@ public function build(array $configuration, ?string $prototypeName = null, ?Serv $explanationText = $page->createElement('headline', 'StaticText'); if (!$explanationText instanceof GenericFormElement) { - throw new \RuntimeException(sprintf( + throw new RuntimeException(sprintf( 'Expected instance of GenericFormElement for headline, got %s', get_class($explanationText) )); @@ -277,12 +272,12 @@ public function build(array $configuration, ?string $prototypeName = null, ?Serv && $settings['suggest']['notification']['senderName'] !== '' ) { $form->createFinisher('EmailToReceiver', [ - 'subject' => $settings['suggest']['notification']['subject'] ?? '', + 'subject' => $settings['suggest']['notification']['subject'], 'recipients' => [ $settings['suggest']['notification']['recipientAddress'] => $settings['suggest']['notification']['recipientName'], ], - 'senderAddress' => $settings['suggest']['notification']['senderAddress'] ?? '', - 'senderName' => $settings['suggest']['notification']['senderName'] ?? '', + 'senderAddress' => $settings['suggest']['notification']['senderAddress'], + 'senderName' => $settings['suggest']['notification']['senderName'], 'carbonCopyAddress' => $settings['suggest']['notification']['carbonCopyAddress'] ?? '', 'blindCarbonCopyAddress' => $settings['suggest']['notification']['blindCarbonCopyAddress'] ?? '', 'replyToRecipients' => [ @@ -308,12 +303,6 @@ public function build(array $configuration, ?string $prototypeName = null, ?Serv return $form; } - // @phpstan-ignore return.deprecatedClass - protected function getTypoScriptFrontendController(): ?TypoScriptFrontendController - { - return $GLOBALS['TSFE']; - } - protected function getLocalizedLabel(string $label): string { if (strncmp($label, 'LLL:', 4) === 0) { diff --git a/Classes/Domain/Finisher/SuggestFormFinisher.php b/Classes/Domain/Finisher/SuggestFormFinisher.php index af1de2b..3b017a6 100644 --- a/Classes/Domain/Finisher/SuggestFormFinisher.php +++ b/Classes/Domain/Finisher/SuggestFormFinisher.php @@ -77,7 +77,7 @@ protected function executeInternal() $storagePid = 0; if (isset($settings['persistence']['storagePid'])) { $exploded = GeneralUtility::intExplode(',', (string)$settings['persistence']['storagePid']); - $storagePid = max(0, (int)($exploded[0] ?? 0)); + $storagePid = max(0, ($exploded[0] ?? 0)); } $data = $this->finisherContext->getFormValues(); diff --git a/Classes/Domain/Model/Day.php b/Classes/Domain/Model/Day.php index 0c9a535..ce8b217 100644 --- a/Classes/Domain/Model/Day.php +++ b/Classes/Domain/Model/Day.php @@ -11,7 +11,9 @@ namespace Evoweb\Sessionplaner\Domain\Model; +use DateTime; use Evoweb\Sessionplaner\Utility\ObjectStorageUtility; +use TYPO3\CMS\Extbase\Annotation as Extbase; use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; use TYPO3\CMS\Extbase\Persistence\ObjectStorage; @@ -19,18 +21,18 @@ class Day extends AbstractEntity { protected string $name = ''; - protected \DateTime $date; + protected DateTime $date; /** * @var ObjectStorage - * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy */ + #[Extbase\ORM\Lazy] public ObjectStorage $rooms; /** * @var ObjectStorage - * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy */ + #[Extbase\ORM\Lazy] public ObjectStorage $slots; public function __construct() @@ -44,12 +46,12 @@ public function initializeObject(): void $this->slots = new ObjectStorage(); } - public function setDate(\DateTime $date): void + public function setDate(DateTime $date): void { $this->date = $date; } - public function getDate(): \DateTime + public function getDate(): DateTime { return $this->date; } diff --git a/Classes/Domain/Model/Room.php b/Classes/Domain/Model/Room.php index 93e3735..b8279fe 100644 --- a/Classes/Domain/Model/Room.php +++ b/Classes/Domain/Model/Room.php @@ -12,6 +12,7 @@ namespace Evoweb\Sessionplaner\Domain\Model; use Evoweb\Sessionplaner\Utility\ObjectStorageUtility; +use TYPO3\CMS\Extbase\Annotation as Extbase; use TYPO3\CMS\Extbase\Domain\Model\FileReference; use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; use TYPO3\CMS\Extbase\Persistence\ObjectStorage; @@ -28,20 +29,20 @@ class Room extends AbstractEntity /** * @var ObjectStorage - * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy */ + #[Extbase\ORM\Lazy] protected ObjectStorage $days; /** * @var ObjectStorage - * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy */ + #[Extbase\ORM\Lazy] protected ObjectStorage $slots; /** * @var ObjectStorage - * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy */ + #[Extbase\ORM\Lazy] protected ObjectStorage $sessions; public function __construct() diff --git a/Classes/Domain/Model/Session.php b/Classes/Domain/Model/Session.php index 6e2da84..cdcf95b 100644 --- a/Classes/Domain/Model/Session.php +++ b/Classes/Domain/Model/Session.php @@ -12,6 +12,7 @@ namespace Evoweb\Sessionplaner\Domain\Model; use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Extbase\Annotation as Extbase; use TYPO3\CMS\Extbase\Domain\Model\FileReference; use TYPO3\CMS\Extbase\Persistence\ObjectStorage; @@ -60,26 +61,26 @@ class Session extends AbstractSlugEntity /** * @var ObjectStorage - * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy */ + #[Extbase\ORM\Lazy] protected ObjectStorage $speakers; /** * @var ObjectStorage - * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy */ + #[Extbase\ORM\Lazy] protected ObjectStorage $documents; /** * @var ObjectStorage - * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy */ + #[Extbase\ORM\Lazy] protected ObjectStorage $tags; /** * @var ObjectStorage - * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy */ + #[Extbase\ORM\Lazy] protected ObjectStorage $links; public function __construct() diff --git a/Classes/Domain/Model/Slot.php b/Classes/Domain/Model/Slot.php index f2627a5..46f6e66 100644 --- a/Classes/Domain/Model/Slot.php +++ b/Classes/Domain/Model/Slot.php @@ -11,6 +11,7 @@ namespace Evoweb\Sessionplaner\Domain\Model; +use TYPO3\CMS\Extbase\Annotation as Extbase; use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; use TYPO3\CMS\Extbase\Persistence\ObjectStorage; @@ -24,21 +25,18 @@ class Slot extends AbstractEntity protected ?string $description = ''; - /** - * @var ?Day - */ - protected $day = null; + protected ?Day $day = null; /** * @var ObjectStorage - * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy */ + #[Extbase\ORM\Lazy] protected ObjectStorage $rooms; /** * @var ObjectStorage - * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy */ + #[Extbase\ORM\Lazy] protected ObjectStorage $sessions; public function __construct() diff --git a/Classes/Domain/Model/Speaker.php b/Classes/Domain/Model/Speaker.php index 87295ef..d640c01 100644 --- a/Classes/Domain/Model/Speaker.php +++ b/Classes/Domain/Model/Speaker.php @@ -11,6 +11,7 @@ namespace Evoweb\Sessionplaner\Domain\Model; +use TYPO3\CMS\Extbase\Annotation as Extbase; use TYPO3\CMS\Extbase\Domain\Model\FileReference; use TYPO3\CMS\Extbase\Persistence\ObjectStorage; @@ -33,8 +34,8 @@ class Speaker extends AbstractSlugEntity /** * @var ObjectStorage - * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy */ + #[Extbase\ORM\Lazy] protected ObjectStorage $sessions; public function __construct() diff --git a/Classes/Domain/Model/Tag.php b/Classes/Domain/Model/Tag.php index b453469..601147c 100644 --- a/Classes/Domain/Model/Tag.php +++ b/Classes/Domain/Model/Tag.php @@ -11,40 +11,26 @@ namespace Evoweb\Sessionplaner\Domain\Model; +use TYPO3\CMS\Extbase\Annotation as Extbase; use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; use TYPO3\CMS\Extbase\Persistence\ObjectStorage; class Tag extends AbstractEntity { - /** - * @var string - */ protected string $label = ''; - /** - * @var string - */ protected string $color = ''; - /** - * @var string - */ protected string $description = ''; - /** - * @var string - */ protected string $slug = ''; - /** - * @var bool - */ protected bool $suggestFormOption = false; /** * @var ObjectStorage - * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy */ + #[Extbase\ORM\Lazy] protected ObjectStorage $sessions; public function __construct() From 1e5b5fc432b94ce55843e7d47330a66dc329bb5c Mon Sep 17 00:00:00 2001 From: Sebastian Fischer Date: Fri, 19 Dec 2025 16:32:30 +0100 Subject: [PATCH 3/8] [TASK] Remove pre v12 code --- ext_tables.php | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 ext_tables.php diff --git a/ext_tables.php b/ext_tables.php deleted file mode 100644 index 48da1a1..0000000 --- a/ext_tables.php +++ /dev/null @@ -1,32 +0,0 @@ -getMajorVersion() < 12) { - ExtensionUtility::registerModule( - 'Sessionplaner', - 'web', - 'sessionplaner_main', - '', - [ - BackendModuleController::class => 'show', - ], - [ - 'access' => 'user,group', - 'iconIdentifier' => 'sessionplaner-module-show', - 'labels' => 'LLL:EXT:sessionplaner/Resources/Private/Language/locallang_mod.xlf', - ] - ); -} From 4a2e3ea60d02d07f49b49e5634d6ccc5aaec6137 Mon Sep 17 00:00:00 2001 From: Sebastian Fischer Date: Fri, 19 Dec 2025 18:20:23 +0100 Subject: [PATCH 4/8] [TASK] Replace extension link ViewHelper with backend editRecord ViewHelper --- Classes/ViewHelpers/Link/Be/DayViewHelper.php | 68 ------------------- .../ViewHelpers/Link/Be/RoomViewHelper.php | 68 ------------------- .../ViewHelpers/Link/Be/SessionViewHelper.php | 68 ------------------- .../ViewHelpers/Link/Be/SlotViewHelper.php | 68 ------------------- .../ViewHelpers/Link/Be/SpeakerViewHelper.php | 68 ------------------- Classes/ViewHelpers/Link/Be/TagViewHelper.php | 68 ------------------- .../Private/Partials/BackendModule/Grid.html | 13 ++-- .../Partials/BackendModule/SessionCard.html | 18 +++-- .../Private/Templates/BackendModule/Show.html | 8 ++- 9 files changed, 26 insertions(+), 421 deletions(-) delete mode 100644 Classes/ViewHelpers/Link/Be/DayViewHelper.php delete mode 100644 Classes/ViewHelpers/Link/Be/RoomViewHelper.php delete mode 100644 Classes/ViewHelpers/Link/Be/SessionViewHelper.php delete mode 100644 Classes/ViewHelpers/Link/Be/SlotViewHelper.php delete mode 100644 Classes/ViewHelpers/Link/Be/SpeakerViewHelper.php delete mode 100644 Classes/ViewHelpers/Link/Be/TagViewHelper.php diff --git a/Classes/ViewHelpers/Link/Be/DayViewHelper.php b/Classes/ViewHelpers/Link/Be/DayViewHelper.php deleted file mode 100644 index 3a24954..0000000 --- a/Classes/ViewHelpers/Link/Be/DayViewHelper.php +++ /dev/null @@ -1,68 +0,0 @@ -registerArgument('day', Day::class, 'The day to link to', true); - $this->registerArgument('returnUri', 'bool', 'return only uri', false, false); - } - - public function render(): string - { - $request = $this->getRequest(); - if (!$request instanceof ServerRequestInterface) { - throw new \RuntimeException( - 'ViewHelper sessionplanervh:link.be.day needs a request implementing ServerRequestInterface.', - 1684305290 - ); - } - - /** @var Day $day */ - $day = $this->arguments['day']; - $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); - - $params = [ - 'edit' => ['tx_sessionplaner_domain_model_day' => [(int)$day->getUid() => 'edit']], - // @extensionScannerIgnoreLine - 'returnUrl' => $request->getAttribute('normalizedParams')->getRequestUri(), - ]; - $uri = (string)$uriBuilder->buildUriFromRoute('record_edit', $params); - if (isset($this->arguments['returnUri']) && $this->arguments['returnUri'] === true) { - return htmlspecialchars($uri, ENT_QUOTES | ENT_HTML5); - } - - $linkText = $this->renderChildren() ?? $day->getName(); - $this->tag->addAttribute('href', $uri); - $this->tag->setContent($linkText); - - return $this->tag->render(); - } - - protected function getRequest(): ?ServerRequestInterface - { - return $GLOBALS['TYPO3_REQUEST'] ?? null; - } -} diff --git a/Classes/ViewHelpers/Link/Be/RoomViewHelper.php b/Classes/ViewHelpers/Link/Be/RoomViewHelper.php deleted file mode 100644 index f7810e8..0000000 --- a/Classes/ViewHelpers/Link/Be/RoomViewHelper.php +++ /dev/null @@ -1,68 +0,0 @@ -registerArgument('room', Room::class, 'The room to link to', true); - $this->registerArgument('returnUri', 'bool', 'return only uri', false, false); - } - - public function render(): string - { - $request = $this->getRequest(); - if (!$request instanceof ServerRequestInterface) { - throw new \RuntimeException( - 'ViewHelper sessionplanervh:link.be.room needs a request implementing ServerRequestInterface.', - 1684305290 - ); - } - - /** @var Room $room */ - $room = $this->arguments['room']; - $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); - - $params = [ - 'edit' => ['tx_sessionplaner_domain_model_room' => [(int)$room->getUid() => 'edit']], - // @extensionScannerIgnoreLine - 'returnUrl' => $request->getAttribute('normalizedParams')->getRequestUri(), - ]; - $uri = (string)$uriBuilder->buildUriFromRoute('record_edit', $params); - if (isset($this->arguments['returnUri']) && $this->arguments['returnUri'] === true) { - return htmlspecialchars($uri, ENT_QUOTES | ENT_HTML5); - } - - $linkText = $this->renderChildren() ?? $room->getName(); - $this->tag->addAttribute('href', $uri); - $this->tag->setContent($linkText); - - return $this->tag->render(); - } - - protected function getRequest(): ?ServerRequestInterface - { - return $GLOBALS['TYPO3_REQUEST'] ?? null; - } -} diff --git a/Classes/ViewHelpers/Link/Be/SessionViewHelper.php b/Classes/ViewHelpers/Link/Be/SessionViewHelper.php deleted file mode 100644 index d1f35db..0000000 --- a/Classes/ViewHelpers/Link/Be/SessionViewHelper.php +++ /dev/null @@ -1,68 +0,0 @@ -registerArgument('session', Session::class, 'The session to link to', true); - $this->registerArgument('returnUri', 'bool', 'return only uri', false, false); - } - - public function render(): string - { - $request = $this->getRequest(); - if (!$request instanceof ServerRequestInterface) { - throw new \RuntimeException( - 'ViewHelper sessionplanervh:link.be.session needs a request implementing ServerRequestInterface.', - 1684305290 - ); - } - - /** @var Session $session */ - $session = $this->arguments['session']; - $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); - - $params = [ - 'edit' => ['tx_sessionplaner_domain_model_session' => [(int)$session->getUid() => 'edit']], - // @extensionScannerIgnoreLine - 'returnUrl' => $request->getAttribute('normalizedParams')->getRequestUri(), - ]; - $uri = (string)$uriBuilder->buildUriFromRoute('record_edit', $params); - if (isset($this->arguments['returnUri']) && $this->arguments['returnUri'] === true) { - return htmlspecialchars($uri, ENT_QUOTES | ENT_HTML5); - } - - $linkText = $this->renderChildren() ?? $session->getTopic(); - $this->tag->addAttribute('href', $uri); - $this->tag->setContent($linkText); - - return $this->tag->render(); - } - - protected function getRequest(): ?ServerRequestInterface - { - return $GLOBALS['TYPO3_REQUEST'] ?? null; - } -} diff --git a/Classes/ViewHelpers/Link/Be/SlotViewHelper.php b/Classes/ViewHelpers/Link/Be/SlotViewHelper.php deleted file mode 100644 index 0746317..0000000 --- a/Classes/ViewHelpers/Link/Be/SlotViewHelper.php +++ /dev/null @@ -1,68 +0,0 @@ -registerArgument('slot', Slot::class, 'The slot to link to', true); - $this->registerArgument('returnUri', 'bool', 'return only uri', false, false); - } - - public function render(): string - { - $request = $this->getRequest(); - if (!$request instanceof ServerRequestInterface) { - throw new \RuntimeException( - 'ViewHelper sessionplanervh:link.be.slot needs a request implementing ServerRequestInterface.', - 1684305290 - ); - } - - /** @var Slot $slot */ - $slot = $this->arguments['slot']; - $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); - - $params = [ - 'edit' => ['tx_sessionplaner_domain_model_slot' => [(int)$slot->getUid() => 'edit']], - // @extensionScannerIgnoreLine - 'returnUrl' => $request->getAttribute('normalizedParams')->getRequestUri(), - ]; - $uri = (string)$uriBuilder->buildUriFromRoute('record_edit', $params); - if (isset($this->arguments['returnUri']) && $this->arguments['returnUri'] === true) { - return htmlspecialchars($uri, ENT_QUOTES | ENT_HTML5); - } - - $linkText = $this->renderChildren() ?? $slot->getUid(); - $this->tag->addAttribute('href', $uri); - $this->tag->setContent($linkText); - - return $this->tag->render(); - } - - protected function getRequest(): ?ServerRequestInterface - { - return $GLOBALS['TYPO3_REQUEST'] ?? null; - } -} diff --git a/Classes/ViewHelpers/Link/Be/SpeakerViewHelper.php b/Classes/ViewHelpers/Link/Be/SpeakerViewHelper.php deleted file mode 100644 index 79a6b9a..0000000 --- a/Classes/ViewHelpers/Link/Be/SpeakerViewHelper.php +++ /dev/null @@ -1,68 +0,0 @@ -registerArgument('speaker', Speaker::class, 'The speaker to link to', true); - $this->registerArgument('returnUri', 'bool', 'return only uri', false, false); - } - - public function render(): string - { - $request = $this->getRequest(); - if (!$request instanceof ServerRequestInterface) { - throw new \RuntimeException( - 'ViewHelper sessionplanervh:link.be.speaker needs a request implementing ServerRequestInterface.', - 1684305290 - ); - } - - /** @var Speaker $speaker */ - $speaker = $this->arguments['speaker']; - $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); - - $params = [ - 'edit' => ['tx_sessionplaner_domain_model_speaker' => [(int)$speaker->getUid() => 'edit']], - // @extensionScannerIgnoreLine - 'returnUrl' => $request->getAttribute('normalizedParams')->getRequestUri(), - ]; - $uri = (string)$uriBuilder->buildUriFromRoute('record_edit', $params); - if (isset($this->arguments['returnUri']) && $this->arguments['returnUri'] === true) { - return htmlspecialchars($uri, ENT_QUOTES | ENT_HTML5); - } - - $linkText = $this->renderChildren() ?? $speaker->getName(); - $this->tag->addAttribute('href', $uri); - $this->tag->setContent($linkText); - - return $this->tag->render(); - } - - protected function getRequest(): ?ServerRequestInterface - { - return $GLOBALS['TYPO3_REQUEST'] ?? null; - } -} diff --git a/Classes/ViewHelpers/Link/Be/TagViewHelper.php b/Classes/ViewHelpers/Link/Be/TagViewHelper.php deleted file mode 100644 index b2eab41..0000000 --- a/Classes/ViewHelpers/Link/Be/TagViewHelper.php +++ /dev/null @@ -1,68 +0,0 @@ -registerArgument('tag', Tag::class, 'The tag to link to', true); - $this->registerArgument('returnUri', 'bool', 'return only uri', false, false); - } - - public function render(): string - { - $request = $this->getRequest(); - if (!$request instanceof ServerRequestInterface) { - throw new \RuntimeException( - 'ViewHelper sessionplanervh:link.be.tag needs a request implementing ServerRequestInterface.', - 1735916444 - ); - } - - /** @var Tag $tag */ - $tag = $this->arguments['tag']; - $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); - - $params = [ - 'edit' => ['tx_sessionplaner_domain_model_tag' => [(int)$tag->getUid() => 'edit']], - // @extensionScannerIgnoreLine - 'returnUrl' => $request->getAttribute('normalizedParams')->getRequestUri(), - ]; - $uri = (string)$uriBuilder->buildUriFromRoute('record_edit', $params); - if (isset($this->arguments['returnUri']) && $this->arguments['returnUri'] === true) { - return htmlspecialchars($uri, ENT_QUOTES | ENT_HTML5); - } - - $linkText = $this->renderChildren() ?? $tag->getLabel(); - $this->tag->addAttribute('href', $uri); - $this->tag->setContent($linkText); - - return $this->tag->render(); - } - - protected function getRequest(): ?ServerRequestInterface - { - return $GLOBALS['TYPO3_REQUEST'] ?? null; - } -} diff --git a/Resources/Private/Partials/BackendModule/Grid.html b/Resources/Private/Partials/BackendModule/Grid.html index 6ce125c..9c8b6bf 100644 --- a/Resources/Private/Partials/BackendModule/Grid.html +++ b/Resources/Private/Partials/BackendModule/Grid.html @@ -1,3 +1,7 @@ +
@@ -7,20 +11,20 @@ data-sessionplaner-room-uid="{room.uid}" data-sessionplaner-room-type="{room.type}" > - + {room.name} ({room.seats}) - +
- +

{slot.duration} -
+
@@ -61,3 +65,4 @@
+ diff --git a/Resources/Private/Partials/BackendModule/SessionCard.html b/Resources/Private/Partials/BackendModule/SessionCard.html index 5813f99..6fe6120 100644 --- a/Resources/Private/Partials/BackendModule/SessionCard.html +++ b/Resources/Private/Partials/BackendModule/SessionCard.html @@ -1,3 +1,7 @@ +
- - {session.topic} - + {session.topic}
- {speaker.name} + {speaker.name} @@ -84,13 +86,15 @@ - {tag.label} - +
+ diff --git a/Resources/Private/Templates/BackendModule/Show.html b/Resources/Private/Templates/BackendModule/Show.html index c824610..e4e1b74 100644 --- a/Resources/Private/Templates/BackendModule/Show.html +++ b/Resources/Private/Templates/BackendModule/Show.html @@ -1,3 +1,6 @@ + @@ -7,10 +10,10 @@

- + {currentDay.date -> f:format.date(format:'d.m.y')} - {currentDay.name} - +

+ From 90b684935120415b2973d4684e9bc801226656ae Mon Sep 17 00:00:00 2001 From: Sebastian Fischer Date: Fri, 19 Dec 2025 18:38:47 +0100 Subject: [PATCH 5/8] [TASK] Improve template for better code highlighting --- Resources/Private/Layouts/Backend.html | 2 ++ Resources/Private/Layouts/Frontend.html | 2 ++ .../Partials/BackendModule/SessionCard.html | 14 +++++++------- Resources/Private/Partials/Disqus/Index.html | 6 ++++-- Resources/Private/Partials/FieldError.html | 9 +++++---- Resources/Private/Partials/FormErrors.html | 7 +++++-- .../Private/Partials/General/Sessions.html | 2 ++ .../Private/Partials/General/SocialIcons.html | 2 ++ Resources/Private/Partials/Session/Box.html | 18 +++++++++++------- Resources/Private/Partials/Session/Info.html | 2 ++ Resources/Private/Partials/Speaker/Card.html | 2 ++ .../Private/Partials/Speaker/Connect.html | 2 ++ Resources/Private/Partials/Speaker/Image.html | 4 ++++ .../Private/Partials/Speaker/LinkWrap.html | 2 ++ .../Private/Partials/Speaker/MiniCard.html | 2 ++ Resources/Private/Templates/Session/List.html | 4 +++- Resources/Private/Templates/Session/Show.html | 10 ++++++---- .../Private/Templates/Sessionplan/Display.html | 18 +++++++++++------- Resources/Private/Templates/Speaker/List.html | 2 ++ Resources/Private/Templates/Speaker/Show.html | 4 +++- Resources/Private/Templates/Suggest/Form.html | 4 ++++ Resources/Private/Templates/Tag/Show.html | 4 +++- 22 files changed, 86 insertions(+), 36 deletions(-) diff --git a/Resources/Private/Layouts/Backend.html b/Resources/Private/Layouts/Backend.html index aa69b7c..5a3cb6c 100644 --- a/Resources/Private/Layouts/Backend.html +++ b/Resources/Private/Layouts/Backend.html @@ -1,2 +1,4 @@ + + diff --git a/Resources/Private/Layouts/Frontend.html b/Resources/Private/Layouts/Frontend.html index c9f2d36..a67c1c6 100644 --- a/Resources/Private/Layouts/Frontend.html +++ b/Resources/Private/Layouts/Frontend.html @@ -1,3 +1,5 @@ +
+ diff --git a/Resources/Private/Partials/BackendModule/SessionCard.html b/Resources/Private/Partials/BackendModule/SessionCard.html index 6fe6120..fc59cd6 100644 --- a/Resources/Private/Partials/BackendModule/SessionCard.html +++ b/Resources/Private/Partials/BackendModule/SessionCard.html @@ -71,17 +71,17 @@
- {f:translate(id: 'type-talk')} - {f:translate(id: 'type-tutorial')} - {f:translate(id: 'type-workshop')} - {f:translate(id: 'type-discussion')} + + + + - {f:translate(id: 'level-starter')} - {f:translate(id: 'level-advanced')} - {f:translate(id: 'level-pro')} + + + diff --git a/Resources/Private/Partials/Disqus/Index.html b/Resources/Private/Partials/Disqus/Index.html index 4bf311e..0824cd4 100644 --- a/Resources/Private/Partials/Disqus/Index.html +++ b/Resources/Private/Partials/Disqus/Index.html @@ -1,3 +1,4 @@ +
@@ -9,7 +10,8 @@ (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); - - comments powered by Disqus + + comments powered by Disqus
+ diff --git a/Resources/Private/Partials/FieldError.html b/Resources/Private/Partials/FieldError.html index a94bffb..05a4047 100644 --- a/Resources/Private/Partials/FieldError.html +++ b/Resources/Private/Partials/FieldError.html @@ -1,3 +1,4 @@ + @@ -5,11 +6,10 @@
- + {f:translate(id: 'field_{propertyError.code}') -> f:format.printf(arguments: {field: '{f:translate(id: \'{propertyPath}\')}'})} + - {f:translate(id: 'field_{propertyError.code}') -> f:format.printf(arguments: - {field: - '{f:translate(id: \'{propertyPath}\')}'})} + {translatedError} {propertyError.message} @@ -22,3 +22,4 @@ + diff --git a/Resources/Private/Partials/FormErrors.html b/Resources/Private/Partials/FormErrors.html index 93d7581..8beadb1 100644 --- a/Resources/Private/Partials/FormErrors.html +++ b/Resources/Private/Partials/FormErrors.html @@ -1,3 +1,4 @@ + @@ -5,9 +6,10 @@
- + {f:translate(id: 'field_{propertyError.code}') -> f:format.printf(arguments: {field: '{f:translate(id: \'{propertyPath}\')}'})} + - {f:translate(id: 'field_{propertyError.code}') -> f:format.printf(arguments:{field:'{f:translate(id: \'{propertyPath}\')}'})} + {translatedError} {propertyError.message} @@ -20,3 +22,4 @@ + diff --git a/Resources/Private/Partials/General/Sessions.html b/Resources/Private/Partials/General/Sessions.html index 2beaea8..51aa5e1 100644 --- a/Resources/Private/Partials/General/Sessions.html +++ b/Resources/Private/Partials/General/Sessions.html @@ -1,3 +1,4 @@ +
@@ -40,3 +41,4 @@

Session

+ diff --git a/Resources/Private/Partials/General/SocialIcons.html b/Resources/Private/Partials/General/SocialIcons.html index d6908a5..d1ac236 100644 --- a/Resources/Private/Partials/General/SocialIcons.html +++ b/Resources/Private/Partials/General/SocialIcons.html @@ -1,3 +1,4 @@ + @@ -10,3 +11,4 @@ + diff --git a/Resources/Private/Partials/Session/Box.html b/Resources/Private/Partials/Session/Box.html index 12eb68d..b1f9d63 100644 --- a/Resources/Private/Partials/Session/Box.html +++ b/Resources/Private/Partials/Session/Box.html @@ -1,3 +1,6 @@ +
@@ -24,19 +27,19 @@ - {f:translate(id: 'type-talk')} - {f:translate(id: 'type-tutorial')} - {f:translate(id: 'type-workshop')} - {f:translate(id: 'type-discussion')} + + + + - {f:translate(id: 'level-starter')} - {f:translate(id: 'level-advanced')} - {f:translate(id: 'level-pro')} + + + @@ -70,3 +73,4 @@
+ diff --git a/Resources/Private/Partials/Session/Info.html b/Resources/Private/Partials/Session/Info.html index 8e6c40b..a67f342 100644 --- a/Resources/Private/Partials/Session/Info.html +++ b/Resources/Private/Partials/Session/Info.html @@ -1,3 +1,4 @@ +
@@ -25,3 +26,4 @@
+ diff --git a/Resources/Private/Partials/Speaker/Card.html b/Resources/Private/Partials/Speaker/Card.html index 545de3c..93dfcaa 100644 --- a/Resources/Private/Partials/Speaker/Card.html +++ b/Resources/Private/Partials/Speaker/Card.html @@ -1,3 +1,4 @@ +
@@ -17,3 +18,4 @@

{speaker.company}

+ diff --git a/Resources/Private/Partials/Speaker/Connect.html b/Resources/Private/Partials/Speaker/Connect.html index 3ccf91b..7084320 100644 --- a/Resources/Private/Partials/Speaker/Connect.html +++ b/Resources/Private/Partials/Speaker/Connect.html @@ -1,3 +1,4 @@ +

Connect

@@ -25,3 +26,4 @@

Connect

+ diff --git a/Resources/Private/Partials/Speaker/Image.html b/Resources/Private/Partials/Speaker/Image.html index 0b582fd..efa4620 100644 --- a/Resources/Private/Partials/Speaker/Image.html +++ b/Resources/Private/Partials/Speaker/Image.html @@ -1,3 +1,6 @@ + @@ -16,3 +19,4 @@ + diff --git a/Resources/Private/Partials/Speaker/LinkWrap.html b/Resources/Private/Partials/Speaker/LinkWrap.html index 187e35c..27a8a51 100644 --- a/Resources/Private/Partials/Speaker/LinkWrap.html +++ b/Resources/Private/Partials/Speaker/LinkWrap.html @@ -1,3 +1,4 @@ + @@ -17,3 +18,4 @@
+ diff --git a/Resources/Private/Partials/Speaker/MiniCard.html b/Resources/Private/Partials/Speaker/MiniCard.html index fe459dd..1a8c5e6 100644 --- a/Resources/Private/Partials/Speaker/MiniCard.html +++ b/Resources/Private/Partials/Speaker/MiniCard.html @@ -1,3 +1,4 @@ +
@@ -14,3 +15,4 @@

+ diff --git a/Resources/Private/Templates/Session/List.html b/Resources/Private/Templates/Session/List.html index e3d54cb..3b3c160 100644 --- a/Resources/Private/Templates/Session/List.html +++ b/Resources/Private/Templates/Session/List.html @@ -1,3 +1,4 @@ + @@ -8,7 +9,7 @@

{settings.listViewHeadline}

{settings.listViewText}
-

{f:translate(id: 'warning-nosessionsfound')}

+

@@ -52,3 +53,4 @@

+ diff --git a/Resources/Private/Templates/Session/Show.html b/Resources/Private/Templates/Session/Show.html index 1dd0ba8..fa714dc 100644 --- a/Resources/Private/Templates/Session/Show.html +++ b/Resources/Private/Templates/Session/Show.html @@ -1,3 +1,4 @@ + @@ -32,7 +33,7 @@

{session.topic}