Bug report #13086

Attribute Table not updated after using changeAttributeValue

Added by Luca Congedo about 5 years ago. Updated about 5 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:-
Affected QGIS version:2.10.0 Regression?:No
Operating System:Windows Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:21153

Description

Hello,

in QGIS 2.10 after editing a shapefile with changeAttributeValue the Attribute Table is not updated (but the shapefile is edited) until the shapefile is opened again. In QGIS 2.8 it works as expected.

For testing, load the attached shapefile (but I guess any shapefile is affected) and select the shapefile in the Layers.
In the Python console run the following:

aLayer = qgis.utils.iface.activeLayer()
field = aLayer.fieldNameIndex("C_info")
f = QgsFeature()
for f in aLayer.getFeatures():
    ID = f.id()

aLayer.startEditing()
aLayer.changeAttributeValue(ID, field, "test")
aLayer.commitChanges()

Regards

shp.zip (1.77 KB) Luca Congedo, 2015-07-06 02:53 PM

History

#1 Updated by Nyall Dawson about 5 years ago

  • Resolution set to fixed/implemented
  • Status changed from Open to Closed

Already fixed in master and backported to 2.10

#2 Updated by Luca Congedo about 5 years ago

Thank you very much

Also available in: Atom PDF