formcreator icon indicating copy to clipboard operation
formcreator copied to clipboard

submit button displayed only when navigator is in private mode

Open davidgras38 opened this issue 1 year ago • 11 comments

*Describe the bug The submit button disappears or not appear and the only way I found to bypass this problem is to use private navigation (where problem does not appear)

To Reproduce with edge or chrome on windows https://xxxxxx/plugins/formcreator/front/formdisplay.php?id=14)

Expected behavior The submit button should always appears.

Screenshots

GLPI / Plugins (please complete the following information):

  • GLPI version : 9.5.12
  • formcreator : 2.12.7
  • fusion inventory : 9.5.0+1.0
  • Oauth Imap : 1.3.3

Desktop (please complete the following information):

  • OS: windows 10 and windows 11
  • Browser : chrome v111.0.5563.147 or edge 112.0.1722.34

Smartphone (please complete the following information): it seems that problem does not appear on smartphone

Additional context In form creator, the submit button is taged as "always display"

Thank you, best regards,

davidgras38 avatar Apr 12 '23 06:04 davidgras38

Hi

Please do not expose here a public form or you take the risk of being spammed. If the captcha feature is not enabled, you may use it to reduce risk of spamming.

btry avatar Apr 12 '23 06:04 btry

I don't reproduce; then please check for errors related to this page

  • in glpi/files/_log/php-errors.log
  • in glpi/files/_log/sql-errors.log
  • in the console of the browser
  • in the developer tools of the brower, tab network, requests to showfields.php (HTTP response code != 200)

btry avatar Apr 12 '23 06:04 btry

Hello,

Thank you a lot (and for deleting my public url, sorry...)

I have no errors in php-errors.log neither in sql-errors.log

in the console brower I have 2 errors but they alsa appear in private mode when the submit button appears.

In the following link you can find videos where I reproduce the problem : https://

  • in the "Enregistrement 2023-04-12 090007.mp4", the submit button does not appear and the output of the console network tab shows thar showfileds.php is http 200

  • In the "Enregistrement 2023-04-12 085851.mp4", the submit button does not appear and the output of the console displays 2 errors

  • In the "Enregistrement 2023-04-12 090111.mp4", navigation is in private, the console displays the 2 same errors, but the submit button is displayed

I also join a screenshot of the configuration of the form where the "submit button" is "always display"

Thank you a lot!

Best regards

davidgras38 avatar Apr 12 '23 07:04 davidgras38

Hi

Links to the videos and screenshots are missing.

btry avatar Apr 14 '23 12:04 btry

Hi, Here a link for 3 videos : https://we.tl/t-tYvC95H9xF? Videos named chrome and edge show the error with submit button which disappears. The third video whos edge "in private" mode where submit button does not disappear.

Thank you again.

Best regards

davidgras38 avatar Apr 17 '23 11:04 davidgras38

Hi

In the 2 videos (Chrome, Edge) I see that the "Save" button is visible, but disappears whil you're filling the form. This means that the problem is very likely in the HTTP request to formcreator/ajax/showfields.php .

In the video using Edge in private mode, the "Save" button is still visible when you fill the form.

Open the developer tools of your browser then fill the form. While typing things, you will see several HTTP requests to the above URL. Check the HTTP response code, it should be 200. Show the response body of a request sent when or after the button disappears. It should be a valid JSON string.

btry avatar Apr 17 '23 11:04 btry

Hello, You are right. In private mode, the http response code is 200 and the response body is valid json. When I am not in private mode, the http response is also 200 but the response body is (preview of dev tools)


Attention

L'action que vous avez réalisée n'est pas autorisée. GLPI Copyright (C) 2015-2022 Teclib' and contributors


and the first line of the response body is

GLPI - Accès refusé"

But I don't understand why...

Thank you a lot! Best regards, D.

davidgras38 avatar Apr 18 '23 17:04 davidgras38

If you have invalid JSON, can you show it ?

If the invalid content is some pho error, you will find it In php-errors.log with a complete backtrace. This may help to find out the problem.

btry avatar Apr 18 '23 17:04 btry

Actually it is not json but html response tough http response code is 200. I copied the beginning of the response body. (I have just hide the content of glpi:csrf_token as I did not know) I have no errors in php-errors.log neigther in sql-errors.log.

Thank you again!

GLPI - Accès refusé

davidgras38 avatar Apr 19 '23 07:04 davidgras38

And a completary information. The problem does not produce with Firefox (same comportement as Chrome and Edge in private mode)

Thank you!

davidgras38 avatar Apr 19 '23 07:04 davidgras38

Hi

I'm suspecting some mess with sessions (Edge in private mode does not gives same result as Edge in normal mode). As you're using FC 2.12 which reached end of life, and the issue requires a debug session, I suggest you check if you still reproduce with GLPI 10 + FC 2.13.5. It is strongly recommended that you prepare your migation to GLPI 10 as GLPI 9.5 will not be supported anymore in 2 months.

btry avatar Apr 19 '23 07:04 btry