Skip to content

Commit

Permalink
feat(formanswer): log any failure when saving a answer
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Oct 10, 2023
1 parent e2803ba commit 5d84054
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions inc/formanswer.class.php
Expand Up @@ -1209,6 +1209,10 @@ public function post_addItem() {
'plugin_formcreator_questions_id' => $questionId,
'answer' => Toolbox::addslashes_deep($answer_value),
], [], 0);
if ($answer->isNewItem()) {
$formanswerId = $this->getID();
trigger_error("Formcreator: failed to save answer for question $questionId in formanswer ID $formanswerId. Value was: $answer_value", E_USER_WARNING);
}
foreach ($field->getDocumentsForTarget() as $documentId) {
$docItem = new Document_Item();
$docItem->add([
Expand Down

0 comments on commit 5d84054

Please sign in to comment.