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

Move selection to top doesn't worked when table is unsaved #28914

Closed
qgib opened this issue Jan 25, 2019 · 29 comments · Fixed by #31966
Closed

Move selection to top doesn't worked when table is unsaved #28914

qgib opened this issue Jan 25, 2019 · 29 comments · Fixed by #31966
Labels
Attribute Table Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority Regression Something which used to work, but doesn't anymore

Comments

@qgib
Copy link
Contributor

qgib commented Jan 25, 2019

Author Name: Patrick Dunford (@enzedrailmaps)
Original Redmine Issue: 21096
Affected QGIS version: 3.6.2
Redmine category:attribute_table


If changing data in a file based geopackage table.

Select a rown in the table, if the button to move selection to top is pressed, that record will not move to the top if there are records in the table that have not been saved.



Related issue(s): #29035 (duplicates), #29166 (duplicates)
Redmine related issue(s): 21217, 21348


@qgib
Copy link
Contributor Author

qgib commented Jan 25, 2019

Author Name: Giovanni Manghi (@gioman)


  • category_id was changed from GUI to Attribute table
  • operating_system was changed from Debian 9 to

@qgib
Copy link
Contributor Author

qgib commented Jan 29, 2019

Author Name: Etienne Trimaille (@Gustry)


I can confirm that "Move selection to top" is not working for me. Even if the table is saved, the selection is not at the top. (cf screenshot).

I noticed the same behavior yesterday on another computer.

But if I click on another column header, then the "move selection to top" is working.


  • 14206 was configured as Screenshot from 2019-01-29 16-14-10.png

@qgib
Copy link
Contributor Author

qgib commented Feb 11, 2019

Author Name: Giovanni Manghi (@gioman)


@qgib
Copy link
Contributor Author

qgib commented Feb 19, 2019

Author Name: Pedro Venâncio (Pedro Venâncio)


I confirm this one, both on 3.4.4 (code revision 12c660a) and master (code revision b711ef0).

Etienne Trimaille wrote:

I can confirm that "Move selection to top" is not working for me. Even if the table is saved, the selection is not at the top. (cf screenshot).

I noticed the same behavior yesterday on another computer.

But if I click on another column header, then the "move selection to top" is working.

Also selecting "Move selection to top", then "Invert selection" two times, the "Move selection to top" works.

@qgib
Copy link
Contributor Author

qgib commented Feb 19, 2019

Author Name: Pedro Venâncio (Pedro Venâncio)


Tested in Windows, with PostGIS layers and shapefiles, with Toggle Editing closed.

@qgib
Copy link
Contributor Author

qgib commented Feb 19, 2019

Author Name: Giovanni Manghi (@gioman)


Pedro Venâncio wrote:

Tested in Windows, with PostGIS layers and shapefiles, with Toggle Editing closed.

this is a regression, correct?


  • priority_id was changed from Normal to High
  • regression was changed from 0 to 1
  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Feb 20, 2019

Author Name: Pedro Venâncio (Pedro Venâncio)


Giovanni Manghi wrote:

this is a regression, correct?

Yes, definitively Giovanni. I tested in another machine that still have QGIS 3.4.3 (code revision b557cc2) and it works as expected.

@qgib
Copy link
Contributor Author

qgib commented Feb 20, 2019

Author Name: Giovanni Manghi (@gioman)


  • status_id was changed from Feedback to Open

@qgib
Copy link
Contributor Author

qgib commented Feb 22, 2019

Author Name: Jürgen Fischer (@jef-n)


@qgib
Copy link
Contributor Author

qgib commented Apr 27, 2019

Author Name: Bernd Vogelgesang (Bernd Vogelgesang)


Still not working in 3.6.2

@qgib
Copy link
Contributor Author

qgib commented May 1, 2019

Author Name: Giovanni Manghi (@gioman)


  • version was changed from 3.4.4 to 3.6.2

@qgib
Copy link
Contributor Author

qgib commented May 20, 2019

Author Name: Bernd Vogelgesang (Bernd Vogelgesang)


Just installed 3.6.3. In "general" the selection to top button works now. What is different to past behaviour is, that when you already have a selection and click the button, nothing happens. Only when you make a new selection while the button is already active, it sorts the selection to top. So, I still see a regression here.

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority Attribute Table Regression Something which used to work, but doesn't anymore labels May 25, 2019
@rduivenvoorde
Copy link
Contributor

test.zip

Still having this issue in Master today, when showing off a new user how to work with GeoPackages...
Pretty easy to reproduce:

  • load attached test.gpkg
  • select some features: open attribute table: use button "move selection to top" => works
  • now make layer editable, add one point, save
  • select some other features
  • move selection to top does NOT work anymore (and will not work anymore during this session)

@FOGIA99
Copy link

FOGIA99 commented Jul 17, 2019

Hello, just installed version 3.8.0 and the button moving selection to the top doesn't work. Same Problem on version 3.6.0 so definitively a regression. Can someone here make a proposition to solve this problem ?

@andreasneumann
Copy link
Member

I understand and agree that this bug should be fixed. But meanwhile, I think a good workaround exists: just filter your attribute table to "selected features only". Isn't this just as good as moving selected ones to the top?

@FOGIA99
Copy link

FOGIA99 commented Jul 17, 2019

Hi, i agree with you, this is a solution but when i use this tool it's in order to have a look on other similar datas. Because "selected features only" moves selection to the top, but still, i need other features in order to work with efficiency.

@andreasneumann
Copy link
Member

fair enough. I see the value of "move selection to top". Howerver, there had been discussions that this part of the code is quite old and fragile and in need of a refactoring. And if it is refactored, it would need lots and lots of testing to make sure the refactoring doesn't introduce new issues.

@FOGIA99
Copy link

FOGIA99 commented Jul 17, 2019

Thanks for the feedback Mr Neumann

@m-kuhn
Copy link
Member

m-kuhn commented Sep 23, 2019

Likely related to #8725

m-kuhn added a commit to m-kuhn/QGIS that referenced this issue Sep 23, 2019
@rduivenvoorde
Copy link
Contributor

Almost... :-)
Using my test from above:

  • creating a NEW selection (after adding some new features) indeed moves them to the top.
    But after that:
  • deselect the 'move selection to top button'
  • select some points (see they become selected in attr table dispersed over the rows)
  • select the 'move selection to top button'
    ==> nothing changes (while I would think the selection would move to the top ?_
    BUT:
  • now (still having the 'move selection to top button' selected) make a NEW selection
  • all selected rows nicely go to the top

Is this reproducable for others?
I think almost OK, isn't it?

@m-kuhn
Copy link
Member

m-kuhn commented Sep 24, 2019

@rduivenvoorde what did you test with, current master or PR #31966 ?

@rduivenvoorde
Copy link
Contributor

Ah, duh... I was to quick, I compiled current master, thinking the PR was already pulled...
If somebody else is able to check, please do, I'm not available today

@m-kuhn
Copy link
Member

m-kuhn commented Oct 29, 2019

@andreasneumann and others, is this still an issue in QGIS 3.10/master?
I was trying to write tests for it but don't succeed to reproduce it with current master even though my patch has not been merged. Has this been solved otherwise?

@rduivenvoorde
Copy link
Contributor

Please others test also, but if I test my geopackage from above and the scenario's I wrote above. These seem to work (in just compiled master).

@gioman
Copy link
Contributor

gioman commented Oct 29, 2019

Please others test also, but if I test my geopackage from above and the scenario's I wrote above. These seem to work (in just compiled master).

@m-kuhn @rduivenvoorde NOT working here on a unsaved PostGIS layer. Works if editing is not active or if is active but there are no changes made.

@gioman
Copy link
Contributor

gioman commented Oct 29, 2019

On master (from repository).

@m-kuhn
Copy link
Member

m-kuhn commented Oct 29, 2019

Thanks @gioman I'll continue the research in this case. I'd love to have a file based (or even memory layer based) sample for the unit tests.

@Gustry
Copy link
Contributor

Gustry commented Oct 29, 2019

@m-kuhn I think I got some progress on master indeed. Thanks!

But I still have the issue with a geopackage for instance:

  • Open the attribute table
  • Select some features
  • Activate 'move selection to top', working.
  • Deactivate the tool
  • Do another selection
  • Activate the tool again, not working

I got this bug every-time following this scenario.

@m-kuhn
Copy link
Member

m-kuhn commented Oct 29, 2019

Thanks @Gustry exactly what I needed

backporting bot pushed a commit that referenced this issue Oct 30, 2019
nyalldawson pushed a commit that referenced this issue Oct 30, 2019
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! High Priority Regression Something which used to work, but doesn't anymore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants