From 09335af40bdc4952a4fc7ec72da9ab542b93a653 Mon Sep 17 00:00:00 2001 From: Dijar Bytyci Date: Wed, 11 Jan 2023 10:22:51 +0100 Subject: [PATCH] [BUGIFX] Fix undefined index errors --- Classes/Controller/FormEntryController.php | 4 ++-- Classes/Utility/FormAnswersUtility.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Classes/Controller/FormEntryController.php b/Classes/Controller/FormEntryController.php index 37dd5e1..95b8af3 100644 --- a/Classes/Controller/FormEntryController.php +++ b/Classes/Controller/FormEntryController.php @@ -286,8 +286,8 @@ public function exportAction(\Frappant\FrpFormAnswers\Domain\Model\FormEntryDema $this->redirect('list'); } - $extensionConfiguration = $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['frp_formanswers']; - $exportData = $this->dataExporter->getExport($formEntries, $formEntryDemand, $extensionConfiguration['useSubmitUid']['value']); + $extensionConfiguration = $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['frp_formanswers'] ?? null; + $exportData = $this->dataExporter->getExport($formEntries, $formEntryDemand, $extensionConfiguration['useSubmitUid']['value'] ?? false); $this->formEntryRepository->setFormsToExported($formEntries); diff --git a/Classes/Utility/FormAnswersUtility.php b/Classes/Utility/FormAnswersUtility.php index a48b6ab..858f057 100644 --- a/Classes/Utility/FormAnswersUtility.php +++ b/Classes/Utility/FormAnswersUtility.php @@ -44,14 +44,14 @@ public function prepareFormAnswersArray() // Get all Pids with a formEntry list foreach ($startPointPids as $pageId) { foreach ($this->formEntryRepository->findAllInPidAndRootline($pageId) as $formEntry) { - if($pageIds[$formEntry->getPid()][$formEntry->getForm()]['tot']) { + if(isset($pageIds[$formEntry->getPid()][$formEntry->getForm()]['tot'])) { $pageIds[$formEntry->getPid()][$formEntry->getForm()]['tot'] += 1; } else { $pageIds[$formEntry->getPid()][$formEntry->getForm()]['tot'] = 1; } if (!$formEntry->isExported()) { - if($pageIds[$formEntry->getPid()][$formEntry->getForm()]['new']) { + if(isset($pageIds[$formEntry->getPid()][$formEntry->getForm()]['new'])) { $pageIds[$formEntry->getPid()][$formEntry->getForm()]['new'] += 1; } else { $pageIds[$formEntry->getPid()][$formEntry->getForm()]['new'] = 1;