Describe the bug
Form crashes when clicking submit, but ticket is opened, it happens when there is an image in the text field
To Reproduce
Steps to reproduce the behavior:
- Go to 'send button'
- Click on 'Click on the send button'
- Scroll down to '....'
- See error
[13-Oct-2022 06:44:43 America/Sao_Paulo] PHP Warning: sha1_file(C:\wamp64\www\glpi/files/_tmp/5eae73c6df1c24.16071087image_paste1733973.png): failed to open stream: No such file or directory in C:\wamp64\www\glpi\src\Document.php on line 642
[13-Oct-2022 06:44:43 America/Sao_Paulo] PHP Stack trace:
[13-Oct-2022 06:44:43 America/Sao_Paulo] PHP 1. {main}() C:\wamp64\www\glpi\plugins\formcreator\ajax\formanswer.php:0
[13-Oct-2022 06:44:43 America/Sao_Paulo] PHP 2. CommonDBTM->add($input = ['formcreator_field_474' => 'Sim', 'formcreator_field_486' => 'WINT0022', 'formcreator_field_530' => '3458', 'formcreator_field_472' => '<p>Ao tentar contabilizar alguns dias do compras(notas de entrada) está dando erro, e fecha o sistema. Este erro deu quando coloquei um dia só, e também quando coloquei mais dias juntos tipo dia 01 à 05. Mas consegui contabilizar individualmente os dias 01 e 02/10.</p>\\r\\n<p><img id=\\"6be1de7a-a6886e6c-6347dbfd365e44.84020596\\" src=\\"blob:http://servicedesk.pamplona.com.br/b55b9366-3cc1-4838-a646-ec22298c8333\\" data-upload_id=\\"0.9104758744946353\\"></p>\\r\\n<p&'..., '_formcreator_field_472' => [0 => '5eae736a3bc834.443827image_paste4320127.png', 1 => '5eae73c6df1c24.16071087image_paste1733973.png'], '_prefix_formcreator_field_472' => [0 => '5eae736a3bc834.443827im', 1 => '5eae73c6df1c24.16071087'], '_tag_formcreator_field_472' => [0 => '6be1de7a-a6886e6c-6347db9bbb61f5.41174049', 1 => '6be1de7a-a6886e6c-6347dbfd365e44.84020596'], '_formcreator_field_473' => [2 => '5eae753ec53990.53365461apolice seguro pamplona.pdf'], '_prefix_formcreator_field_473' => [2 => '5eae753ec53990.53365461'], '_tag_formcreator_field_473' => [2 => '6be1de7a-a6886e6c-6347dd8662c039.22178674'], 'plugin_formcreator_forms_id' => '37', '_glpi_csrf_token' => '234423c0728bd600ed9df221dac624bbeaa671bfab4789874f0b57a5ae1d2c50', 'submit_formcreator' => ''], $options = *uninitialized*, $history = *uninitialized*) C:\wamp64\www\glpi\plugins\formcreator\ajax\formanswer.php:58
[13-Oct-2022 06:44:43 America/Sao_Paulo] PHP 3. PluginFormcreatorFormAnswer->post_addItem() C:\wamp64\www\glpi\src\CommonDBTM.php:1305
[13-Oct-2022 06:44:43 America/Sao_Paulo] PHP 4. GlpiPlugin\Formcreator\Field\TextareaField->serializeValue($formanswer = class PluginFormcreatorFormAnswer { public $dohistory = TRUE; public $usenotepad = TRUE; public $usenotepadrights = TRUE; public $targetList = []; private $questionFields = [474 => class GlpiPlugin\Formcreator\Field\RadiosField { ... }, 486 => class GlpiPlugin\Formcreator\Field\TextField { ... }, 530 => class GlpiPlugin\Formcreator\Field\IntegerField { ... }, 472 => class GlpiPlugin\Formcreator\Field\TextareaField { ... }, 473 => class GlpiPlugin\Formcreator\Field\FileField { ... }]; private $isAnswersValid = TRUE; private $form = class PluginFormcreatorForm { public $dohistory = TRUE; public $skipChecks = FALSE; public $fields = [...]; public $input = [...]; public $updates = [...]; public $oldvalues = [...]; public $history_blacklist = [...]; public $auto_message_on_action = TRUE; public $no_form_page = FALSE; public $additional_fields_for_dictionnary = [...]; protected $fkfield = ''; protected $searchopt = FALSE; public $taborientation = 'vertical'; public $get_item_to_display_tab = TRUE; protected $usenotepad = FALSE; public $deduplicate_queued_notifications = TRUE; public $right = NULL; protected $type = -1; protected $displaylist = TRUE; public $showdebug = FALSE; protected $useAutomaticOrdering = TRUE }; private array $answers = []; public $fields = ['id' => 23090, 'name' => 'Erros Rotinas', 'entities_id' => 0, 'is_recursive' => 0, 'plugin_formcreator_forms_id' => 37, 'requester_id' => 61, 'users_id_validator' => 0, 'groups_id_validator' => 0, 'request_date' => '2022-10-13 06:44:43', 'status' => 103, 'comment' => '']; public $input = ['formcreator_field_474' => 'Sim', 'formcreator_field_486' => 'WINT0022', 'formcreator_field_530' => '3458', 'formcreator_field_472' => '<p>Ao tentar contabilizar alguns dias do compras(notas de entrada) está dando erro, e fecha o sistema. Este erro deu quando coloquei um dia só, e também quando coloquei mais dias juntos tipo dia 01 à 05. Mas consegui contabilizar individualmente os dias 01 e 02/10.</p>\\r\\n<p><img id=\\"6be1de7a-a6886e6c-6347dbfd365e44.84020596\\" src=\\"blob:http://servicedesk.pamplona.com.br/b55b9366-3cc1-4838-a646-ec22298c8333\\" data-upload_id=\\"0.9104758744946353\\"></p>\\r\\n<p&'..., '_formcreator_field_472' => [...], '_prefix_formcreator_field_472' => [...], '_tag_formcreator_field_472' => [...], '_formcreator_field_473' => [...], '_prefix_formcreator_field_473' => [...], '_tag_formcreator_field_473' => [...], 'plugin_formcreator_forms_id' => 37, '_glpi_csrf_token' => '234423c0728bd600ed9df221dac624bbeaa671bfab4789874f0b57a5ae1d2c50', 'submit_formcreator' => '', '_no_history' => FALSE, 'name' => 'Erros Rotinas', 'status' => 103, 'users_id_validator' => 0, 'groups_id_validator' => 0, 'entities_id' => 0, 'is_recursive' => 0, 'requester_id' => 61, 'request_date' => '2022-10-13 06:44:43', 'comment' => '']; public $updates = []; public $oldvalues = []; public $history_blacklist = []; public $auto_message_on_action = TRUE; public $no_form_page = FALSE; public $additional_fields_for_dictionnary = []; protected $fkfield = ''; protected $searchopt = FALSE; public $taborientation = 'vertical'; public $get_item_to_display_tab = TRUE; public $deduplicate_queued_notifications = TRUE; public $right = NULL; protected $type = -1; protected $displaylist = TRUE; public $showdebug = FALSE }) C:\wamp64\www\glpi\plugins\formcreator\inc\formanswer.class.php:1075
[13-Oct-2022 06:44:43 America/Sao_Paulo] PHP 5. Document->getDuplicateOf($entities_id = 0, $filename = 'C:\\wamp64\\www\\glpi/files/_tmp/5eae73c6df1c24.16071087image_paste1733973.png') C:\wamp64\www\glpi\plugins\formcreator\inc\field\textareafield.class.php:208
[13-Oct-2022 06:44:43 America/Sao_Paulo] PHP 6. Document->getFromDBbyContent($entity = 0, $path = 'C:\\wamp64\\www\\glpi/files/_tmp/5eae73c6df1c24.16071087image_paste1733973.png') C:\wamp64\www\glpi\src\Document.php:1886
[13-Oct-2022 06:44:43 America/Sao_Paulo] PHP 7. sha1_file($filename = 'C:\\wamp64\\www\\glpi/files/_tmp/5eae73c6df1c24.16071087image_paste1733973.png') C:\wamp64\www\glpi\src\Document.php:642
Expected behavior
Open the ticket and reload the page
Screenshots
GLPI / Plugins (please complete the following information):
- GLPI version - 10.0.2
- list of all plugins with their version (available in GLPI > Setup > General > tab System > bottom of the page)
- news Name: Alertas Version: 1.10.5 State: Enabled
Install Method: Manual
behaviors Name: Comportamentos Version: 2.7.1 State: Enabled
Install Method: Manual
formcreator Name: Form Creator Version: 2.13.1 State: Enabled
Install Method: Manual
fusioninventory Name: FusionInventory Version: 9.4+2.4 State: Error / to clean
Install Method: Manual
genericobject Name: Gerenciamento de objetos Version: 2.13.0 State: Enabled
Install Method: Manual
mailanalyzer Name: Mail Analyzer Version: 3.0.0 State: Enabled
Install Method: Manual
mreporting Name: Mais Relatórios Version: 1.8.1 State: Enabled
Install Method: Manual
dashboard Name: Painel Version: 1.0.2 State: Installed / not activated
Install Method: Manual
tasklists Name: Tasks list Version: 2.0.1 State: Enabled
Install Method: Manual
Desktop (please complete the following information):
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
Smartphone (please complete the following information):
- Device: [e.g. iPhone6]
- OS: [Windows Server 2012]
- Browser Firefox, Chorme
- Version [e.g. 22]
Additional context
CEvery time the user clicks, he doubles the call, reaching more than 20 times, as we serve a company with 1000 employees, we have to keep excluding the duplicates.
FormCreator Version 2.13.1
bug need feedback