Bug report #17245

"orig_ogc_fid" field is added to filtered shapefiles in QGIS master

Added by Patrick Dunford over 6 years ago. Updated about 5 years ago.

Status:Feedback
Priority:Normal
Assignee:-
Category:Vectors
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 #:25143

Description

new description:
when filtering a shapefile in QGIS master a new field "orig_ogc_fid" is "added" to the table. This goes away when the filter is removed.

old description:
Could not commit changes to layer cwnmVariableYards

Errors: ERROR: 1 feature(s) not added.

Provider errors:
OGR error creating feature -2:

also when adding the new feature an extra field is displayed on the form which is called orig_ogc_fid, I don't know what this field is used for or why it is displayed.

17245.7z (9.59 KB) Patrick Dunford, 2017-10-05 04:47 AM


Related issues

Related to QGIS Application - Bug report #17124: Editing behavior of filtered layers is inconsistent Open 2017-09-12

History

#1 Updated by Giovanni Manghi over 6 years ago

  • Status changed from Open to Feedback

Can you attach sample data? thanks.

#2 Updated by Patrick Dunford over 6 years ago

Steps to reproduce:

  1. Apply a filter to the layer: "year" = 1969
  2. Put the table into edit mode
  3. Add a new feature
  4. Right click and in the data form enter 1 in the type field then click OK
  5. Before you close the form you can see the extra field at the bottom
  6. Try to post the layer and you get the error.

#3 Updated by Giovanni Manghi over 6 years ago

  • Category changed from Digitising to Vectors
  • Description updated (diff)
  • Subject changed from Cannot commit changes to layer when adding path with new digitiser to "orig_ogc_fid" field is added to filtered shapefiles in QGIS master
  • Status changed from Feedback to Open
  • Operating System deleted (Xubuntu 17.10)

The fact that certain datasources (like shapefiles) are not editable when filtered is known. The behavior become less clear and inconsistent as described in #17124

I still think that filtered shapefiles are not editable and when a filter is set they still remain, but it's a bug. In fact is you save the project and reopen it the vector is not editable anymore.

What you observe is another issue (or maybe part of the above), it does not seems clear why that field should appear in filtered shapefiles (does not happen with PostGIS for example).

#4 Updated by Patrick Dunford over 6 years ago

The problem is only occurring with masters after 313ec55 which has no difficulty in adding to shapefiles while filtered.

#5 Updated by Giovanni Manghi over 6 years ago

Patrick Dunford wrote:

The problem is only occurring with masters after 313ec55 which has no difficulty in adding to shapefiles while filtered.

if editing of filtered shapes is now possible, then it must be so also after saving and reopening a project #17124
if editing of filtered shapes should not be possible (as it was in the past), then again #17124 because after applying the filter the shape should not be editable.

#6 Updated by Patrick Dunford over 6 years ago

That bug that means you have to muck around and close/reopen a project has been in Qgis since the beginning of time, however the one putting this extra field in and refusing to save new features has appeared in fairly recent editions of master.

#7 Updated by Giovanni Manghi over 6 years ago

Patrick Dunford wrote:

That bug that means you have to muck around and close/reopen a project has been in Qgis since the beginning of time

no, I can't remember when it changed but adding a filter to a shapefile rendered it not editable until not long ago (and I believe that this could be still the correct behavior).

#8 Updated by Patrick Dunford over 6 years ago

It is actually possible to filter a shapefile and then edit it, this is something I use from time to time.

#9 Updated by Giovanni Manghi over 6 years ago

Patrick Dunford wrote:

It is actually possible to filter a shapefile and then edit it, this is something I use from time to time.

if you save the project, close qgis, and then reopen qgis and the project the shapefile is not editable anymore, and this is what #17124 is about. One way or the other the situation must be untangled, and this issue you reported it could be very well (or not) a completely different thing.

#10 Updated by Jürgen Fischer over 6 years ago

  • Related to Bug report #17124: Editing behavior of filtered layers is inconsistent added

#11 Updated by Giovanni Manghi about 5 years ago

  • Status changed from Open to Feedback

Please check if this issue is still valid on QGIS 3.4.5 or 3.6.

Also available in: Atom PDF