Bug report #17507

Unable to edit filtered GeoPackage layer

Added by Peteris Bruns about 7 years ago. Updated almost 7 years ago.

Status:Closed
Priority:High
Assignee:Alessandro Pasotti
Category:Data Provider
Affected QGIS version:2.18.14 Regression?:Yes
Operating System:Ubuntu Linux Easy fix?:No
Pull Request or Patch supplied:Yes Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:25404

Description

CASE 1
  1. open existing geopackage layer
  2. swich layer in edit mode
  3. add new features
  4. commit changes
  5. exit from edit mode
  6. apply filter
  7. swich layer in edit mode
  8. add new features
  9. commit changes - ERROR "Could not commit changes to layer"
  10. cancel changes, save project and exit QGIS without filter removal
CASE 2
  1. reopen in previous CASE saved QGIS project
  2. geopackage layer is readonly, impossible to swich in edit mode
  3. remove applied filter
  4. layer continues to be read only
  5. save project and exit QGIS
  6. reopen project and layers is editable
  • is there any reason why filtered geopackage layers is not editable?
  • attached qgis project file with geopackage layer (applied filter) used in CASE description.

buhtest.gpkg (12 KB) Peteris Bruns, 2017-11-21 11:48 AM

mytest.qgs (20.4 KB) Peteris Bruns, 2017-11-21 11:48 AM

lu_test.prj (445 Bytes) Christian Roettger, 2018-01-04 02:31 PM

lu_test.dbf (464 KB) Christian Roettger, 2018-01-04 02:31 PM

lu_test.shx (28.4 KB) Christian Roettger, 2018-01-04 02:31 PM

lux_test.qgs (9.48 KB) Christian Roettger, 2018-01-04 02:31 PM

lu_test.shp (1.89 MB) Christian Roettger, 2018-01-04 02:31 PM


Related issues

Related to QGIS Application - Bug report #17511: adding two instances of the same gpkg layer and editing o... Closed 2017-11-21

Associated revisions

Revision d775a0d9
Added by Alessandro Pasotti almost 7 years ago

[app][bugfix] Update layer editable state when filter is changed

Fixes #17507

Revision 0577b2e6
Added by Alessandro Pasotti almost 7 years ago

[bugfix] Update layer editable state when filter is changed

Fixes #17507 Unable to edit filtered GeoPackage layer

Backported from master https://github.com/qgis/QGIS/pull/5691

History

#1 Updated by Giovanni Manghi about 7 years ago

master is also affected. I'm tagging this as a regression, at least the part that removing the filter does not make the layer editable is certainly a regression.

#2 Updated by Giovanni Manghi about 7 years ago

  • Priority changed from Normal to High
  • Regression? changed from No to Yes

#3 Updated by Alessandro Pasotti about 7 years ago

  • Assignee set to Alessandro Pasotti

#4 Updated by Alessandro Pasotti about 7 years ago

  • Crashes QGIS or corrupts data changed from No to Yes

It actually crashes QGIS master/latest when removing the filter ...

#5 Updated by Alessandro Pasotti about 7 years ago

I filed another ticket for the crash (probably unrelated) #17511

#6 Updated by Alessandro Pasotti about 7 years ago

  • Related to Bug report #17511: adding two instances of the same gpkg layer and editing on one of them crashes qgis added

#7 Updated by Peteris Bruns about 7 years ago

Alessandro Pasotti wrote:

It actually crashes QGIS master/latest when removing the filter ...

2.18.14 works without crash, just annoying nature and takes time to undestand why the layer is readonly/how to make it writable again.

#8 Updated by Alessandro Pasotti almost 7 years ago

  • Crashes QGIS or corrupts data changed from Yes to No
  • Pull Request or Patch supplied changed from No to Yes
  • Status changed from Open to In Progress

#9 Updated by Anonymous almost 7 years ago

  • % Done changed from 0 to 100
  • Status changed from In Progress to Closed

#10 Updated by Alessandro Pasotti almost 7 years ago

Backporting will follow ....

#11 Updated by Christian Roettger almost 7 years ago

Directed from the mailing list to this ticket:
I think the bug (or nearly the same) isn't fixed. Attached the shape file and project.
USE CASE:
1. filter shape file
2. save as project
3. reopen => no editing possible
4. remove filter, still no editing possible
5. reopen project => editing possible

Tested on Windows with 2.18.14 and 2.18.15 where it is even worse. In .15 you can't edit a shapefile anymore while a filter is active (CASE 1.). This was possible in .14 :(

#12 Updated by Alessandro Pasotti almost 7 years ago

  • Resolution set to fixed/implemented

I had a look to the code and this is actually a different bug from the one I fixed for GPKG (that it's still fixed and working correctly).

Would you be so kind to open a separate ticket and assign it to me? (no need to re-attach the files, just please link to this ticket).

Thanks

Also available in: Atom PDF