Skip to content

Sort by rating and another column is inconsistent when a value is rated and then unrated #2947

Description

@kgarner7

Steps to reproduce

  1. Create a table with at least two columns; one of them is a rating column, the other is some other sortable field
  2. Add a few items in the table. Rate one of the items, and then clear the rating. In the db (oc_tables_row_cells_number), this is now a value of 0. Make sure that some of the items are not rated
  3. Sort the ratings in descending order, then sort another column.

Let's give a simple example

number rating
2 5
3 0 (previously rated)
1 unrated (null)

Sort by rating DESC, then NUMBER ASC

Expected behavior

The item that was rated and then unrated is treated equivalently to an item that is unrated. Secondary sort takes over

number rating
2 5
1 unrated (null)
3 0 (previously rated)

Actual behavior

The item that was rated and then unrated is treated above null

number rating
2 5
3 0 (previously rated)
1 unrated (null)

Attached, see a snippet of a real example I observed. Column 1 is a number, column 2 is a rating column. Sort is by priority (column 2), then duration. Fields that are 0 were rated then unrated.

26-09-03_04-44_Pending items.csv

Tables app version

2.3.0

Browser

Firefox 1.54.1

Client operating system

Linux

Operating system

Linux (Docker)

Web server

Apache

PHP engine version

Other

Database

PostgreSQL

Additional info

PHP 8.5.10. Image https://hub.docker.com/_/nextcloud.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagePending approval or rejection. This issue is pending approval.bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions