diff --git a/inc/form.class.php b/inc/form.class.php index 37819353e..1351a8af5 100644 --- a/inc/form.class.php +++ b/inc/form.class.php @@ -1137,7 +1137,7 @@ protected function showMyLastForms() { * @return Null Nothing, just display the form */ public function displayUserForm() { - global $CFG_GLPI, $DB; + global $CFG_GLPI; if (isset($_SESSION['formcreator']['data'])) { $data = $_SESSION['formcreator']['data']; diff --git a/inc/formanswer.class.php b/inc/formanswer.class.php index 26360bcbd..cd4686c93 100644 --- a/inc/formanswer.class.php +++ b/inc/formanswer.class.php @@ -1246,7 +1246,7 @@ private function createIssue() { $itemTicket->getFromDB($result['id']); $ticket = new Ticket(); if (!$ticket->getFromDB($itemTicket->fields['tickets_id'])) { - throw new RuntimeException('Formcreator: Missing ticket ' . $itemTicket->fields['tickets_id'] . ' for formanswer ' . $formanswers_id); + throw new RuntimeException('Formcreator: Missing ticket ' . $itemTicket->fields['tickets_id'] . ' for formanswer ' . $this->getID()); } $ticketId = $ticket->getID(); $issue->add([ @@ -1306,7 +1306,7 @@ private function updateIssue() { $itemTicket->getFromDB($result['id']); $ticket = new Ticket(); if (!$ticket->getFromDB($itemTicket->fields['tickets_id'])) { - throw new RuntimeException('Formcreator: Missing ticket ' . $itemTicket->fields['tickets_id'] . ' for formanswer ' . $formanswers_id); + throw new RuntimeException('Formcreator: Missing ticket ' . $itemTicket->fields['tickets_id'] . ' for formanswer ' . $this->getID()); } $ticketId = $ticket->getID(); $issue->getFromDBByCrit([ diff --git a/tests/suite-unit/PluginFormcreatorFormAnswer.php b/tests/suite-unit/PluginFormcreatorFormAnswer.php index a0bc07f30..1d4912d0c 100644 --- a/tests/suite-unit/PluginFormcreatorFormAnswer.php +++ b/tests/suite-unit/PluginFormcreatorFormAnswer.php @@ -52,7 +52,7 @@ public function testGetFullForm() { ]); $instance = $this->newTestedInstance(); - $formAnswerId = $instance->add([ + $instance->add([ \PluginFormcreatorForm::getForeignKeyField() => $form->getID(), 'formcreator_field_' . $question->getID() => '' ]);