Bug report #11196

Filtered layers editing misbehaving

Added by Paolo Cavallini about 9 years ago. Updated almost 9 years ago.

Affected QGIS version:2.4.0 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:duplicate
Crashes QGIS or corrupts data:No Copied to github as #:19507


From Juergen:

Filtered shape file layers are not editable. But there's currently no way for a OGR provider to propagate that some changes (eg. setting of a filter) changes the layer's capabilities (ie. disables editing capabities). Because of that the GUI doesn't reflect it and the "pencil" is not grayed out, although it should. So although you shouldn't be able to, you still can try. But that fails and QGIS disables the pencil. So you can't retry again.

But resetting the filter doesn't change that and that could be considered a bug, somewhat like making the files readonly while QGIS still thinks they are writable. That would go unnoticed too.

And there's a simple workaround, you can simply activate a different layer and go back. QGIS will ask the provider again for the layer's capabilities and switch the buttons accordingly. That also goes for the pencil - if the layer
goes readonly by setting a filter, you switch to a different layer and back it'll turn grey.

Related issues

Duplicates QGIS Application - Bug report #11189: No shp edit mode when query used? Closed 2014-09-11


#1 Updated by Jürgen Fischer almost 9 years ago

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

Also available in: Atom PDF