You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2024-03-28 09:16:50

avelor
Member
Registered: 2024-03-28
Posts: 2

Issue to plugin "generic object"

it seems that we have find a bug at plugin.
But I cann't report issue at it's repo   github pluginsGLPI/genericobject/issues
I try to report issue at core repo, but it was closed -  github glpi-project/glpi/issues/16842

may be there is a another way to report issue?

or may be somebody know how to fix it:
than I try to sort custom objects by users field - no matter "user" or "technical in charge" there is an error "Expression #1 of ORDER BY contains aggregate function and applies to the result of a non-aggregated query".

thank you!

Offline

#2 2024-03-28 11:42:58

cconard96
Moderator
Registered: 2018-07-31
Posts: 2,418
Website

Re: Issue to plugin "generic object"

As far as I know, there is no way to report an issue for this plugin on GitHub. The best way, unless you have a GLPI Network subscription, is to make a post on the forum here.

Can you check the files/_log/sql-errors.log file for the full error message which includes the query and the stack trace?


GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.

Offline

#3 2024-03-30 12:01:35

avelor
Member
Registered: 2024-03-28
Posts: 2

Re: Issue to plugin "generic object"

Thank you for answer!

here is log

[2024-03-30 12:56:55] glpisqllog.ERROR: DBmysql::doQuery() in /var/www/glpi/src/DBmysql.php line 403
  *** MySQL query error:
  SQL: SELECT DISTINCT `glpi_plugin_genericobject_systemaccounts`.`id` AS id, 'admin' AS currentuser,
                        `glpi_plugin_genericobject_systemaccounts`.`entities_id`, `glpi_plugin_genericobject_systemaccounts`.`is_recursive`,  `glpi_plugin_genericobject_systemaccounts`.`name` AS `ITEM_PluginGenericobjectSystemaccount_1`,
                        `glpi_plugin_genericobject_systemaccounts`.`id` AS `ITEM_PluginGenericobjectSystemaccount_1_id`,
                        `glpi_plugin_genericobject_systemaccounts`.`otherserial` AS `ITEM_PluginGenericobjectSystemaccount_6`,   `glpi_users`.`name` AS `ITEM_PluginGenericobjectSystemaccount_9`,
                        `glpi_users`.`realname` AS `ITEM_PluginGenericobjectSystemaccount_9_realname`,
                        `glpi_users`.`id`  AS `ITEM_PluginGenericobjectSystemaccount_9_id`,
                        `glpi_users`.`firstname` AS `ITEM_PluginGenericobjectSystemaccount_9_firstname`,
                        `glpi_plugin_fields_plugingenericobjectsystemaccountsysaccfields_distinguishednamefield`.`distinguishednamefield` AS `ITEM_PluginGenericobjectSystemaccount_76739`,  `glpi_plugin_fields_plugingenericobjectsystemaccountsysaccfields_appliances_id_associatedappliancefield`.`appliances_id_associatedappliancefield` AS `ITEM_PluginGenericobjectSystemaccount_76738` FROM `glpi_plugin_genericobject_systemaccounts`LEFT JOIN `glpi_users`
                                          ON (`glpi_plugin_genericobject_systemaccounts`.`users_id` = `glpi_users`.`id`
                                              ) LEFT JOIN `glpi_plugin_fields_plugingenericobjectsystemaccountsysaccfields`  AS `glpi_plugin_fields_plugingenericobjectsystemaccountsysaccfields_distinguishednamefield`
                                          ON (`glpi_plugin_genericobject_systemaccounts`.`id` = `glpi_plugin_fields_plugingenericobjectsystemaccountsysaccfields_distinguishednamefield`.`items_id`
                                              AND `glpi_plugin_fields_plugingenericobjectsystemaccountsysaccfields_distinguishednamefield`.`itemtype` = 'PluginGenericobjectSystemaccount'
                                              )  LEFT JOIN `glpi_plugin_fields_plugingenericobjectsystemaccountsysaccfields`  AS `glpi_plugin_fields_plugingenericobjectsystemaccountsysaccfields_appliances_id_associatedappliancefield`
                                          ON (`glpi_plugin_genericobject_systemaccounts`.`id` = `glpi_plugin_fields_plugingenericobjectsystemaccountsysaccfields_appliances_id_associatedappliancefield`.`items_id`
                                              AND `glpi_plugin_fields_plugingenericobjectsystemaccountsysaccfields_appliances_id_associatedappliancefield`.`itemtype` = 'PluginGenericobjectSystemaccount'
                                              )  WHERE  `glpi_plugin_genericobject_systemaccounts`.`is_deleted` = 0  AND `glpi_plugin_genericobject_systemaccounts`.`is_template` = 0  ORDER BY GROUP_CONCAT(DISTINCT CONCAT(
                                IFNULL(`glpi_users`.`realname`, ''),
                                IFNULL(`glpi_users`.`firstname`, ''),
                                IFNULL(`glpi_users`.`name`, '')
                            ) ORDER BY CONCAT(
                                IFNULL(`glpi_users`.`realname`, ''),
                                IFNULL(`glpi_users`.`firstname`, ''),
                                IFNULL(`glpi_users`.`name`, '')) ASC
                            ) ASC  LIMIT 0, 15
  Error: Expression #1 of ORDER BY contains aggregate function and applies to the result of a non-aggregated query
  Backtrace :
  src/Search.php:1458                                DBmysql->doQuery()
  src/Search.php:449                                 Search::constructData()
  ajax/search.php:79                                 Search::getDatas()
  {"user":"8@glpi-dc2"}
[2024-03-30 12:56:55] glpisqllog.ERROR: DBmysql::doQuery() in /var/www/glpi/src/DBmysql.php line 403
  *** MySQL query error:
  SQL: SELECT DISTINCT `glpi_plugin_genericobject_systemaccounts`.`id` AS id, 'admin' AS currentuser,
                        `glpi_plugin_genericobject_systemaccounts`.`entities_id`, `glpi_plugin_genericobject_systemaccounts`.`is_recursive`,  `glpi_plugin_genericobject_systemaccounts`.`name` AS `ITEM_PluginGenericobjectSystemaccount_1`,
                        `glpi_plugin_genericobject_systemaccounts`.`id` AS `ITEM_PluginGenericobjectSystemaccount_1_id`,
                        `glpi_plugin_genericobject_systemaccounts`.`otherserial` AS `ITEM_PluginGenericobjectSystemaccount_6`,   `glpi_users`.`name` AS `ITEM_PluginGenericobjectSystemaccount_9`,
                        `glpi_users`.`realname` AS `ITEM_PluginGenericobjectSystemaccount_9_realname`,
                        `glpi_users`.`id`  AS `ITEM_PluginGenericobjectSystemaccount_9_id`,
                        `glpi_users`.`firstname` AS `ITEM_PluginGenericobjectSystemaccount_9_firstname`,
                        `glpi_plugin_fields_plugingenericobjectsystemaccountsysaccfields_distinguishednamefield`.`distinguishednamefield` AS `ITEM_PluginGenericobjectSystemaccount_76739`,  `glpi_plugin_fields_plugingenericobjectsystemaccountsysaccfields_appliances_id_associatedappliancefield`.`appliances_id_associatedappliancefield` AS `ITEM_PluginGenericobjectSystemaccount_76738` FROM `glpi_plugin_genericobject_systemaccounts`LEFT JOIN `glpi_users`
                                          ON (`glpi_plugin_genericobject_systemaccounts`.`users_id` = `glpi_users`.`id`
                                              ) LEFT JOIN `glpi_plugin_fields_plugingenericobjectsystemaccountsysaccfields`  AS `glpi_plugin_fields_plugingenericobjectsystemaccountsysaccfields_distinguishednamefield`
                                          ON (`glpi_plugin_genericobject_systemaccounts`.`id` = `glpi_plugin_fields_plugingenericobjectsystemaccountsysaccfields_distinguishednamefield`.`items_id`
                                              AND `glpi_plugin_fields_plugingenericobjectsystemaccountsysaccfields_distinguishednamefield`.`itemtype` = 'PluginGenericobjectSystemaccount'
                                              )  LEFT JOIN `glpi_plugin_fields_plugingenericobjectsystemaccountsysaccfields`  AS `glpi_plugin_fields_plugingenericobjectsystemaccountsysaccfields_appliances_id_associatedappliancefield`
                                          ON (`glpi_plugin_genericobject_systemaccounts`.`id` = `glpi_plugin_fields_plugingenericobjectsystemaccountsysaccfields_appliances_id_associatedappliancefield`.`items_id`
                                              AND `glpi_plugin_fields_plugingenericobjectsystemaccountsysaccfields_appliances_id_associatedappliancefield`.`itemtype` = 'PluginGenericobjectSystemaccount'
                                              )  WHERE  `glpi_plugin_genericobject_systemaccounts`.`is_deleted` = 0  AND `glpi_plugin_genericobject_systemaccounts`.`is_template` = 0  ORDER BY GROUP_CONCAT(DISTINCT CONCAT(
                                IFNULL(`glpi_users`.`realname`, ''),
                                IFNULL(`glpi_users`.`firstname`, ''),
                                IFNULL(`glpi_users`.`name`, '')
                            ) ORDER BY CONCAT(
                                IFNULL(`glpi_users`.`realname`, ''),
                                IFNULL(`glpi_users`.`firstname`, ''),
                                IFNULL(`glpi_users`.`name`, '')) ASC
                            ) ASC  LIMIT 0, 15
  Error: Expression #1 of ORDER BY contains aggregate function and applies to the result of a non-aggregated query
  Backtrace :
  src/Search.php:1458                                DBmysql->doQuery()
  src/Search.php:449                                 Search::constructData()
  src/Search.php:200                                 Search::getDatas()
  src/Search.php:177                                 Search::showList()
  marketplace/genericobject/front/object.php:38      Search::show()

Last edited by avelor (2024-03-30 12:02:28)

Offline

#4 2024-04-05 11:23:32

jhoffmann
Member
Registered: 2024-04-05
Posts: 1

Re: Issue to plugin "generic object"

Hi! We are encountering exactly the same issue when ordering by user in certain custom tables. In other custom tables it works fine, even in global it works.
We couldn't identify the difference between the tables where it works and where it doesn't.

Offline

#5 2024-04-05 23:47:49

cconard96
Moderator
Registered: 2018-07-31
Posts: 2,418
Website

Re: Issue to plugin "generic object"

This may have actually been a bug on the GLPI side.
Can you try applying the changes from this PR?
https://github.com/glpi-project/glpi/pull/16433
This PR may also be required:
https://github.com/glpi-project/glpi/pull/16546

Both of these patches are going to be included with the GLPI 10.0.15 version.


GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.

Offline

Board footer

Powered by FluxBB