Bug report #7071
Field calculator regression - does not update all features
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||16155|
Hi,In master revision (94491b8), there is a bug with field calculator:
- select many features
- update existing field in field calculator dialog
Only the first feature selected is updated. Same behavior with shape file or spatialite file.
#4 Updated by Mathieu Pellerin - nIRV over 6 years ago
- File randompoints.shapefile.zip added
Simple steps to reproduce issue:
1. load the attached shapefile (inside randompoints.shapefile.zip)
2. open the attribute table
3. switch on the edit mode
4. open the field calculator
5. check "update existing field" (if "update selected features" is checked, un-check it)
6. enter integer 1 in the expression text box
7. click on ok
Only 48 of the 100 points ID attribute are modified to 1, the rest are not.
#5 Updated by Larry Shaffer over 6 years ago
Just ran into this today. This is a significant regression.
When trying to update a simple integer field with 946 selected rows out of 1360, and trying multiple times, 95, 1, 288 and 946 (at least all) were updated respectively.
Testing an update to all rows multiple times with different integer values resulted in 397, 1, 601, 125 changed rows respectively, out of 1360 rows.
So, it's also rather random as to how many rows get updated, regardless of whether any are selected or whether only updating selected rows.
#6 Updated by Jürgen Fischer over 6 years ago
The problem is that changeAttributeValue ignores the
emitSignal parameter and therefore triggers the attribute table, which retrieves the updated features, which in turn causes newly allocated feature iterators to close and replace the providers (one and only)
mActiveIterator, which stops the update in the field calculators update loop.