Skip to content

Commit 988a162

Browse files
committed
[TASK] Prevent some undefined array key warnings for php8
Related #692 Signed-off-by: Marcus Schwemer <marcus.schwemer@in2code.de>
1 parent 7313438 commit 988a162

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

Classes/Domain/Service/Mail/SendMailService.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,9 @@ protected function initialize(Mail $mail, array $settings, string $type): void
507507
$this->mail = $mail;
508508
$this->settings = $settings;
509509
$this->configuration = $this->getConfigurationFromSettings($settings);
510-
$this->overwriteConfig = $this->configuration[$type . '.']['overwrite.'];
510+
if (\TYPO3\CMS\Core\Utility\ArrayUtility::isValidPath($this->configuration, $type . './overwrite')) {
511+
$this->overwriteConfig = $this->configuration[$type . '.']['overwrite.'];
512+
}
511513
$mailRepository = ObjectUtility::getObjectManager()->get(MailRepository::class);
512514
ObjectUtility::getContentObject()->start($mailRepository->getVariablesWithMarkersFromMail($mail));
513515
$this->type = $type;

Classes/ViewHelpers/Condition/IsNotExcludedFromPowermailAllViewHelper.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ protected function getExcludedValues(
9090
string $configurationType = 'excludeFromFieldTypes'
9191
): array {
9292
if (
93+
isset($this->typeToTypoScriptType[$type]) &&
9394
ArrayUtility::isValidPath($settings, 'excludeFromPowermailAllMarker/' . $this->typeToTypoScriptType[$type] . '/' . $configurationType)
9495
&& !empty($settings['excludeFromPowermailAllMarker'][$this->typeToTypoScriptType[$type]][$configurationType])
9596
) {

Classes/ViewHelpers/Misc/ManipulateValueWithTypoScriptViewHelper.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ public function render(): string
5858
$type = $this->arguments['type'];
5959
$value = $this->renderChildren();
6060
if ($answer->getField()) {
61-
if (!empty($this->typoScriptContext[$this->typeToTsType[$type] . '.'][$answer->getField()->getMarker()])) {
61+
if (
62+
isset($this->typeToTypoScriptType[$type]) &&
63+
!empty($this->typoScriptContext[$this->typeToTsType[$type] . '.'][$answer->getField()->getMarker()])) {
6264
$this->contentObjectRenderer->start($answer->_getProperties());
6365
$value = $this->contentObjectRenderer->cObjGetSingle(
6466
$this->typoScriptContext[$this->typeToTsType[$type] . '.'][$answer->getField()->getMarker()],

0 commit comments

Comments
 (0)