Bug report #6735
Changes in table attribute causes "Invalid Field Index" error when trying to save
|Affected QGIS version:||1.8.0||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||fixed|
|Crashes QGIS or corrupts data:||Yes||Copied to github as #:||15899|
I'm using, QGIS 1.8 6416f38, in a Windows Vista 32bit Machine. Changes in table attribute causes "Invalid Field Index" error when trying to save.
The error occurs doing the following steps:
- Open editing;
- Create new field; # Ups... not the field type I wanted
- DO NOT SAVE;
- Erase the same field;
- Save edition.
QGIS is enable to save the changes trowing the following error:
Could not commit changes to layer teste2 Errors: ERROR: 1 attribute(s) not deleted. SUCCESS: 1 attribute(s) added. SUCCESS: 1 attribute value(s) changed. Provider errors: OGR error deleting field 1: Invalid field index
The error only occurs when deleting a recent created fields.
After that, the shapefile index seems to be messed up and data edited in new fields may keep throwing errors, or even be lost.
I haven't tried in a Linux machine.
WORKAROUND: Always save editing immediately after creating a new field.