Bug report #6735

Changes in table attribute causes "Invalid Field Index" error when trying to save

Added by Alexandre Neto about 12 years ago. Updated over 11 years ago.

Status:Closed
Priority:High
Assignee:-
Category:-
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

Description

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.

History

#1 Updated by Alexandre Neto about 12 years ago

I have tried in Xubuntu (OSGEO Live 6) and the same issue occurs.

#2 Updated by Giovanni Manghi about 12 years ago

Alexandre Neto wrote:

I have tried in Xubuntu (OSGEO Live 6) and the same issue occurs.

Hi Alexandre, does this happen also on master or 1.7.4 (looking for a possible fix/regression)?

#3 Updated by Andre Joost about 12 years ago

Giovanni Manghi wrote:

Hi Alexandre, does this happen also on master or 1.7.4 (looking for a possible fix/regression)?

I'm not Alexandre, but can confirm the bug for master on Windows XP.
The table manager plugin does the operation without throwing errors.

#4 Updated by Alexandre Neto about 12 years ago

I had the chance to try in a 1.7.0 Installation. The problem was not replicable, as in 1.7 was not possible to delete attributes in the attribute table window.

#5 Updated by Giovanni Manghi almost 12 years ago

  • Priority changed from Normal to High

#6 Updated by Giovanni Manghi over 11 years ago

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

seems fixed on master, reopen if necessary.

Also available in: Atom PDF