Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Build/phpstan12.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions Build/phpstan13.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 9 additions & 2 deletions Classes/ContentDefender/Xclasses/CommandMapHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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
);
}
}
Expand Down
11 changes: 9 additions & 2 deletions Classes/ContentDefender/Xclasses/DatamapHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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
);
}
}
Expand Down
6 changes: 3 additions & 3 deletions Classes/Hooks/Datahandler/CommandMapBeforeStartHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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])) {
Expand Down