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

Display of forms #2581

Closed eleducq closed 2 years ago

eleducq commented 2 years ago

Hello, I'm coming back to you with the same astonishing problem, since I have no problem displaying my tickets with the Alpha3 version, but on the other hand I can't find my pre-existing forms, even though the column : plugin_formcreator_categories_id I'm not sure where this is coming from, but I'm sure it is. I'm back to the blank page I had last week : image

btry commented 2 years ago

Hi

I see "no form found". When you try to show the forms, are you in the root entity with recursion ?

eleducq commented 2 years ago

Yes I'm in the correct root entity, and when I look in the database there is no form data, like when I had the missing column problem.

btry commented 2 years ago

if there is no form in the DB, this is normal to have an empty list. I think I don't fully get your meaning.

eleducq commented 2 years ago

When I am in Alpha2, I have my forms displayed with the answers but I have the problem of displaying the tickets. I'm going to alpha3, so I'm using : php bin/console glpi:plugin:install formcreator -f -p force-upgrade php bin/console glpi:plugin:activate formcreator

And I end up with the display of valid form response tickets, but I no longer have access to my forms.

btry commented 2 years ago

When I am in Alpha2, I have my forms displayed with the answers but I have the problem of displaying the tickets. I'm going to alpha3, so I'm using : php bin/console glpi:plugin:install formcreator -f -p force-upgrade php bin/console glpi:plugin:activate formcreator

This is ok, no problem with that

And I end up with the display of valid form response tickets

ok as well

but I no longer have access to my forms.

and you said that you don't have forms in the DB. This is the point I don't get. If there are no form then the plugin will show an empty list. Look directly in the table glpi_plugin_formcreator_forms : how many rows do you have ? Also count those located in the entity 0

eleducq commented 2 years ago

This table is empty but that's what I can't figure out, because when I'm in alpha2, I have my glpi_plugin_formcreator_forms table, which has 10 forms. And I seem to lose them when I go to alpha3.

btry commented 2 years ago

Do you have a backup before the upgrade to Alpha 3 ? Could you restore it, then upgrade the plugin again ?

Between each step, check if the table still has its forms, and tell which step seems to remove them.

eleducq commented 2 years ago

Yes I have a backup, I'll get back to you as soon as I have a lead.

eleducq commented 2 years ago

So I have backup in alpha2, and I have all the forms in BDD but I just noticed that in the table glpi_plugin_formcreator_forms, I do not have the column plugin_formcreator_categories_id. When I'm at the stage between alpha2 and alpha3, I either have the graphical option to update or uninstall the plugin or in line as to force the installation, and the procedure I do is to uninstall and then install the plugin in command line. My database empties on uninstallation.

btry commented 2 years ago

You're right the column plugin_formcreator_categories_id is missing because it was dropped in a development, and a few days later, it has been restored. In between those events, the Alpha.2 was released.

There is no upgrade code provided to restore the column, because we are in development versions. Then you need to re-add the column by hands directly in the DB. Next run again the upgrade of the plugin.

eleducq commented 2 years ago

This is exactly the procedure I did, i.e. once alpha3 is installed, I manually add the missing column, then I restart the alpha3 installation command and activate it, but this does not correct my problem, I still have nothing in my forms...

btry commented 2 years ago

did you checked that after restoration of the backup the table is full ?

did you checked the table in the DB before each step ?

eleducq commented 2 years ago

Yes, after restoration of the backup the table is full. and yes I have checked every step of the way. When adding the column manually, no problem with my table, but that's when I launch the second update of the plugins. So my question is, if I recreate the forms manually, won't that change and impact the tockets already created via the old forms?

btry commented 2 years ago

If the ID of the restored forms are not the same as before, expect bugs.

Try to restore only the table glpi_plugin_formcreator_forms, then add the column plugin_formcreator_categories_id. Finally run again the forced upgrade of the plugin. php bin/console glpi:plugin:install formcreator -f -p force-upgrade. Check the state of the table. Activate the plugin, check again the table.

eleducq commented 2 years ago

What do you mean by restore only the table glpi_plugin_formcreator_forms ?

btry commented 2 years ago

I mean : try to restore from your backup only the table glpi_plugin_formcreator_forms. Keep all others.

Next, recreate plugin_formcreator_categories_id, then run the force-upgrade command.

eleducq commented 2 years ago

After reinjection of the table with the data it seems to work, thanks again!

btry commented 2 years ago

Great! Then I close.