pluginsGLPI / formcreator

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

Impact Analysis not printed when change is generated through a form #3518

Open fabriceverkor opened 2 weeks ago

fabriceverkor commented 2 weeks ago

Describe the bug The Impact Analysis of linked items are not printed when change is generated through a form. Indeed, such a change is generated with a link to the form answer. When I add an asset as linked item in the generated change ("Associated elements" is not present for change target) , Impact Analysis is empty. If I unlink the form answer, then Impact Analysis of linked asset appears.

To Reproduce Steps to reproduce the behavior:

  1. Build a form to generate a change
  2. Generate a change
  3. Link an asset to change '
  4. Impact Analysis is empty
  5. Delete link with Form answer
  6. Impact Analysis appears properly

Expected behavior The Impact Analysis should appear. When target is a ticket, there no link to form answer in linked item list.

GLPI / Plugins (please complete the following information): GLPI 10.0.10

accounts Name: Accounts Version: 3.0.4 State: Enabled
Install Method: Marketplace fields Name: Additional Fields Version: 1.21.6 State: Enabled
Install Method: Marketplace badges Name: Badges Version: 3.0.0 State: Not installed
Install Method: Marketplace behaviors Name: Behaviours Version: 2.7.2 State: Enabled
Install Method: Marketplace connections Name: Connections Version: 10.0.0 State: Enabled
Install Method: Marketplace datainjection Name: Data injection Version: 2.13.4 State: Enabled
Install Method: Marketplace archimap Name: Diagrams Version: 3.3.2 State: Enabled
Install Method: Marketplace formcreator Name: Form Creator Version: 2.13.8 State: Enabled
Install Method: Marketplace glpiinventory Name: GLPI Inventory Version: 1.3.3 State: Enabled
Install Method: Marketplace geninventorynumber Name: Inventory number generation Version: 2.8.3 State: Enabled
Install Method: Marketplace addressing Name: IP Adressing Version: 3.0.1 State: Enabled
Install Method: Marketplace oauthimap Name: Oauth IMAP Version: 1.4.3 State: Enabled
Install Method: Marketplace genericobject Name: Objects management Version: 2.14.8 State: Enabled
Install Method: Marketplace screenshot Name: Screenshot Version: 2.0.2 State: Enabled
Install Method: Marketplace singlesignon Name: Single Sign-on Version: 1.3.3 State: Enabled
Install Method: Manual tag Name: Tag Management Version: 2.11.6 State: Enabled
Install Method: Marketplace

Desktop (please complete the following information): OS: Windows Browser : chrome, brave, firefox, edge

btry commented 2 weeks ago

Hi

I remember of a similar bug. It is possible that GLPI assumes that all associated items have a specific method which does not exists in form answers. You should check if there are errors logged in php-erors.log when you view the change.

fabriceverkor commented 2 weeks ago

I see no specific error in php-errors.log when I view the change, even in debug mode. But why a created change through a form is linked to form answer and a created ticket through a form has not such a link ?

btry commented 2 weeks ago

Hi

For tickets and changes, when they are created through a form, a relation between them and the form answer is created.

image

It is possible do NOT see the relation in GLPI if the user's profile does not has FormAnswer in associatable items to a ticket. Have a look here and if not enabled, enable it to see them appear. You may also check directly in the DB.

fabriceverkor commented 2 weeks ago

You're right. I confirm that when I add FormAnswer in associatable items of my current profile, the link to form answer appears in the ticket. I seems that this is the default behaviour for changes, I cannot change it because there is no 'Associable items to a ticket' button for changes in profile configuration.

But then impact analysis appears properly on ticket but not on change. It appears when I suppress link with the form answer.

btry commented 2 weeks ago

I merely remember about a bug in GLPI which appeared when a ticket is associated to a form answer. The issue occured because GLPI assumed that the associated object has a specific property (a serial number). I thought is that there is a similar assumption in GLPI when ut uses the associated items to a change.

If there is nothing in php-errors.log, maybe there is something in sql-errors.log. Also, check in the developer tools of the browser if you have a HTTP 500 error (networking tab).

fabriceverkor commented 2 weeks ago

Hello again, when i open a change, there is :