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 2016-03-09 22:12:46

noximuz
Member
Registered: 2016-03-09
Posts: 21

Bug: Dropdown items with translations display incorrecttly

It affects all dropdowns with translations if they have 2+ items and are being viewed in translation language.

Any solution yet (0.90.1)?

Last edited by noximuz (2016-03-10 21:53:28)


Glpi 9.2.2

Offline

#2 2016-03-10 21:51:38

noximuz
Member
Registered: 2016-03-09
Posts: 21

Re: Bug: Dropdown items with translations display incorrecttly

OK, I'll try to dig the code. Hope to get back soon with a solution.


Glpi 9.2.2

Offline

#3 2016-03-11 12:27:24

noximuz
Member
Registered: 2016-03-09
Posts: 21

Re: Bug: Dropdown items with translations display incorrecttly

It seams that the issue has something to do with GROUP_CONCAT...


Glpi 9.2.2

Offline

#4 2016-03-11 12:54:37

noximuz
Member
Registered: 2016-03-09
Posts: 21

Re: Bug: Dropdown items with translations display incorrecttly

If comment out the code in condition at inc/search.class.php:2483 names become visible (without translations).

But at least the list is visible and functional, no breaking view. It just a workaround, devs needs to review that code part.

Last edited by noximuz (2016-03-11 13:01:17)


Glpi 9.2.2

Offline

#5 2016-03-11 13:44:47

noximuz
Member
Registered: 2016-03-09
Posts: 21

Re: Bug: Dropdown items with translations display incorrecttly

Looks like a GROUP BY is missing in SQL for certain entities what prevents GROUP_CONCAT to work correctly...


Glpi 9.2.2

Offline

#6 2016-03-11 16:34:28

yllen
GLPI-DEV
From: Sillery (51)
Registered: 2008-01-14
Posts: 15,278

Re: Bug: Dropdown items with translations display incorrecttly

This problem is solved in 0.90.2


CentOS 6.5 - CentOS 7.x
PHP 5.6 - PHP 7.x - MySQL 5.6  - MariaDB 10.2 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)

Offline

#7 2016-03-11 20:13:05

noximuz
Member
Registered: 2016-03-09
Posts: 21

Re: Bug: Dropdown items with translations display incorrecttly

yllen wrote:

This problem is solved in 0.90.2

Thanks! Glad to hear it.

Can you provide more info or a relevant commit on github?


Glpi 9.2.2

Offline

#8 2016-04-06 19:35:09

noximuz
Member
Registered: 2016-03-09
Posts: 21

Re: Bug: Dropdown items with translations display incorrecttly

noximuz wrote:
yllen wrote:

This problem is solved in 0.90.2

Thanks! Glad to hear it.

Can you provide more info or a relevant commit on github?

Just upgraded to GLPI 0.90.2. The problem is stil there.


Glpi 9.2.2

Offline

#9 2016-04-06 20:13:28

yllen
GLPI-DEV
From: Sillery (51)
Registered: 2008-01-14
Posts: 15,278

Re: Bug: Dropdown items with translations display incorrecttly

Have you errors in glpi logs? in debug mode?


CentOS 6.5 - CentOS 7.x
PHP 5.6 - PHP 7.x - MySQL 5.6  - MariaDB 10.2 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)

Offline

#10 2016-04-09 14:50:43

noximuz
Member
Registered: 2016-03-09
Posts: 21

Re: Bug: Dropdown items with translations display incorrecttly

yllen wrote:

Have you errors in glpi logs? in debug mode?

Have not seen any errors in logs. How to enable debug mode?

At the moment we use this patch as a workaround:

diff --git a/inc/search.class.php b/inc/search.class.php
index 016d25e..d850707 100644
--- a/inc/search.class.php
+++ b/inc/search.class.php
@@ -649,7 +649,9 @@ class Search {
       // Meta Search / Search All / Count tickets
       if ((count($data['search']['metacriteria']))
           || !empty($HAVING)
-          || $data['search']['all_search']) {
+          || $data['search']['all_search']
+/* added groupby detection to prevent list with translation distortion in dropdowns */
+          || strpos($SELECT, 'GROUP_CONCAT') !== false) {
          $GROUPBY = " GROUP BY `$itemtable`.`id`";
       }

Glpi 9.2.2

Offline

#11 2016-09-03 11:26:17

noximuz
Member
Registered: 2016-03-09
Posts: 21

Re: Bug: Dropdown items with translations display incorrecttly

Just upgraded to GLPI 0.90.5. The problem is stil there.


Glpi 9.2.2

Offline

#12 2016-09-03 12:07:46

noximuz
Member
Registered: 2016-03-09
Posts: 21

Re: Bug: Dropdown items with translations display incorrecttly

Its quite simple to reproduce the problem:

1. Log in to GLPI
2. Set profile language to e.g. Russian
3. Go to Menu -> Settings -> Dropdowns -> Statuses (or any other)
4. Create two+ new statuses with Russian translations.
5. Go to Menu -> Settings -> Dropdowns -> Statuses

You'll notice the list of Statuses is displayed incorrectly if Russian language is used in the user profile (disaplayed at top right).
If change language to default GLPI language (English) everything is displayed correctly.

No errors in PHP or SQL logs, just a lot of PHP notices about undefined indexes.

Thanks.


Glpi 9.2.2

Offline

#13 2016-09-09 13:03:24

yllen
GLPI-DEV
From: Sillery (51)
Registered: 2008-01-14
Posts: 15,278

Re: Bug: Dropdown items with translations display incorrecttly

List of statuses are never translated (because not used by all user but only super-admin)
Only statuses in an item is display in the user language.
https://github.com/glpi-project/glpi/issues/953


CentOS 6.5 - CentOS 7.x
PHP 5.6 - PHP 7.x - MySQL 5.6  - MariaDB 10.2 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)

Offline

#14 2016-12-10 11:07:23

noximuz
Member
Registered: 2016-03-09
Posts: 21

Re: Bug: Dropdown items with translations display incorrecttly

Hi everyone. I've just upgraded up to 9.1.1.

As far as I can see the issue is still there... but in a slight different form.

As soon as I add a translation to any Dropdown item in e.g. RU being viewed the GLPI in RU, it disappears from the list.

Yet, it can be still viewed in EN... only, very wired thing.


Glpi 9.2.2

Offline

#15 2016-12-11 07:38:55

noximuz
Member
Registered: 2016-03-09
Posts: 21

Re: Bug: Dropdown items with translations display incorrecttly

*** MySQL query error:
  SQL: SELECT \'noximuz\' AS currentuser,
                         `glpi_softwarelicensetypes`.`name` AS `ITEM_0`,
                        `glpi_softwarelicensetypes`.`id` AS `ITEM_0_id`,
                        GROUP_CONCAT(DISTINCT CONCAT(IFNULL(IFNULL(`glpi_softwarelicensetypes_trans`.`value`,\'__NULL__\') , \'__NULL__\'),
                                                          \'$#$\',`glpi_softwarelicensetypes`.`id`)
                                          SEPARATOR \'$$##$$\')
                                  AS `ITEM_0_trans`,.
                        `glpi_softwarelicensetypes`.`id` AS id  FROM `glpi_softwarelicensetypes` ORDER BY ITEM_0 ASC  LIMIT 0, 15
  Error: Unknown column 'glpi_softwarelicensetypes_trans.value' in 'field list'
  Backtrace :
  inc/search.class.php:921...........................
  inc/search.class.php:97                            Search::constructDatas()
  inc/search.class.php:80                            Search::showList()
  front/dropdown.common.php:52                       Search::show()
  front/softwarelicensetype.php:41                   include()

Glpi 9.2.2

Offline

#16 2017-02-16 23:25:39

noximuz
Member
Registered: 2016-03-09
Posts: 21

Re: Bug: Dropdown items with translations display incorrecttly

Just tested on 9.1.2, the issue has been finally fixed!

Thanks!


Glpi 9.2.2

Offline

Board footer

Powered by FluxBB