Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sorting on a column that has a value relation is inconsistent #36114

Closed
tudorbarascu opened this issue Apr 30, 2020 · 1 comment · Fixed by #36776
Closed

sorting on a column that has a value relation is inconsistent #36114

tudorbarascu opened this issue Apr 30, 2020 · 1 comment · Fixed by #36776
Assignees
Labels
Attribute Table Bug Either a bug report, or a bug fix. Let's hope for the latter!

Comments

@tudorbarascu
Copy link
Member

tudorbarascu commented Apr 30, 2020

I've just noticed that sorting with a value relation as a widget gives bad results as I have NULL values in the middle.. instead of at the beginning or at the end:

image

As you can see from the image above, for the strada_id field which is coming from a joined layer and the widget is a value relation sorting has NULL values in the middle.
This is very bad as this disrupts the following workflow:

  • Order by column...
  • Select some values... based on alphabetical order (if you see NULL.. you stop.. as you would expect thee aren't values after it..)
  • Edit the features using field calculator (or some other stuff)

How to Reproduce

I'll put tomorrow data + project to reproduce as I don't have the time now :(.

If I use the simple text widget instead of the value relation one the sorting is ok.

Additional context

@tudorbarascu tudorbarascu added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Apr 30, 2020
@tudorbarascu tudorbarascu changed the title sorting on a column that comes from a joined layer is inconsistent sorting on a column that has a value relation is inconsistent May 1, 2020
@tudorbarascu
Copy link
Member Author

Well.. l can replicate now. The NULL for value map widgets pops in the middle when sorting as sorting is done alphabetically and N from NULL is alphabetically somewhere in the midlle. I really would have expected NULL values to be be on top or at the end when sorted. But I guess..each day you learn new things.

Here's the test project with geopackage data [bug_sorting.zip].(https://github.com/qgis/QGIS/files/4565949/bug_sorting.zip).
You can see from the image below that sorting takes NULL into account alphabetically.
image

Is this expected or a disturbance in the force?

@troopa81 troopa81 self-assigned this May 27, 2020
troopa81 added a commit to troopa81/QGIS that referenced this issue May 27, 2020
nyalldawson pushed a commit to nyalldawson/QGIS that referenced this issue Jun 2, 2020
nyalldawson pushed a commit to nyalldawson/QGIS that referenced this issue Jun 2, 2020
(cherry picked from commit f1a5c5d)
(cherry picked from commit 7844412)
nyalldawson pushed a commit that referenced this issue Jun 19, 2020
(cherry picked from commit f1a5c5d)
(cherry picked from commit 7844412)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Attribute Table Bug Either a bug report, or a bug fix. Let's hope for the latter!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants