Skip to content

Column sorting incorrect #923

@Volkerti

Description

@Volkerti

Describe the bug
Column sorting is incorrect. If an extra column is activated, every try to sort columns by clicking the header sorts the next following column.

To Reproduce
Steps to reproduce the behavior:

  1. Go to a "Category" or "Storage location" and display all parts therein
  2. My standard columns are (in this order): "Name", "Description", "Category", "Footprint", "Manufacturer", "Storage locations", "Amount"
  3. Click on the tooth wheel and select "MPN" (I didn't try any other field) as additional column to display.
  4. Find "MPN" as last column
  5. Try to sort for "MPN" by clicking on the column header --> Does not sort
  6. Re-arrange columns by dragging column "MPN" to another position, e.g. between columns "Manufacturer" and "Storage locations"
  7. Try sorting different columns. Everything left of and including "Manufacturer" sorts well. If "MPN" column header is clicked, the table is sorted for column "Storage" (the NEXT column).
  8. Every click on a header right of and including "MPN" sorts the NEXT column.

Screenshots
Image
Correctly sorted

Image
Click on "MPN" sorts next column

Server Side
Behaviour is reproducible on Part-DB German Demo server

My setup:

  • Part-DB Version: 1.17.0
  • PHP Version: 8.3.19 (SAPI: fpm-fcgi)
  • Server Operating System: Linux partdb-1 4.4.302+ #69057 SMP Fri Jan 12 17:02:59 CST 2024 x86_64
  • Database Server: mysql 10.11.6-MariaDB

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Google Chrome
  • Version Version 135.0.7049.115 (Official Build) (64-bit)

Additional context
Seems like an column indexing problem. I did not try with more than 1 additional column. Don't know if this would cause this "sorting effect" shifted two columns.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions