Skip to content

Commit 77da91f

Browse files
committed
[BUGFIX] Prevent exception, when showing the history of a powermail ce
Related: #1081 Signed-off-by: Marcus Schwemer <[email protected]>
1 parent be3c580 commit 77da91f

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

Classes/Tca/FormSelectorUserFunc.php

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use In2code\Powermail\Utility\BackendUtility;
1313
use In2code\Powermail\Utility\DatabaseUtility;
1414
use TYPO3\CMS\Backend\Utility\BackendUtility as BackendUtilityCore;
15+
use TYPO3\CMS\Core\Utility\ArrayUtility;
1516
use TYPO3\CMS\Core\Utility\GeneralUtility;
1617

1718
/**
@@ -66,15 +67,17 @@ public function __construct()
6667
*/
6768
public function getForms(array &$params): void
6869
{
69-
$params['items'] = [];
70-
$language = (int)$params['flexParentDatabaseRow']['sys_language_uid'];
71-
foreach ($this->getStartPids() as $startPid) {
72-
foreach ($this->getAllForms((int)$startPid, $language) as $form) {
73-
if ($this->hasUserAccessToPage((int)$form['pid'])) {
74-
$params['items'][] = [
75-
BackendUtilityCore::getRecordTitle(Form::TABLE_NAME, $form),
76-
(int)$form['uid'],
77-
];
70+
if (ArrayUtility::isValidPath($params, 'flexParentDatabaseRow/sys_language_uid')) {
71+
$params['items'] = [];
72+
$language = (int)$params['flexParentDatabaseRow']['sys_language_uid'];
73+
foreach ($this->getStartPids() as $startPid) {
74+
foreach ($this->getAllForms((int)$startPid, $language) as $form) {
75+
if ($this->hasUserAccessToPage((int)$form['pid'])) {
76+
$params['items'][] = [
77+
BackendUtilityCore::getRecordTitle(Form::TABLE_NAME, $form),
78+
(int)$form['uid'],
79+
];
80+
}
7881
}
7982
}
8083
}

0 commit comments

Comments
 (0)