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

[ GLPI 10 rc2 ] [Formcreator 2.13.0-alpha.4] - "Properties" load indefinitely #2682

Closed
stdglpi opened this issue Apr 5, 2022 · 35 comments
Closed
Labels
Milestone

Comments

@stdglpi
Copy link

stdglpi commented Apr 5, 2022

Hello @btry

I'm dealing with this bug

After creating one form

Going to the paramater "Targets" for a exemple : form to a ticket

if I click on properties it loads indefinitely (seems to have no logs)

image

image

@btry
Copy link
Collaborator

btry commented Apr 5, 2022

Hi

Open the browser developer tools, then refresh the page. Open the *targets tab and check in the networking tab of the dev tools if you have HTTP response codes >= 300

@stdglpi
Copy link
Author

stdglpi commented Apr 5, 2022

do you find something interesting here ?
image

@btry
Copy link
Collaborator

btry commented Apr 6, 2022

Hi

There is a HTTP 500 response code when calling targetticket.form.php.

You should find an error message and its backtrace in the HTTP server's log (by default /var/log/apache2/errors.log for Apache)

@stdglpi
Copy link
Author

stdglpi commented Apr 6, 2022

Hello

In fact I have one log in the SQL errors.logs

[2022-04-06 13:51:31] glpisqllog.ERROR: DBmysql::query() in C:\inetpub\wwwroot\glpi\src\DBmysql.php line 367 *** MySQL query error: SQL: SELECT glpi_plugin_formcreator_questions.idASqid, glpi_plugin_formcreator_questions.nameASqname, glpi_plugin_formcreator_sections.idASsid, glpi_plugin_formcreator_sections.nameASsnameFROMglpi_plugin_formcreator_questionsLEFT JOINglpi_plugin_formcreator_sections ON (glpi_plugin_formcreator_questions.plugin_formcreator_sections_id=glpi_plugin_formcreator_sections.id) WHERE (plugin_formcreator_forms_id= '3' ANDfieldtypeIN ('glpiselect') ANDitemtypeIN ('Ticket') ANDdisplay= '0') ORDER BYglpi_plugin_formcreator_sections.order, glpi_plugin_formcreator_questions.row, glpi_plugin_formcreator_questions.col Error: Unknown column 'display' in 'where clause' Backtrace : src\DBmysqlIterator.php:108 src\DBmysql.php:1039 DBmysqlIterator->execute() plugins\formcreator\inc\question.class.php:1022 DBmysql->request() plugins\formcreator\inc\question.class.php:1055 PluginFormcreatorQuestion::getQuestionsFromFormBySection() plugins\formcreator\inc\targetticket.class.php:471 PluginFormcreatorQuestion::dropdownForForm() plugins\formcreator\inc\targetticket.class.php:286 PluginFormcreatorTargetTicket->showCompositeTicketSettings() plugins\formcreator\inc\targetticket.class.php:152 PluginFormcreatorTargetTicket::showProperties() src\CommonGLPI.php:687 PluginFormcreatorTargetTicket::displayTabContentForItem() ajax\common.tabs.php:107 CommonGLPI::displayStandardTab()

@btry
Copy link
Collaborator

btry commented Apr 6, 2022

It is possible that this error leads to an PHP error some lines later in the code. IS there really nothing in the HTTP server logs ?

@stdglpi
Copy link
Author

stdglpi commented Apr 6, 2022

I have something ! :)

[2022-04-06 16:47:31] glpiphplog.NOTICE: *** PHP Deprecated function (8192): json_decode(): Passing null to parameter #1 ($json) of type string is deprecated in C:\inetpub\wwwroot\glpi\plugins\formcreator\inc\abstractitiltarget.class.php at line 1307
Backtrace :
...rmcreator\inc\abstractitiltarget.class.php:1307 json_decode()
plugins\formcreator\inc\targetticket.class.php:276 PluginFormcreatorAbstractItilTarget->showValidationSettings()
plugins\formcreator\inc\targetticket.class.php:152 PluginFormcreatorTargetTicket::showProperties()
src\CommonGLPI.php:687 PluginFormcreatorTargetTicket::displayTabContentForItem()
ajax\common.tabs.php:107 CommonGLPI::displayStandardTab()

[2022-04-06 16:48:01] glpiphplog.NOTICE: *** PHP Deprecated function (8192): json_decode(): Passing null to parameter #1 ($json) of type string is deprecated in C:\inetpub\wwwroot\glpi\plugins\formcreator\inc\abstractitiltarget.class.php at line 1307
Backtrace :
...rmcreator\inc\abstractitiltarget.class.php:1307 json_decode()
plugins\formcreator\inc\targetticket.class.php:276 PluginFormcreatorAbstractItilTarget->showValidationSettings()
plugins\formcreator\inc\targetticket.class.php:152 PluginFormcreatorTargetTicket::showProperties()
src\CommonGLPI.php:687 PluginFormcreatorTargetTicket::displayTabContentForItem()
ajax\common.tabs.php:107 CommonGLPI::displayStandardTab()

@btry
Copy link
Collaborator

btry commented Apr 6, 2022

This is a deprecation warning. I think it is not related to your problem, but I'll search a solution for it.

I need to find a way to reproduce without much clues. Stay tuned

@stdglpi
Copy link
Author

stdglpi commented Apr 6, 2022

This is a deprecation warning. I think it is not related to your problem, but I'll search a solution for it.

I need to find a way to reproduce without much clues. Stay tuned

Thx I try to found something tommorow morning

@btry
Copy link
Collaborator

btry commented Apr 7, 2022

Hi

Please check the table glpi_plugin_formcreator_targettickets. Do you have a column named commonitil_validation_question ?

@stdglpi
Copy link
Author

stdglpi commented Apr 7, 2022

Hi

Please check the table glpi_plugin_formcreator_targettickets. Do you have a column named commonitil_validation_question ?

Hi

image

@btry
Copy link
Collaborator

btry commented Apr 7, 2022

You show the wrong table: this is glpi_plugin_formcreator_targets_actors

SHOW CREATE TABLE `glpi_plugin_formcreator_targettickets`

@stdglpi
Copy link
Author

stdglpi commented Apr 8, 2022

@btry hello

sorry, I have only two lines on this table

image

@btry
Copy link
Collaborator

btry commented Apr 11, 2022

Hi

The fix above should solve the SQL query error with bad column display

@btry
Copy link
Collaborator

btry commented Apr 11, 2022

Please execute the following query in mysql, and show the result

You show the wrong table: this is glpi_plugin_formcreator_targets_actors

SHOW CREATE TABLE `glpi_plugin_formcreator_targettickets`

@stdglpi
Copy link
Author

stdglpi commented Apr 11, 2022

Please execute the following query in mysql, and show the result

You show the wrong table: this is glpi_plugin_formcreator_targets_actors

SHOW CREATE TABLE `glpi_plugin_formcreator_targettickets`

Hello

find bellow the result

image

I also passed the fix for the bad column display thx !

@btry
Copy link
Collaborator

btry commented Apr 11, 2022

Well, the output contains several lines. I don't see the the information I need. Let's do an other way. Browse in phpmyadmin to show the structure of the table. I want to see all columns and their type to check if the table has the expected columns.

@btry
Copy link
Collaborator

btry commented Apr 11, 2022

Is the SQL error solved with the fix ?

@stdglpi
Copy link
Author

stdglpi commented Apr 11, 2022

@btry

Can you check my PDF here ? https://we.tl/t-bNhNi1sSn0

For the SQL let me 1 hour I test to navigate on GLPI and check the logs again.

@btry
Copy link
Collaborator

btry commented Apr 11, 2022

The column is here.

For the SQL query bug, you just need to edit a target ticket having some composition with other tickets.

@stdglpi
Copy link
Author

stdglpi commented Apr 11, 2022

@btry seems to be fixed with the SQL query !

I tried to check forms from a basic user (simplified interface) if I click on a form I have this error :

[2022-04-11 16:06:06] glpiphplog.WARNING: *** PHP Warning (2): Undefined array key "formcreator_restrict_form" in C:\inetpub\wwwroot\glpi\plugins\formcreator\inc\form.class.php at line 2499
Backtrace :
plugins\formcreator\front\formdisplay.php:55 PluginFormcreatorForm->canViewForRequest()

[2022-04-11 16:06:06] glpiphplog.WARNING: *** PHP Warning (2): foreach() argument must be of type array|object, null given in C:\inetpub\wwwroot\glpi\plugins\formcreator\inc\form.class.php at line 2499
Backtrace :
plugins\formcreator\front\formdisplay.php:55 PluginFormcreatorForm->canViewForRequest()

@btry
Copy link
Collaborator

btry commented Apr 11, 2022

Thank you, the fix has been merged. Now try #2696 and feedback. Itr should solve this problem as well

@stdglpi
Copy link
Author

stdglpi commented Apr 11, 2022

Thank you, the fix has been merged. Now try #2696 and feedback. Itr should solve this problem as well

problem with users fixed with this fix

thx

@btry
Copy link
Collaborator

btry commented Apr 12, 2022

Hi

I think we can close this issue now. Thank you for your feedbacks !

@btry btry closed this as completed Apr 12, 2022
@btry btry added the bug label Apr 12, 2022
@btry btry added this to the 2.13.0 milestone Apr 12, 2022
@stdglpi
Copy link
Author

stdglpi commented Apr 12, 2022

@btry sorry for the missunderstanding the problem with the SQL errors is fixed.

But, the menu properties is always "loading" see here for example.

https://we.tl/t-eRdLEGB4O5

thx

@stdglpi
Copy link
Author

stdglpi commented Apr 12, 2022

@btry sorry for the missunderstanding the problem with the SQL errors is fixed.

But, the menu properties is always "loading" see here for example.

https://we.tl/t-eRdLEGB4O5

thx

I have this in the php logs

[2022-04-12 16:39:18] glpiphplog.NOTICE: *** PHP Deprecated function (8192): json_decode(): Passing null to parameter #1 ($json) of type string is deprecated in C:\inetpub\wwwroot\glpi\plugins\formcreator\inc\abstractitiltarget.class.php at line 1307
Backtrace :
...rmcreator\inc\abstractitiltarget.class.php:1307 json_decode()
plugins\formcreator\inc\targetticket.class.php:276 PluginFormcreatorAbstractItilTarget->showValidationSettings()
plugins\formcreator\inc\targetticket.class.php:152 PluginFormcreatorTargetTicket::showProperties()
src\CommonGLPI.php:687 PluginFormcreatorTargetTicket::displayTabContentForItem()
ajax\common.tabs.php:107 CommonGLPI::displayStandardTab()

[2022-04-12 16:58:20] glpiphplog.NOTICE: *** PHP Deprecated function (8192): json_decode(): Passing null to parameter #1 ($json) of type string is deprecated in C:\inetpub\wwwroot\glpi\plugins\formcreator\inc\abstractitiltarget.class.php at line 1307
Backtrace :
...rmcreator\inc\abstractitiltarget.class.php:1307 json_decode()
plugins\formcreator\inc\targetticket.class.php:276 PluginFormcreatorAbstractItilTarget->showValidationSettings()
plugins\formcreator\inc\targetticket.class.php:152 PluginFormcreatorTargetTicket::showProperties()
src\CommonGLPI.php:687 PluginFormcreatorTargetTicket::displayTabContentForItem()
ajax\common.tabs.php:107 CommonGLPI::displayStandardTab()

@btry btry reopened this Apr 12, 2022
@btry
Copy link
Collaborator

btry commented Apr 12, 2022

Hi

Open again the developer tools of the browser, reproduce the problem, then show the content of the console tab. Do you have JS errors ?

@stdglpi
Copy link
Author

stdglpi commented Apr 12, 2022

@btry

On MS edge
image

@btry
Copy link
Collaborator

btry commented Apr 13, 2022

Hi

We are back (or we are still) facing a fatal error.

If your HTTP server is Apache, you have probably a backtrace in /var/log/apache2/errors.log.

If your HTTP server is nginx you have probably a backtrace in /var/log/nginx/errors.log.

With more specific configurations of those HTTP servers the logs may be actually elsewhere. Check your config if needed.

@btry
Copy link
Collaborator

btry commented Apr 13, 2022

The above fix should solve the deprecation notice related to json_decode (#2682 (comment))

I don't expect it will solve the HTTP 500. I need the backtrace to have more clues.

@stdglpi
Copy link
Author

stdglpi commented Apr 13, 2022

@btry good news ! problem solved :) i'm able to access to properties now.

image

@btry
Copy link
Collaborator

btry commented Apr 13, 2022

The fix #2699 solved the problem ?

@stdglpi
Copy link
Author

stdglpi commented Apr 13, 2022

The fix #2699 solved the problem ?

Yes just after apply this fix I tried to go to "target then "properties" and now it's functional.

I had nothing in the PHP errors, just the "Json_decode" error in php_errors in GLPI folders.

[2022-04-12 16:39:18] glpiphplog.NOTICE: *** PHP Deprecated function (8192): json_decode(): Passing null to parameter #1 ($json) of type string is deprecated in C:\inetpub\wwwroot\glpi\plugins\formcreator\inc\abstractitiltarget.class.php at line 1307
Backtrace :
...rmcreator\inc\abstractitiltarget.class.php:1307 json_decode()
plugins\formcreator\inc\targetticket.class.php:276 PluginFormcreatorAbstractItilTarget->showValidationSettings()
plugins\formcreator\inc\targetticket.class.php:152 PluginFormcreatorTargetTicket::showProperties()
src\CommonGLPI.php:687 PluginFormcreatorTargetTicket::displayTabContentForItem()
ajax\common.tabs.php:107 CommonGLPI::displayStandardTab()

@btry
Copy link
Collaborator

btry commented Apr 13, 2022

I think that your log entry comes from glpi/files/_log/php-errors.log, am I right ?

@stdglpi
Copy link
Author

stdglpi commented Apr 13, 2022

yes
\wwwroot\glpi\files_log\php-errors.log

Nothing on log about Php manager

@btry
Copy link
Collaborator

btry commented Apr 13, 2022

OK, then we can close.

Thank you for your feedback.

@btry btry closed this as completed Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants