Skip to content

Commit ebad765

Browse files
committed
more fixes
Signed-off-by: Timotheus Pokorra <timotheus.pokorra@solidcharity.com>
1 parent 46cdfec commit ebad765

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

lib/Controller/ApiController.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,9 +1544,6 @@ private function storeAnswersForQuestion(Form $form, $submissionId, array $quest
15441544

15451545
$answerEntity->setText($answerText);
15461546
$this->answerMapper->insert($answerEntity);
1547-
if ($uploadedFile) {
1548-
$this->uploadedFileMapper->delete($uploadedFile);
1549-
}
15501547
} else {
15511548
$answerText = $answer; // Not a multiple-question, answerText is given answer
15521549

@@ -1565,6 +1562,10 @@ private function storeAnswersForQuestion(Form $form, $submissionId, array $quest
15651562
$this->answerMapper->insert($answerEntity);
15661563
}
15671564
}
1565+
1566+
if ($uploadedFile) {
1567+
$this->uploadedFileMapper->delete($uploadedFile);
1568+
}
15681569
}
15691570

15701571
if (in_array($question['type'], Constants::ANSWER_TYPES_PREDEFINED)) {

lib/Db/Form.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function __construct() {
7272
$this->addType('expires', 'integer');
7373
$this->addType('isAnonymous', 'boolean');
7474
$this->addType('submitMultiple', 'boolean');
75-
$this->addType('allowEdit', 'bool');
75+
$this->addType('allowEdit', 'boolean');
7676
$this->addType('showExpiration', 'boolean');
7777
$this->addType('lastUpdated', 'integer');
7878
$this->addType('state', 'integer');

lib/Service/FormsService.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,7 @@ public function getForm(Form $form): array {
228228
$result['submissionId'] = $submissionEntity->getId();
229229
}
230230
} catch (DoesNotExistException $e) {
231-
// do nothing
232-
} catch (MultipleObjectsReturnedException $e) {
233-
// do nothing
231+
//handle silently
234232
}
235233
}
236234

0 commit comments

Comments
 (0)