Skip to content

Commit

Permalink
[BUGFIX] Prevent exception, when showing the history of a powermail ce
Browse files Browse the repository at this point in the history
Related: #1081
Signed-off-by: Marcus Schwemer <[email protected]>
  • Loading branch information
mschwemer committed Sep 18, 2024
1 parent be3c580 commit 77da91f
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions Classes/Tca/FormSelectorUserFunc.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use In2code\Powermail\Utility\BackendUtility;
use In2code\Powermail\Utility\DatabaseUtility;
use TYPO3\CMS\Backend\Utility\BackendUtility as BackendUtilityCore;
use TYPO3\CMS\Core\Utility\ArrayUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;

/**
Expand Down Expand Up @@ -66,15 +67,17 @@ public function __construct()
*/
public function getForms(array &$params): void
{
$params['items'] = [];
$language = (int)$params['flexParentDatabaseRow']['sys_language_uid'];
foreach ($this->getStartPids() as $startPid) {
foreach ($this->getAllForms((int)$startPid, $language) as $form) {
if ($this->hasUserAccessToPage((int)$form['pid'])) {
$params['items'][] = [
BackendUtilityCore::getRecordTitle(Form::TABLE_NAME, $form),
(int)$form['uid'],
];
if (ArrayUtility::isValidPath($params, 'flexParentDatabaseRow/sys_language_uid')) {
$params['items'] = [];
$language = (int)$params['flexParentDatabaseRow']['sys_language_uid'];
foreach ($this->getStartPids() as $startPid) {
foreach ($this->getAllForms((int)$startPid, $language) as $form) {
if ($this->hasUserAccessToPage((int)$form['pid'])) {
$params['items'][] = [
BackendUtilityCore::getRecordTitle(Form::TABLE_NAME, $form),
(int)$form['uid'],
];
}
}
}
}
Expand Down

0 comments on commit 77da91f

Please sign in to comment.