diff --git a/Classes/Controller/QuizController.php b/Classes/Controller/QuizController.php index 82fb1bb..0d161b9 100644 --- a/Classes/Controller/QuizController.php +++ b/Classes/Controller/QuizController.php @@ -852,14 +852,12 @@ public function doAll(\Fixpunkt\FpMasterquiz\Domain\Model\Quiz $quiz, array $use ); } else if ($evaluation->getCe() > 0) { // Content-Element ausgeben - // oder so: https://www.andrerinas.de/tutorials/typo3-viewhelper-zum-rendern-von-tt-content-anhand-der-uid.html $ttContentConfig = [ 'tables' => 'tt_content', 'source' => $evaluation->getCe(), 'dontCheckPid' => 1 ]; - // TODO: funktioniert nicht mehr! - $finalContent = GeneralUtility::makeInstance('TYPO3\CMS\Frontend\ContentObject\RecordsContentObject')->render($ttContentConfig); + $finalContent = $GLOBALS['TSFE']->cObj->cObjGetSingle('RECORDS', $ttContentConfig); $finalBodytext = $evaluation->getBodytext(); $finalImageuid = $evaluation->getImage(); } else { @@ -1370,8 +1368,7 @@ public function introAction(): ResponseInterface 'tables' => 'tt_content', 'source' => $this->settings['introContentUid'], 'dontCheckPid' => 1); - // TODO: funktioniert nicht mehr! - $contentElement = GeneralUtility::makeInstance('TYPO3\CMS\Frontend\ContentObject\RecordsContentObject')->render($ttContentConfig); + $contentElement = $GLOBALS['TSFE']->cObj->cObjGetSingle('RECORDS', $ttContentConfig); } else { $contentElement = ''; } diff --git a/Classes/Task/CsvExportAdditionalFieldProvider.php b/Classes/Task/CsvExportAdditionalFieldProvider.php index 02e30f7..7b145c3 100644 --- a/Classes/Task/CsvExportAdditionalFieldProvider.php +++ b/Classes/Task/CsvExportAdditionalFieldProvider.php @@ -142,8 +142,8 @@ public function validateAdditionalFields(array &$submittedData, SchedulerModuleC ->where( $queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter((int)$submittedData['fpmasterquiz']['page'], \PDO::PARAM_INT)) ) - ->execute() - ->fetchColumn(0); + ->executeQuery() + ->fetchOne(); if ($count == 0) { $isValid = FALSE; $this->addMessage( @@ -179,10 +179,13 @@ public function saveAdditionalFields(array $submittedData, AbstractTask $task) { /** @var $task ValidatorTask */ $task->setCsvfile($submittedData['fpmasterquiz']['csvfile']); - $task->setPage($submittedData['fpmasterquiz']['page']); + $task->setPage(intval($submittedData['fpmasterquiz']['page'])); $task->setSeparator($submittedData['fpmasterquiz']['separator']); $task->setDelimiter($submittedData['fpmasterquiz']['delimiter']); $task->setAnswersDelimiter($submittedData['fpmasterquiz']['ansdelimiter']); - $task->setConvert($submittedData['fpmasterquiz']['convert']); + if (isset($submittedData['fpmasterquiz']['convert'])) + $task->setConvert(intval($submittedData['fpmasterquiz']['convert'])); + else + $task->setConvert(0); } } \ No newline at end of file diff --git a/Classes/Task/CsvExportTask.php b/Classes/Task/CsvExportTask.php index 5e7b8ed..d709f8e 100644 --- a/Classes/Task/CsvExportTask.php +++ b/Classes/Task/CsvExportTask.php @@ -214,7 +214,7 @@ public function execute() { $queryBuilder->expr()->eq('tx_fpmasterquiz_domain_model_answer.pid', $queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT)) ) ->orderBy('mm.sorting', 'ASC') - ->execute(); + ->executeQuery(); while ($row = $statement->fetch()) { if (isset($mmArray[$row['uid_local']])) { $mmArray[$row['uid_local']] .= $answersDelimiter . $row['title']; @@ -253,7 +253,7 @@ public function execute() { ) ->orderBy('part.uid', 'DESC') ->addOrderBy('suid', 'ASC') - ->execute(); + ->executeQuery(); while ($row = $statement->fetch()) { if ($i > 0) diff --git a/Classes/Task/DeleteParticipantAdditionalFieldProvider.php b/Classes/Task/DeleteParticipantAdditionalFieldProvider.php index 4f6e081..cdf24bf 100644 --- a/Classes/Task/DeleteParticipantAdditionalFieldProvider.php +++ b/Classes/Task/DeleteParticipantAdditionalFieldProvider.php @@ -96,8 +96,8 @@ public function validateAdditionalFields(array &$submittedData, SchedulerModuleC ->where( $queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter((int)$submittedData['fp_masterquiz']['page'], \PDO::PARAM_INT)) ) - ->execute() - ->fetchColumn(0); + ->executeQuery() + ->fetchOne(); if ($count == 0) { $isValid = FALSE; $this->addMessage( @@ -132,8 +132,11 @@ public function validateAdditionalFields(array &$submittedData, SchedulerModuleC public function saveAdditionalFields(array $submittedData, AbstractTask $task) { /** @var $task ValidatorTask */ - $task->setPage($submittedData['fp_masterquiz']['page']); - $task->setDays($submittedData['fp_masterquiz']['days']); - $task->setFlag($submittedData['fp_masterquiz']['flag']); + $task->setPage(intval($submittedData['fp_masterquiz']['page'])); + $task->setDays(intval($submittedData['fp_masterquiz']['days'])); + if (isset($submittedData['fp_masterquiz']['flag'])) + $task->setFlag(intval($submittedData['fp_masterquiz']['flag'])); + else + $task->setFlag(0); } } \ No newline at end of file diff --git a/Classes/Task/DeleteParticipantTask.php b/Classes/Task/DeleteParticipantTask.php index 6414d7b..104d72c 100644 --- a/Classes/Task/DeleteParticipantTask.php +++ b/Classes/Task/DeleteParticipantTask.php @@ -111,7 +111,7 @@ public function execute() { ->andWhere( $queryBuilder->expr()->lt('crdate', $queryBuilder->createNamedParameter($past, \PDO::PARAM_INT)) ) - ->execute(); + ->executeQuery(); while ($row = $statement->fetch()) { $participantArray[] = $row['uid']; } @@ -124,7 +124,7 @@ public function execute() { ) ->set('deleted', '1') ->set('tstamp', $now) - ->execute(); + ->executeStatement(); $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_fpmasterquiz_domain_model_participant'); $queryBuilder ->update('tx_fpmasterquiz_domain_model_participant') @@ -133,7 +133,7 @@ public function execute() { ) ->set('deleted', '1') ->set('tstamp', $now) - ->execute(); + ->executeStatement(); } } else { $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_fpmasterquiz_domain_model_selected'); @@ -146,7 +146,7 @@ public function execute() { ->andWhere( $queryBuilder->expr()->lt('crdate', $queryBuilder->createNamedParameter($past, \PDO::PARAM_INT)) ) - ->execute(); + ->executeQuery(); while ($row = $statement->fetch()) { $selectedArray[] = $row['uid']; } @@ -159,7 +159,7 @@ public function execute() { ->where( $queryBuilder->expr()->eq('uid_local', $queryBuilder->createNamedParameter($selectedUid, \PDO::PARAM_INT)) ) - ->execute(); + ->executeStatement(); } $table = 'tx_fpmasterquiz_domain_model_selected'; @@ -170,7 +170,7 @@ public function execute() { ->where( $queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($selectedUid, \PDO::PARAM_INT)) ) - ->execute(); + ->executeStatement(); } $table = 'tx_fpmasterquiz_domain_model_participant'; @@ -183,7 +183,7 @@ public function execute() { ->andWhere( $queryBuilder->expr()->lt('crdate', $queryBuilder->createNamedParameter($past, \PDO::PARAM_INT)) ) - ->execute(); + ->executeStatement(); } return $successfullyExecuted; }