-
Notifications
You must be signed in to change notification settings - Fork 125
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
My 5 last forms (requester) and My 5 last forms (validator) are not displayed. #3242
Comments
Hi I'm suspecting that something is wrong in your database. Please run the following SQL query, replacing the user ID 2 by the ID of the user impacted by the issue SELECT
`glpi_groups`.id as GID,
`glpi_groups_users`.`id` AS `IDD`,
`glpi_groups_users`.`id` AS `linkid`,
`glpi_groups_users`.`is_dynamic` AS `is_dynamic`,
`glpi_groups_users`.`is_manager` AS `is_manager`,
`glpi_groups_users`.`is_userdelegate` AS `is_userdelegate`
FROM
`glpi_groups_users`
LEFT JOIN `glpi_groups` ON (
`glpi_groups`.`id` = `glpi_groups_users`.`groups_id`
)
WHERE
`glpi_groups_users`.`users_id` = '2'
ORDER BY
`glpi_groups`.`name` |
If my assumption is right, the following fix may solve your problem. diff --git a/hook.php b/hook.php
index 4f83b9abf..08a56cec4 100644
--- a/hook.php
+++ b/hook.php
@@ -265,6 +265,9 @@ function plugin_formcreator_addDefaultWhere($itemtype) {
$groupIDs = [];
foreach ($groups as $group) {
+ if ($group['id'] === null) {
+ continue;
+ }
$groupIDs[] = $group['id'];
}
$groupIDs = implode(',', $groupIDs); |
I will try and answer |
Awesome solution |
btry
added a commit
that referenced
this issue
Apr 19, 2023
if a user is linked to a not existing group, a SQL IN statement begins with a comma fix #3242
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
If we go to the forms to see my latest forms from the self-service account, instead of "My 5 last forms (requester)" and "My 5 last forms (validator)" we see the message "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '46,17)) AND (
glpi_plugin_formcreator_formanswers
.entities_id
IN ('6') ...' at line 11" and "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '46,17)) AND (glpi_plugin_formcreator_formanswers
.entities_id
IN ('6') ...' at line 15" respectively.Moreover, this window is normally shown when logging in from the super-admin, by changing the rights, I realized that the error is affected by the parameter for changing general settings, self-service does not have it, and if you issue that window, it is displayed, but as you understand this is not an option
Expected behavior
I expect everything should work like in the screenshot
Screenshots
at the moment what self-service sees
GLPI / Plugins (please complete the following information):
formcreator Name: Form Creator Version: 2.13.5 State: Enabled
Install Method: Marketplace
Additional context
Debug: SQL REQUEST
Have errors "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '46,17)) AND (
glpi_plugin_formcreator_formanswers
.entities_id
IN ('6') ...' at line 11"screen
Debug: SQL REQUEST
Have errors "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '46,17)) AND (
glpi_plugin_formcreator_formanswers
.entities_id
IN ('6') ...' at line 15"screen
The text was updated successfully, but these errors were encountered: