Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problème apostrophe sur les noms de sections #940

Closed
lolokai opened this issue Mar 21, 2018 · 7 comments · Fixed by #950 or #969
Closed

Problème apostrophe sur les noms de sections #940

lolokai opened this issue Mar 21, 2018 · 7 comments · Fixed by #950 or #969
Assignees
Labels
Milestone

Comments

@lolokai
Copy link

lolokai commented Mar 21, 2018

Si un nom de section contient une apostrophe la génération du ticket n'est pas possible

@btry btry added the bug label Mar 21, 2018
@btry btry added this to the 2.6.3 milestone Mar 21, 2018
@btry
Copy link
Collaborator

btry commented Mar 21, 2018

Bonjour

Il devrait y avoir une erreur dans php-errors.log et / ou sql-errors.log.

@btry btry self-assigned this Mar 21, 2018
@lolokai
Copy link
Author

lolokai commented Mar 21, 2018

Oui dans le fichier sql-errors on a ça :

2018-03-21 14:21:04 [2@glpi02]
*** MySQL query error:
SQL: INSERT
INTO glpi_tickets (requesttypes_id,type,name,content,entities_id,itilcategories_id,locations_id,status,urgency,impact,priority,users_id_lastupdater,users_id_recipient,date,global_validation,date_creation,date_mod) VALUES ('9','1','Ticket','Données du formulaire\n=================\n\n\nInformations générales\n---------------------------------\n1) Lieu : Tous > Réunion > Ouest\n\n2) Type d'incident : Enseigne > Décrochée\n\n\nNature de l'incident\n---------------------------------\n3) Commentaire : Mon enseigne est décrochée\n\n4) Photos : \n\n','10','105','9','2','3','3','2','2','2','2018-03-21 14:21:04','1','2018-03-21 14:21:04','2018-03-21 14:21:04')
Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'incident\n---------------------------------\n3) Commentaire : Mon enseigne est d' at line 2
Backtrace :
inc/commondbtm.class.php:504
inc/commondbtm.class.php:928 CommonDBTM->addToDB()
...ins/formcreator/inc/targetticket.class.php:1205 CommonDBTM->add()
plugins/formcreator/inc/form_answer.class.php:967 PluginFormcreatorTargetTicket->save()
plugins/formcreator/inc/form_answer.class.php:703 PluginFormcreatorForm_Answer->generateTarget()
plugins/formcreator/inc/form.class.php:1174 PluginFormcreatorForm_Answer->saveAnswers()
plugins/formcreator/front/form.form.php:91 PluginFormcreatorForm->saveForm()

Ici "Nature de l'incident" est une section

@btry
Copy link
Collaborator

btry commented Mar 21, 2018

J'ai fait un test rapide:
GLPI 9.2.2-bugfixes (future 9.2.3)
Formcreator en développement (future 2.6.3).

quelles sont vos versions ?

@lolokai
Copy link
Author

lolokai commented Mar 21, 2018

Bisarre on est en GLPI 9.2.2 et FormCreator : 2.6.2

@btry
Copy link
Collaborator

btry commented Mar 21, 2018

Je vais me baser sur le backtrace que vous avez fourni pour chercher le fix.

btry added a commit to btry/formcreator that referenced this issue Mar 26, 2018
if rich text mode in GLPI is disabled, a section name containing a single quote leads to a malformed SQL query

fix pluginsGLPI#940
@btry
Copy link
Collaborator

btry commented Mar 26, 2018

Je reproduis : il faut que le mode texte riche soit désactivé. Je pousse un correctif.

Pouvez vous le valider sur un environneemnt de test ?

  • installez le correctlf
  • sauvegardez la base de données (mise à jour du plugin nécessaire, altérant des données existantes)
  • lancez le script CLI de mise à jour php scripts/cliinstall.php depuis le dossier du plugin
  • testez

(problème qui résout partiellement #858)

btry added a commit to btry/formcreator that referenced this issue Mar 26, 2018
if rich text mode in GLPI is disabled, a section name containing a single quote leads to a malformed SQL query

fix pluginsGLPI#940
btry added a commit that referenced this issue Apr 3, 2018
if rich text mode in GLPI is disabled, a section name containing a single quote leads to a malformed SQL query

fix #940
@btry
Copy link
Collaborator

btry commented Apr 3, 2018

positive feedback in #852

@btry btry closed this as completed Apr 3, 2018
btry added a commit to btry/formcreator that referenced this issue Apr 17, 2018
btry added a commit to btry/formcreator that referenced this issue Apr 17, 2018
btry added a commit that referenced this issue Apr 18, 2018
the iissue #940 was not completely solved

fix #940
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants