Skip to content

Commit e0fb0c8

Browse files
authored
[BUGFIX] Fix notice in ShowFormNoteEditForm
With PHP8 the following notice is thrown: ``` PHP Warning: Trying to access array offset on value of type int in /var/www/html/app/site/public/typo3conf/ext/powermail/Classes/Tca/ShowFormNoteEditForm.php line 224 ``` the language uid is in `$this->data['databaseRow']['sys_language_uid']` but as sometimes it is an array and sometimes it is not I suggest the proposed solution to check all
1 parent 5c9fc23 commit e0fb0c8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Classes/Tca/ShowFormNoteEditForm.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,8 @@ protected function getRelatedFormUid(): int
219219
{
220220
$flexFormArray = (array)$this->data['databaseRow']['pi_flexform']['data']['main']['lDEF'];
221221
$formUid = (int)$flexFormArray['settings.flexform.main.form']['vDEF'][0];
222-
$formUid = $this->getLocalizedFormUid($formUid, (int)$this->data['databaseRow']['sys_language_uid'][0]);
222+
$language = (int)($this->data['databaseRow']['sys_language_uid'][0] ?? $this->data['databaseRow']['sys_language_uid'] ?? 0);
223+
$formUid = $this->getLocalizedFormUid($formUid, $language);
223224
return $formUid;
224225
}
225226

0 commit comments

Comments
 (0)