pluginsGLPI / formcreator

GLPI Plugin Formcreator (DOWNLOAD : https://github.com/pluginsGLPI/formcreator/releases)
http://www.teclib-edition.com
GNU General Public License v3.0
174 stars 125 forks source link

FormCreator 2.8.2 (Lost old form answer) Trying to get property of non-object #1416

Closed Sophal-IT closed 4 years ago

Sophal-IT commented 5 years ago

Dear team,

As I just upgrade GLPI to version 9.4.2, so I upgrade Form Creator to version 2.8.2. My problem is that, the old form requested was lost and the new request not appear by showing up this message "Trying to get property of non-object in /var/www/glpi/inc/dbmysql.class.php at line 285" in the My last form (validator).

Hope to hear your feedback soon.

Thanks for your support Sophal

btry commented 5 years ago

Hi

Can you run a SHOW CREATE TABLE query on the table glpi_plugin_formcreator_issues ?

btry commented 5 years ago

Also, please tell from which version of formcreator you upgraded

Sophal-IT commented 5 years ago

For GLPI old version is 9.2.2 new version 9.4.2 and FormCreator version is 2.6.2 new version 2.8.2. For glpi_plugin_formcreator_issues was too much characters, I can show some : INFORMATION TECHNOLOGY

1) Access Request Form : New request

2) First Name : Sokhvadhneary

3) Last Name : PHENG

4) Position : store manager

5) Employee ID :

6) Department :

7) Manager's Name : TWG1-A

System Access Request

8) Computer, Phone, Walkie Talkie, Networkk & Internet : Laptop E-mail Account

9) Financial System :

10) Maintenance System :

11) BMS System :

12) Start working date (Join date) : 2017-10-31

13) Account Expiry Date (For Trainee only) :

14) Last working date (Case resigning) :

15) Remark : - Kindly provide a laptop For Neary, she has been transfered from Vattanac Properties to TWG.

btry commented 5 years ago

The query show create table shall show a SQL query to create a table exactly as your table is. I want to compare it against the table in a fresh install.

The data you gave does not help me to diagnose your issue. Try to run this

SHOW CREATE TABLE glpi_plugin_formcreator_issues

you should have a result made of 2 columns and 1 row.

Sophal-IT commented 5 years ago

Sorry for that, I may misunderstand some point of the SQL. Now here is your information should be need:

| glpi_plugin_formcreator_issues | CREATE TABLE glpi_plugin_formcreator_issues ( id int(11) NOT NULL AUTO_INCREMENT, display_id varchar(255) COLLATE utf8_unicode_ci NOT NULL, original_id int(11) NOT NULL DEFAULT '0', sub_itemtype varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', name varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, status varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', date_creation datetime NOT NULL, date_mod datetime NOT NULL, entities_id int(11) NOT NULL DEFAULT '0', is_recursive tinyint(1) NOT NULL DEFAULT '0', requester_id int(11) NOT NULL DEFAULT '0', validator_id int(11) NOT NULL DEFAULT '0', comment text COLLATE utf8_unicode_ci, PRIMARY KEY (id), KEY original_id_sub_itemtype (original_id,sub_itemtype), KEY entities_id (entities_id), KEY requester_id (requester_id), KEY validator_id (validator_id) ) ENGINE=InnoDB AUTO_INCREMENT=5357 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci |

btry commented 5 years ago

Please modify the table to move the column "name". It must be located after the column "id". Then truncate the table gkpi_plugin_form creator_issues. It must be empty.

Next go in glpi's automatic actions. Search an action named syncIssues.

Run it from the UI. The table will be repopulated.

The issue shoukd disappear.

Sophal-IT commented 5 years ago

Should you have more explanation on this? I do apology that I could not understand enough about using this database.

btry commented 5 years ago

In such case it it probably better to get professional support. Contact us at contact@teclib.com

You may also try to get community support on the glpi forum. Some people have enough knowledge to follow the instructions.

Sophal-IT commented 5 years ago

Dear @btry I already follow to your instruction and the issue still appear the same. Would you have any suggestion please? Note: Form Creator already upgraded from version 2.8.2 to 2.8.3

Thanks for your support. Sophal

btry commented 5 years ago

Hi

I finally found an issue when upgrading the plugin from very old versions to recent ones. Maybe the develop branch could help you. Have a try on a test instance of GLPI with a copy of your production database.

You need to upgrade from a version below 2.7.0 to make the fixes have a chance to solve your problem. If not, then you need to compare the structure of the tables formanswers and issues against the SQL query creating them in the empty sql file used in the install process. As this might be complex, if you don't have the knowledge to manipulate PHP code and SQL queries, then you will need professional support.

btry commented 4 years ago

Hi

HAving no feedback on this issue, I close it. Fel free to open a new one if needed.