Skip to content

Commit 5d84054

Browse files
committed
feat(formanswer): log any failure when saving a answer
1 parent e2803ba commit 5d84054

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

inc/formanswer.class.php

+4
Original file line numberDiff line numberDiff line change
@@ -1209,6 +1209,10 @@ public function post_addItem() {
12091209
'plugin_formcreator_questions_id' => $questionId,
12101210
'answer' => Toolbox::addslashes_deep($answer_value),
12111211
], [], 0);
1212+
if ($answer->isNewItem()) {
1213+
$formanswerId = $this->getID();
1214+
trigger_error("Formcreator: failed to save answer for question $questionId in formanswer ID $formanswerId. Value was: $answer_value", E_USER_WARNING);
1215+
}
12121216
foreach ($field->getDocumentsForTarget() as $documentId) {
12131217
$docItem = new Document_Item();
12141218
$docItem->add([

0 commit comments

Comments
 (0)