Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tpokorra committed Dec 31, 2024
1 parent aac7b96 commit c19e406
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
7 changes: 4 additions & 3 deletions lib/Controller/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1544,9 +1544,6 @@ private function storeAnswersForQuestion(Form $form, $submissionId, array $quest

$answerEntity->setText($answerText);
$this->answerMapper->insert($answerEntity);
if ($uploadedFile) {
$this->uploadedFileMapper->delete($uploadedFile);
}
} else {
$answerText = $answer; // Not a multiple-question, answerText is given answer

Expand All @@ -1565,6 +1562,10 @@ private function storeAnswersForQuestion(Form $form, $submissionId, array $quest
$this->answerMapper->insert($answerEntity);
}
}

if ($uploadedFile) {
$this->uploadedFileMapper->delete($uploadedFile);
}
}

if (in_array($question['type'], Constants::ANSWER_TYPES_PREDEFINED)) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Db/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function __construct() {
$this->addType('expires', 'integer');
$this->addType('isAnonymous', 'boolean');
$this->addType('submitMultiple', 'boolean');
$this->addType('allowEdit', 'bool');
$this->addType('allowEdit', 'boolean');
$this->addType('showExpiration', 'boolean');
$this->addType('lastUpdated', 'integer');
$this->addType('state', 'integer');
Expand Down
4 changes: 1 addition & 3 deletions lib/Service/FormsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,7 @@ public function getForm(Form $form): array {
$result['submissionId'] = $submissionEntity->getId();
}
} catch (DoesNotExistException $e) {
// do nothing
} catch (MultipleObjectsReturnedException $e) {
// do nothing
//handle silently
}
}

Expand Down

0 comments on commit c19e406

Please sign in to comment.