Skip to content

Commit

Permalink
Version 4.0.0 beta 9
Browse files Browse the repository at this point in the history
  • Loading branch information
bihor committed Jun 30, 2023
1 parent 54c6ed1 commit 29ec14c
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 23 deletions.
7 changes: 2 additions & 5 deletions Classes/Controller/QuizController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 = '';
}
Expand Down
11 changes: 7 additions & 4 deletions Classes/Task/CsvExportAdditionalFieldProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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);
}
}
4 changes: 2 additions & 2 deletions Classes/Task/CsvExportTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down Expand Up @@ -253,7 +253,7 @@ public function execute() {
)
->orderBy('part.uid', 'DESC')
->addOrderBy('suid', 'ASC')
->execute();
->executeQuery();
while ($row = $statement->fetch()) {

if ($i > 0)
Expand Down
13 changes: 8 additions & 5 deletions Classes/Task/DeleteParticipantAdditionalFieldProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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);
}
}
14 changes: 7 additions & 7 deletions Classes/Task/DeleteParticipantTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
}
Expand All @@ -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')
Expand All @@ -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');
Expand All @@ -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'];
}
Expand All @@ -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';
Expand All @@ -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';
Expand All @@ -183,7 +183,7 @@ public function execute() {
->andWhere(
$queryBuilder->expr()->lt('crdate', $queryBuilder->createNamedParameter($past, \PDO::PARAM_INT))
)
->execute();
->executeStatement();
}
return $successfullyExecuted;
}
Expand Down

0 comments on commit 29ec14c

Please sign in to comment.