Skip to content

Mismatching order between Counter Type and Counter Value in GUI #111

Description

@kabassanov

Hi,

There is something strange that happened when I migrated GLPI to 10.0.23 (some months ago). I'm not really sure how this could be related to printercounters, but here is a brieve description of what happens:

I have some printers with 4 counter types (Color A3, Black A4, Black A3, Color A4 in this order int the DB table). So there are also 4 values for this.
It seems that somehow updating to GLPI 10.0.23, changed the order in which values are inserted into the table. This should not be an issue, but...

The query in GUI for displaying uses:

SELECT `glpi_plugin_printercounters_records`.`id` AS `ITEM_79`,  `glpi_plugin_printercounters_records`.`date` AS `ITEM_80`,   `glpi_plugin_printercounters_recordmodels`.`name` AS `ITEM_81`,
                        `glpi_plugin_printercounters_recordmodels`.`id` AS `ITEM_81_id`,
                         `glpi_entities`.`name` AS `ITEM_82`,
                        `glpi_entities`.`id` AS `ITEM_82_id`,
                         GROUP_CONCAT(DISTINCT CONCAT(IFNULL(`glpi_plugin_printercounters_countertypes`.`name`, '__NULL__'),
                                               '$$',`glpi_plugin_printercounters_countertypes`.`id`) ORDER BY `glpi_plugin_printercounters_countertypes`.`id` SEPARATOR '$$$$')
                              AS `ITEM_83`,
                  
                   GROUP_CONCAT(DISTINCT CONCAT(IFNULL(`glpi_plugin_printercounters_counters`.`value`, '__NULL__'),
                                               '$$',`glpi_plugin_printercounters_counters`.`id`) ORDER BY `glpi_plugin_printercounters_counters`.`id` SEPARATOR '$$$$')
                              AS `ITEM_84`,
...

So orders in ITEM_83 and ITEM_84 mismatch...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions