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

QGIS 3 Vector Layer Fields Garbled when Clicking the Toggle Editing Icon #25773

Closed
qgib opened this issue Jan 17, 2018 · 18 comments
Closed

QGIS 3 Vector Layer Fields Garbled when Clicking the Toggle Editing Icon #25773

qgib opened this issue Jan 17, 2018 · 18 comments
Labels
Attribute Table Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption High Priority

Comments

@qgib
Copy link
Contributor

qgib commented Jan 17, 2018

Author Name: Calvin Hamilton (Calvin Hamilton)
Original Redmine Issue: 17878
Affected QGIS version: master
Redmine category:attribute_table
Assignee: Alessandro Pasotti


QGIS Version: 2.99.0-268

Attached is a sample geopackage file. Load the file into QGIS. Open the Attribute Table. Now click on the "Toggle Editing" toolbar icon. Watch the attribute table. For me, the first entry immediately becomes garbled. See the before and after images.



Related issue(s): #25756 (relates)
Redmine related issue(s): 17861


@qgib
Copy link
Contributor Author

qgib commented Jan 19, 2018

Author Name: Jérôme Guélat (Jérôme Guélat)


I can confirm this issue. And it looks like a regression since it's not happening with QGIS 2.18.15...

@qgib
Copy link
Contributor Author

qgib commented Jan 25, 2018

Author Name: Tom Chadwin (@tomchadwin)


Confirmed in c91e33d. Exiting layer edit without saving changes restores the row.

Interestingly, if you then enable editing again (without having closed the attribute table), the corruption does not occur.

@qgib
Copy link
Contributor Author

qgib commented Jan 26, 2018

Author Name: Alessandro Pasotti (@elpaso)


  • assigned_to_id was configured as Alessandro Pasotti

@qgib
Copy link
Contributor Author

qgib commented Jan 26, 2018

Author Name: Alessandro Pasotti (@elpaso)


one of the root causes is that the form value of the second "double" field is set to NULL, even when editing is disabled (see attachment)


  • 12029 was configured as qgis-attrtable-error.png

@qgib
Copy link
Contributor Author

qgib commented Jan 26, 2018

Author Name: Alessandro Pasotti (@elpaso)


Ok, I've probably found the issue with NULLs and I'll commit a patch soon, but I think we have another separate issue here that is the precision of the numeric floating point fields.

It is set to 0 by default that in code is implemented like leave the widget its own default that is 2 decimal positions.

I didn't try very hard, but I've not found an easy way to change it from the layer properties.

Would you mind filing a separate bug to discuss the precision issue?

I'm not sure about what the expected outcome should be, I think it would make sense to have more decimal places by default (like 6) and definitely there must be a way to configure that in the field configuration of the layer properties.


  • operating_system was changed from Windows 7 to Windows 7, Linux
  • category_id was changed from Vectors to Attribute table
  • status_id was changed from Open to In Progress
  • priority_id was changed from Normal to High

@qgib
Copy link
Contributor Author

qgib commented Jan 27, 2018

Author Name: Calvin Hamilton (Calvin Hamilton)


One thing I also have noticed is that when in editing mode, if you select a row from the Attribute Table and click the "Delete selected features" icon, it deletes two rows and not just the selected row. Do you get the same results?

@qgib
Copy link
Contributor Author

qgib commented Jan 27, 2018

Author Name: Alessandro Pasotti (@elpaso)


No, I can't reproduce the delete issue, but please, file a separate ticket for separate problems.

@qgib
Copy link
Contributor Author

qgib commented Jan 27, 2018

Author Name: Alessandro Pasotti (@elpaso)


PR (for NULL issues) #6185


  • pull_request_patch_supplied was changed from 0 to 1

@qgib
Copy link
Contributor Author

qgib commented Jan 29, 2018

Author Name: Anónimo (Anónimo)


Applied in changeset ab607ce.


  • done_ratio was changed from 0 to 100
  • status_id was changed from In Progress to Closed

@qgib
Copy link
Contributor Author

qgib commented Jan 30, 2018

Author Name: Calvin Hamilton (Calvin Hamilton)


I just tested this today and it is not quite fixed although the behavior has changed. There are two issues that I see:

  1. This is the lesser problem. Right mouse click on the test layer and select "Open Attribute Table". In the window click on the "Toggle editing mode" icon then click it again. Because nothing was changed it shouldn't do anything, but it pops up the windows asking if you want to save it. It shouldn't do that. Interestingly, if you click on the Discard button and the keep clicking on the "Toggle editing mode" button you won't see the dialog box again.

  2. For this test make sure you have closed the attribute table and then reopen it. Click on the "Toggle editing mode" icon just once. Now select the "Add Point Feature" icon and click on the map to add a feature. For 'label' I just called it test and left 'latitude' and 'longitude' as NULL. What it does is garbles the data in the first row and the new data is added to line 6 with 'Autogenerate' as the fid. See the attached image. Compare this with the attribute_table_before.jpg image attached with the initial bug report.


  • 12066 was configured as bad_data.jpg
  • status_id was changed from Closed to Reopened

@qgib
Copy link
Contributor Author

qgib commented Jan 30, 2018

Author Name: Calvin Hamilton (Calvin Hamilton)


Note the example image for problem #2 is bad_data.jpg.

@qgib
Copy link
Contributor Author

qgib commented Jan 30, 2018

Author Name: Alessandro Pasotti (@elpaso)


Yes, I've only fixed one of the series of bugs that you are reporting, which is the NULL issue on negative values (I think you called it "garble").
I've also done another PR for setting the precision on double fields, but that is a separate (but related) issue.
With your last comment you are probably reporting yet another issue.
I'd really prefer to see them in different tickets, or it gets much more difficult to track what has been fixed and what has not and refering to a ticket in the commit will just close it (like it happened when I fixed the NULL issue).
Besides: what exactly do you mean with "garble"? Can you try to be more precise?
There is yet another related PR in the queue that might help with the "dirty" state of the layer: #6191

@qgib
Copy link
Contributor Author

qgib commented Jan 30, 2018

Author Name: Calvin Hamilton (Calvin Hamilton)


I will open another ticket for the issue #2 and will try to be more precise.

Thanks for all your work on this.

@qgib
Copy link
Contributor Author

qgib commented Jan 30, 2018

Author Name: Calvin Hamilton (Calvin Hamilton)


Here is the new ticket #25903

@qgib
Copy link
Contributor Author

qgib commented Jan 31, 2018

Author Name: Anónimo (Anónimo)


Applied in changeset c50e1bf.


  • status_id was changed from Reopened to Closed

@qgib qgib closed this as completed Jan 31, 2018
@qgib
Copy link
Contributor Author

qgib commented Jan 31, 2018

Author Name: Alessandro Pasotti (@elpaso)


@qgib
Copy link
Contributor Author

qgib commented Feb 1, 2018

Author Name: Alessandro Pasotti (@elpaso)


Please test the latest commits, all tests should be done with a new project because the default widgets for fields have changed.


  • resolution was changed from to fixed/implemented

@qgib
Copy link
Contributor Author

qgib commented Feb 2, 2018

Author Name: Calvin Hamilton (Calvin Hamilton)


That seems to have resolved the issue.

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! Crash/Data Corruption High Priority
Projects
None yet
Development

No branches or pull requests

1 participant