akeneo / pim-community-dev

[Community Development Repository] The open source Product Information Management (PIM)
http://www.akeneo.com
Other
950 stars 513 forks source link

Sorting attributes with numerical codes #20382

Open marcin-dorosiewicz opened 5 months ago

marcin-dorosiewicz commented 5 months ago

Hi,

:bug: I'm reporting a Bug :bug:

Tested on the latest version: 7.0.46 but also earlier versions, there is an error for attributes whose code is numeric. The error relates to the sorting on the product grids.

The way to reproduce this error:

  1. Add an attribute with a numeric code to any group with the option to display on the grid.

Code (required): 385 Type: Simple select Attribute group (required): General Usable in grid: Yes

Screenshot from 2024-01-09 07-39-21

  1. Add a column with numeric code to the product grid

Screenshot from 2024-01-09 07-39-53

  1. the page cannot load.

Screenshot from 2024-01-09 07-40-02

Log message:

[2024-01-09T06:40:40.404982+00:00] request.CRITICAL: Uncaught PHP Exception LogicException: "Could not found column(s) "385" for sorting" at /srv/pim/vendor/akeneo/pim-community-dev/src/Oro/Bundle/PimDataGridBundle/Extension/Sorter/SorterExtension.php line 100 {"exception":"[object] (LogicException(code: 0): Could not found column(s) \"385\" for sorting at /srv/pim/vendor/akeneo/pim-community-dev/src/Oro/Bundle/PimDataGridBundle/Extension/Sorter/SorterExtension.php:100)"} []

The way to solve broken product grid

Relogging (The column is not added but we can display the grid)

System info file:

akeneo-pim-system-info_2024-01-09_06 41.txt