-
Notifications
You must be signed in to change notification settings - Fork 127
Displaying tickets created from a the simplified interface #3581
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
Comments
Hi How many tickets are generated by the form ? |
Hi, There are a number of tickets, but not all of them are generated by the form. I didn't notice this before, as we're using the standard GLPI interface. As I'm migrating to the simplified interface, I noticed this problem. I couldn't tell you the exact number, there are more than 2000 |
If a form generates several tickets, then the behaviour you observed is expected. This is necessary to allow the user to choose the ticket generated by his assistance request. From your previous answer, I guess that some target tickets have conditions. If this is possible, try to fill the form in a way that only 1 ticket is created. You will see in the list an entry t_xxxx and clicking on it will show the ticket without any intermediate page. In the other cases (no ticket, or several tickets), the entry will be of the form f_xxxx. |
When a user creates a ticket from the form, I see that all the tickets are associated with this form. I understand the phenomenon better. How do you separate the ticket from the form? when a user creates a ticket from the form by including all the data from the form filled out by the user but this ticket is not attached to this form |
Hi When a user fills and submit a form, his answers are saved (for later display for validation if it is enabled). Then targets are generated. Depending on the configuration of the targets you may generate several tickets, changes or problems with only a subset of the answers from the requester.
This is not normal : each ticket created by the plugin must be associated to an object form_answer which represents the answers of the requester. |
Hi, What I don't understand is that there is only one ticket created, for a response and not several tickets for a single response to the form. |
Hi check if there are conditions applied to your targets. Those conditions allow the administrator to decide if a ticket is actually generated, in function of the answers provided by the requester. If there are no conditions in any target or you are sure that they are filled in a way that several tickets shall be generated for a givel set of answders, then check the logs in GLPI to see if there are errors related to the submission of the answers (php-errors.log and sql-errors.log). |
Isn't it the fact that I have the administrator profile in addition to the user profile? |
No, Formcreator does not have such feature. When you preview a form for the administrator profile some questions (dropdown and GLPI object types) may show different content, and the entity of some targets may vary, but the context which decide if a target is generated should not vary depending on your profile. |
SQL error log: php-error.log: [2025-03-24 08:52:41] glpiphplog.WARNING: *** PHP User Warning (512): No-Reply address is not defined in configuration. in /path/to/glpi/src/Config.php at line 3928 [2025-03-24 08:52:41] glpiphplog.WARNING: *** PHP User Warning (512): No-Reply address is not defined in configuration. in /path/to/glpi/src/Config.php at line 3928 [2025-03-24 08:53:09] glpiphplog.WARNING: Failed to save key "{key}" of type null: rename(/path/to/glpi/files/_cache/translations-10.0.18/3d2b04774470,/path/to/glpi/files/_cache/translations-10.0.18/Z/F/5QKUtRWdGqmZzucG5NbQ): No such file or directory {"key":"cf82067f3a82e05132a6dcb41ec973c8679c6dea","exception":"[object] (ErrorException(code: 0): rename(/path/to/glpi/files/_cache/translations-10.0.18/3d2b04774470,/path/to/glpi/files/_cache/translations-10.0.18/Z/F/5QKUtRWdGqmZzucG5NbQ): No such file or directory at /path/to/glpi/vendor/symfony/cache/Traits/FilesystemCommonTrait.php:117)","cache-adapter":"Symfony\Component\Cache\Adapter\FilesystemAdapter"} |
The 1st SQL error shows that there is a mismatch in the table issues of the plugin, compared to the tickets table. The automatic action which fills the issues table should be disabled (and run manually when needed). Try to execute the following query to see if there is a bad result (just tell if you have rows, do not disclose the result as it may contain sensitive information) SELECT
*
FROM
(
(
SELECT DISTINCT
NULL as id,
IF(
glpi_plugin_formcreator_formanswers.name = '',
CONCAT('(', glpi_plugin_formcreator_formanswers.id, ')'),
glpi_plugin_formcreator_formanswers.name
) as name,
CONCAT('f_', glpi_plugin_formcreator_formanswers.id) as display_id,
glpi_plugin_formcreator_formanswers.id AS items_id,
'PluginFormcreatorFormAnswer' as itemtype,
glpi_plugin_formcreator_formanswers.status AS status,
glpi_plugin_formcreator_formanswers.request_date AS date_creation,
glpi_plugin_formcreator_formanswers.request_date AS date_mod,
glpi_plugin_formcreator_formanswers.entities_id AS entities_d,
glpi_plugin_formcreator_formanswers.is_recursive AS is_recursive,
glpi_plugin_formcreator_formanswers.requester_id AS requester_id,
glpi_plugin_formcreator_formanswers.comment AS comment,
glpi_plugin_formcreator_formanswers.requester_id AS users_id_recipient
FROM
glpi_plugin_formcreator_formanswers
LEFT JOIN glpi_plugin_formcreator_forms ON (
glpi_plugin_formcreator_forms.id = glpi_plugin_formcreator_formanswers.plugin_formcreator_forms_id
)
LEFT JOIN glpi_items_tickets ON (
glpi_items_tickets.items_id = glpi_plugin_formcreator_formanswers.id
AND glpi_items_tickets.itemtype = 'PluginFormcreatorFormAnswer'
)
GROUP BY
glpi_plugin_formcreator_formanswers.id
HAVING
COUNT(glpi_items_tickets.tickets_id) != 1
)
UNION
(
SELECT DISTINCT
NULL as id,
IF(
glpi_tickets.name = '',
CONCAT('(', glpi_tickets.id, ')'),
glpi_tickets.name
) as name,
CONCAT('t_', glpi_tickets.id) as display_id,
glpi_tickets.id AS items_id,
'Ticket' as itemtype,
IF(
glpi_tickets.global_validation IN ('1', '3'),
glpi_tickets.status,
IF(
glpi_tickets.status IN ('5', '6'),
glpi_tickets.status,
IF(
glpi_tickets.global_validation = '2',
'101',
'102'
)
)
) AS status,
glpi_tickets.date AS date_creation,
glpi_tickets.date_mod AS date_mod,
glpi_tickets.entities_id AS entities_id,
0 as is_recursive,
COALESCE(glpi_tickets_users.users_id, 0) as requester_id,
glpi_tickets.content AS comment,
users_id_recipient AS users_id_recipient
FROM
glpi_tickets
LEFT JOIN glpi_items_tickets ON (
glpi_items_tickets.tickets_id = glpi_tickets.id
AND glpi_items_tickets.itemtype = 'PluginFormcreatorFormAnswer'
)
LEFT JOIN (
SELECT DISTINCT
users_id,
tickets_id
FROM
glpi_tickets_users
WHERE
type = '1'
GROUP BY
tickets_id
ORDER BY
id ASC
) AS glpi_tickets_users ON (glpi_tickets.id = glpi_tickets_users.tickets_id)
WHERE
glpi_tickets.is_deleted = '0'
GROUP BY
glpi_tickets.id
HAVING
COUNT(glpi_items_tickets.items_id) = 0
)
UNION
(
SELECT
NULL as id,
IF(
glpi_tickets.name = '',
CONCAT('(', glpi_tickets.id, ')'),
glpi_tickets.name
) as name,
CONCAT('t_', glpi_tickets.id) as display_id,
glpi_tickets.id AS items_id,
'Ticket' as itemtype,
IF(
glpi_tickets.global_validation IN ('1', '3'),
glpi_tickets.status,
IF(
glpi_tickets.status IN ('5', '6'),
glpi_tickets.status,
IF(
glpi_tickets.global_validation = '2',
'101',
'102'
)
)
) AS status,
glpi_tickets.date AS date_creation,
glpi_tickets.date_mod AS date_mod,
glpi_tickets.entities_id AS entities_id,
0 as is_recursive,
COALESCE(glpi_tickets_users.users_id, 0) as requester_id,
glpi_tickets.content AS comment,
users_id_recipient AS users_id_recipient
FROM
glpi_tickets
INNER JOIN glpi_items_tickets ON (
glpi_items_tickets.tickets_id = glpi_tickets.id
AND glpi_items_tickets.itemtype = 'PluginFormcreatorFormAnswer'
)
LEFT JOIN (
SELECT DISTINCT
users_id,
tickets_id
FROM
glpi_tickets_users
WHERE
type = '1'
GROUP BY
tickets_id
ORDER BY
id ASC
) AS glpi_tickets_users ON (glpi_tickets.id = glpi_tickets_users.tickets_id)
WHERE
glpi_tickets.is_deleted = '0'
GROUP BY
glpi_items_tickets.items_id
HAVING
COUNT(glpi_items_tickets.items_id) = 1
)
) AS union_474dfb8b612fe0826a2367c0de7d140a
where users_id_recipient is null |
the other errors are not related to the plugin |
the script returns no results (no lines) |
ok, then try again the query, but replace "IS NULL"in the last line with "< 0". I'm searching for a result which does not complies with the schema of the table issues. |
I get the same result by changing the last line "where users_id_recipient is null" to "where users_id_recipient < 0" |
Ok, I think I found the problem : the faulty value is an empty string. Please open a terminal on your server then locate in the directory of GLPI, and execute the following command I expect that the tables are not strictly identical to their expected structure. If I'm right you'll get an output similar to a diff with CREATE TABLE sql statements. |
Hi, Here's the result: The schema differs for the "glpi_plugin_formcreator_forms_languages" table. |
Hi You should fix the collation; but your problem is not from here. It seems that the SQL query produces an empty string where an integer is expected (an ID). You don't have any inconsistency on the column used as source of that id, but let's check anyway. Show me the result of the following query
|
Hi The column requester_id is an integer, as expected, so this is fine. lets try the following query, to find out the rows with an empty string. I believe that the problem comes from the 2nd or 3rd query in the UNION SELECT
display_id,
users_id_recipient
FROM
(
(
SELECT DISTINCT
NULL as id,
IF(
glpi_plugin_formcreator_formanswers.name = '',
CONCAT('(', glpi_plugin_formcreator_formanswers.id, ')'),
glpi_plugin_formcreator_formanswers.name
) as name,
CONCAT('f_', glpi_plugin_formcreator_formanswers.id) as display_id,
glpi_plugin_formcreator_formanswers.id AS items_id,
'PluginFormcreatorFormAnswer' as itemtype,
glpi_plugin_formcreator_formanswers.status AS status,
glpi_plugin_formcreator_formanswers.request_date AS date_creation,
glpi_plugin_formcreator_formanswers.request_date AS date_mod,
glpi_plugin_formcreator_formanswers.entities_id AS entities_d,
glpi_plugin_formcreator_formanswers.is_recursive AS is_recursive,
glpi_plugin_formcreator_formanswers.requester_id AS requester_id,
glpi_plugin_formcreator_formanswers.comment AS comment,
glpi_plugin_formcreator_formanswers.requester_id AS users_id_recipient
FROM
glpi_plugin_formcreator_formanswers
LEFT JOIN glpi_plugin_formcreator_forms ON (
glpi_plugin_formcreator_forms.id = glpi_plugin_formcreator_formanswers.plugin_formcreator_forms_id
)
LEFT JOIN glpi_items_tickets ON (
glpi_items_tickets.items_id = glpi_plugin_formcreator_formanswers.id
AND glpi_items_tickets.itemtype = 'PluginFormcreatorFormAnswer'
)
GROUP BY
glpi_plugin_formcreator_formanswers.id
HAVING
COUNT(glpi_items_tickets.tickets_id) != 1
)
UNION
(
SELECT DISTINCT
NULL as id,
IF(
glpi_tickets.name = '',
CONCAT('(', glpi_tickets.id, ')'),
glpi_tickets.name
) as name,
CONCAT('t_', glpi_tickets.id) as display_id,
glpi_tickets.id AS items_id,
'Ticket' as itemtype,
IF(
glpi_tickets.global_validation IN ('1', '3'),
glpi_tickets.status,
IF(
glpi_tickets.status IN ('5', '6'),
glpi_tickets.status,
IF(
glpi_tickets.global_validation = '2',
'101',
'102'
)
)
) AS status,
glpi_tickets.date AS date_creation,
glpi_tickets.date_mod AS date_mod,
glpi_tickets.entities_id AS entities_id,
0 as is_recursive,
COALESCE(glpi_tickets_users.users_id, 0) as requester_id,
glpi_tickets.content AS comment,
users_id_recipient AS users_id_recipient
FROM
glpi_tickets
LEFT JOIN glpi_items_tickets ON (
glpi_items_tickets.tickets_id = glpi_tickets.id
AND glpi_items_tickets.itemtype = 'PluginFormcreatorFormAnswer'
)
LEFT JOIN (
SELECT DISTINCT
users_id,
tickets_id
FROM
glpi_tickets_users
WHERE
type = '1'
GROUP BY
tickets_id
ORDER BY
id ASC
) AS glpi_tickets_users ON (glpi_tickets.id = glpi_tickets_users.tickets_id)
WHERE
glpi_tickets.is_deleted = '0'
GROUP BY
glpi_tickets.id
HAVING
COUNT(glpi_items_tickets.items_id) = 0
)
UNION
(
SELECT
NULL as id,
IF(
glpi_tickets.name = '',
CONCAT('(', glpi_tickets.id, ')'),
glpi_tickets.name
) as name,
CONCAT('t_', glpi_tickets.id) as display_id,
glpi_tickets.id AS items_id,
'Ticket' as itemtype,
IF(
glpi_tickets.global_validation IN ('1', '3'),
glpi_tickets.status,
IF(
glpi_tickets.status IN ('5', '6'),
glpi_tickets.status,
IF(
glpi_tickets.global_validation = '2',
'101',
'102'
)
)
) AS status,
glpi_tickets.date AS date_creation,
glpi_tickets.date_mod AS date_mod,
glpi_tickets.entities_id AS entities_id,
0 as is_recursive,
COALESCE(glpi_tickets_users.users_id, 0) as requester_id,
glpi_tickets.content AS comment,
users_id_recipient AS users_id_recipient
FROM
glpi_tickets
INNER JOIN glpi_items_tickets ON (
glpi_items_tickets.tickets_id = glpi_tickets.id
AND glpi_items_tickets.itemtype = 'PluginFormcreatorFormAnswer'
)
LEFT JOIN (
SELECT DISTINCT
users_id,
tickets_id
FROM
glpi_tickets_users
WHERE
type = '1'
GROUP BY
tickets_id
ORDER BY
id ASC
) AS glpi_tickets_users ON (glpi_tickets.id = glpi_tickets_users.tickets_id)
WHERE
glpi_tickets.is_deleted = '0'
GROUP BY
glpi_items_tickets.items_id
HAVING
COUNT(glpi_items_tickets.items_id) = 1
)
) AS union_474dfb8b612fe0826a2367c0de7d140a
where users_id_recipient = '' |
Hi, |
0 is not an empty string; then the error Which DBMS are you using ? |
I use Mariabd server (10.6.18). |
Hi, Is there a way to view the history from the simplified interface? |
For your information, when I type: ./console glpi:database:check_schema_integrity --strict I get this result:
|
Hi This output shows that there is no problem with the tables of the plugin. It seems that the main differences is the order if columns or keys which is not a problem for GLPI. Only Formcreator requires a strict order of columns in one of its tables and it is correct in your instance. The problem is elsewhere. |
Do you have any idea where this problem comes from? |
Not yet |
The fact that the history is not complete in the simplified interface, can you have a link with my initial problem? |
I think I have a clue: I noticed that when I create a ticket, it creates an f_XXXX, as I entered in my initial request. As you told me, this happens because there are multiple tickets linked to the form completed by the user. I noticed that the second linked ticket was from 2020 or 2021. I think something happened at that point (uninstalling/reinstalling the formcreator plugin didn't work correctly, for example, due to a bug in the plugin or a related bug). In the database, there is a table called glpi_items_ticket. I deleted all the links between the forms and the 2020 and 2021 tickets. Then I ran the "SyncIssues" task in GLPI's automatic tasks. When creating a new ticket from the form, it creates a t_XXXX. Those that were in f_XXX have moved to t_XXXXX after all the manipulation of what I just told you |
This can help to make a connection with a past bug, over a more specific period |
Hi
Indeed, it the plugin is uninstalled the form answers are deleted. If the plugin is reinstalled later, then tie form answers are missing and the generated tickets are considered created bu GLPI, without Formcreator. The best way to check this scenario is to investigate in the database and see if there is a relation entry in glpi_items_tickets between a ticket and an object FormAnswer (in SQL : WHERE tickets_id=42 AND itemtype='PluginFormcreatorFormAnswer' The ID must be changed to the ID of the ticket that you want to examine). The column items_id in the result (if any) is the ID of a form answer. You must check that this row exists in glpi_plugin_formcreator_formanswers. If you deleted the relations I believe this is not longer possible to check if all FormAnswers objects exist in DB for the relation rows in glpi_items_tickets, but the action "SyncIssues" seems to work now. |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
Hello,
From the simplified GLPI interface, I create tickets from a form (formcreator). However, when I look at the ticket list I see the data from the completed form (f_XXXXX) but I don't see the ticket (t_XXXXX). To see the ticket, I have to enter f_XXXX, then go to the "ticket" tab and then I access the ticket. I did some research on this subject but I can't find my case
To Reproduce
1 Log in to glpi with your user profile (with the simplified interface)
2 Click on a form
3 Fill in the form fields and then confirm
4 Go to "My Support Requests" and then view the data from the previously completed form (f_xxxx)
GLPI / Plugins (please complete the following information):
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: