ericferon / glpi-archimap

GLPI plugin for drawing architecture maps (based on draw.io)
GNU General Public License v2.0
19 stars 10 forks source link

non-ansi characters in 'selection criteria' field #46

Closed user9931 closed 2 years ago

user9931 commented 2 years ago

Is it possible to use non-ansi characters in 'selection criteria' field? I'm trying to filders computers by type "Сервер" ('server'): Selection criteria: glpi_computers.type='"Сервер" image

but SQL statement "dont see" that word" image

ericferon commented 2 years ago

Indeed, I see that non-Ansi characters are discarded. I will have to analyze why. Meanwhile, if you want to select on computer type, you should modify your selection criteria : 1) your word Сервер is enclosed in 1 single quote and 1 double quote before, and 1 double quote after. You should use preferably 1 single quote before and 1 after. 2) the field name in table glpi_computers is "computertypes_id", containing a foreign key to table glpi_computertypes. So, if you want to use this field, you should write, in selection criteria : glpi_computers.computertypes_id = <the key of Сервер in table glpi_computertypes> With this option, you avoid non-Ansi characters. 3) once the problem is solved, you could write it another way : glpi_computertypes.name = 'Сервер' (taking into account that the tables are already linked via the statement "glpi_computers.computertypes_id = glpi_computertypes.id", in your second screenshot) Kind regards,

user9931 commented 2 years ago

thank you for solutions! Selection with "id" are okay for me (though not very clear to understand after some time). by the way, in 3) использование glpi_computertypes.name = 'Server' приводит к той же проблеме - не-ANSI-символы не отображаются в sql-запросе...

ericferon commented 2 years ago

The problem has been solved in v3.2.0. K.r,