Bug report #11196
Filtered layers editing misbehaving
|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|
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.