From c6ca707b1cee962d1d08e4371b171272f87a82a8 Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Mon, 20 Dec 2021 10:20:47 +0100 Subject: [PATCH] Fix warnings in higher PHP versions ending up in TYPO3 log --- Classes/Service/DestinationDataImportService.php | 8 ++++++-- ext_localconf.php | 5 ++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Classes/Service/DestinationDataImportService.php b/Classes/Service/DestinationDataImportService.php index eac3cce..ab03314 100644 --- a/Classes/Service/DestinationDataImportService.php +++ b/Classes/Service/DestinationDataImportService.php @@ -312,7 +312,7 @@ class DestinationDataImportService $this->tmpCurrentEvent->setTitle(substr($event['title'], 0, 254)); // Set Highlight (Is only set in rest if true) - if ($event['highlight']) { + if (isset($event['highlight']) && $event['highlight']) { $this->tmpCurrentEvent->setHighlight($event['highlight']); } @@ -599,6 +599,10 @@ class DestinationDataImportService private function setTexts(array $texts): void { foreach ($texts as $text) { + if (isset($text['value']) === false) { + continue; + } + if ($text['rel'] == "details" && $text['type'] == "text/plain") { $this->tmpCurrentEvent->setDetails(str_replace('\n\n', '\n', $text['value'])); } @@ -702,7 +706,7 @@ class DestinationDataImportService $file->getUid(), [ 'title' => $media_object['value'], - 'description' => $media_object['description'], + 'description' => $media_object['description'] ?? '', 'alternative' => 'DD Import' ] ); diff --git a/ext_localconf.php b/ext_localconf.php index 06e7ea3..bd81f08 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -30,7 +30,10 @@ call_user_func(function () { [\Wrm\Events\Controller\EventController::class => 'list'] ); - if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['events_category'])) { + if ( + isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['events_category']) === false + || is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['events_category']) === false + ) { $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['events_category'] = []; }