diff --git a/Build/phpstan12.neon b/Build/phpstan12.neon index fbb96708..18dad6c9 100644 --- a/Build/phpstan12.neon +++ b/Build/phpstan12.neon @@ -9,7 +9,6 @@ parameters: - %currentWorkingDirectory%/Tests excludePaths: - - %currentWorkingDirectory%/Classes/Hooks/TableConfigurationPostProcessing.php - %currentWorkingDirectory%/Classes/Hooks/UsedRecords.php - %currentWorkingDirectory%/Tests/Functional/Hooks/UsedRecordsTest.php - %currentWorkingDirectory%/Tests/Unit/Hooks/UsedRecordsTest.php diff --git a/Build/phpstan13.neon b/Build/phpstan13.neon index 209752a2..11d31a56 100644 --- a/Build/phpstan13.neon +++ b/Build/phpstan13.neon @@ -9,9 +9,6 @@ parameters: - %currentWorkingDirectory%/Tests excludePaths: - - %currentWorkingDirectory%/Classes/ContentDefender - - %currentWorkingDirectory%/Tests/Functional/Datahandler/ContentDefender - - %currentWorkingDirectory%/Classes/Hooks/TableConfigurationPostProcessing.php - %currentWorkingDirectory%/Classes/Hooks/UsedRecords.php - %currentWorkingDirectory%/Tests/Functional/Hooks/UsedRecordsTest.php - %currentWorkingDirectory%/Tests/Unit/Hooks/UsedRecordsTest.php diff --git a/Classes/ContentDefender/Xclasses/CommandMapHook.php b/Classes/ContentDefender/Xclasses/CommandMapHook.php index f23a9e36..ece9a7d6 100644 --- a/Classes/ContentDefender/Xclasses/CommandMapHook.php +++ b/Classes/ContentDefender/Xclasses/CommandMapHook.php @@ -17,6 +17,7 @@ use IchHabRecht\ContentDefender\Hooks\CmdmapDataHandlerHook; use IchHabRecht\ContentDefender\Repository\ContentRepository; use TYPO3\CMS\Core\DataHandling\DataHandler; +use TYPO3\CMS\Core\Information\Typo3Version; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\MathUtility; @@ -72,14 +73,20 @@ public function processCmdmap_beforeStart(DataHandler $dataHandler): void if ($this->containerColumnConfigurationService->isMaxitemsReachedByContainenrId((int)$data['update']['tx_container_parent'], (int)$data['update']['colPos'], $useChildId)) { unset($dataHandler->cmdmap['tt_content'][$id]); + $recpid = null; + $detailsNumber = null; + if ((GeneralUtility::makeInstance(Typo3Version::class))->getMajorVersion() < 13) { + $recpid = 0; + $detailsNumber = 28; + } $dataHandler->log( 'tt_content', $id, 1, - 0, + $recpid, 1, 'The command couldn\'t be executed due to reached maxitems configuration', - 28 + $detailsNumber ); } } diff --git a/Classes/ContentDefender/Xclasses/DatamapHook.php b/Classes/ContentDefender/Xclasses/DatamapHook.php index 72af56b5..73ed8126 100644 --- a/Classes/ContentDefender/Xclasses/DatamapHook.php +++ b/Classes/ContentDefender/Xclasses/DatamapHook.php @@ -18,6 +18,7 @@ use IchHabRecht\ContentDefender\Hooks\DatamapDataHandlerHook; use IchHabRecht\ContentDefender\Repository\ContentRepository; use TYPO3\CMS\Core\DataHandling\DataHandler; +use TYPO3\CMS\Core\Information\Typo3Version; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\MathUtility; @@ -60,14 +61,20 @@ public function processDatamap_beforeStart(DataHandler $dataHandler): void if ($this->containerColumnConfigurationService->isMaxitemsReachedByContainenrId($containerId, (int)$values['colPos'])) { unset($dataHandler->datamap['tt_content'][$id]); + $recpid = null; + $detailsNumber = null; + if ((GeneralUtility::makeInstance(Typo3Version::class))->getMajorVersion() < 13) { + $recpid = 0; + $detailsNumber = 28; + } $dataHandler->log( 'tt_content', $id, 1, - 0, + $recpid, 1, 'The command couldn\'t be executed due to reached maxitems configuration', - 28 + $detailsNumber ); } } diff --git a/Classes/Hooks/Datahandler/CommandMapBeforeStartHook.php b/Classes/Hooks/Datahandler/CommandMapBeforeStartHook.php index edb12352..d4aa1ed3 100644 --- a/Classes/Hooks/Datahandler/CommandMapBeforeStartHook.php +++ b/Classes/Hooks/Datahandler/CommandMapBeforeStartHook.php @@ -303,10 +303,10 @@ protected function dataFromContainerIdColPos(array $data): array protected function logAndUnsetCmd(int $id, string $cmd, string $message, DataHandler $dataHandler): void { $recpid = null; - $details = null; + $detailsNumber = null; if ((GeneralUtility::makeInstance(Typo3Version::class))->getMajorVersion() < 13) { $recpid = 0; - $details = 28; + $detailsNumber = 28; } $dataHandler->log( 'tt_content', @@ -315,7 +315,7 @@ protected function logAndUnsetCmd(int $id, string $cmd, string $message, DataHan $recpid, 1, $cmd . ' ' . $message, - $details + $detailsNumber ); unset($dataHandler->cmdmap['tt_content'][$id][$cmd]); if (!empty($dataHandler->cmdmap['tt_content'][$id])) {