Bug report #17442
Categorized style issue using numeric fields with NULL values
|Affected QGIS version:||2.18.14||Regression?:||Yes|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||Yes||Resolution:||fixed/implemented|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||25339|
When a vector layer is classified using the categorized style on numeric fields with NULL values, unchecking the blank/NULL class (using shapefiles) or the "0" class (using other data formats) makes also the features of the other classes invisible.
Steps to replicate the issue:
- create a shapefile layer with a numeric (integer or real) field named A
- start editing
- add three features: the first with A=1, the second with A=2 and the third with A=NULL (no value)
- save and stop editing
- open the Vector Properties Dialog - Style tab (don't use the Layer Styling Dock)
- classify the layer using the categorized style on the field A: the classes "0", "1", "2" and "blank" are automatically created
- uncheck or remove the class "blank": all the features of the layer disappear
- uncheck or remove the class "0": the other checkboxes return to work properly
Using PostGIS, SpatiaLite or GeoPackage layers the behavior is slightly different. The "blank" checkbox works properly but unchecking the class "0" the features of the classes "1" and "2" disappear.
The issue doesn't occur:
- using the Layer Styling Dock
- saving and reopening the project with the style already set
The issue is OS independent and also occurs in QGIS 2.14.20 and QGIS 2.18.14.
[bugfix] Categorized style issue using numeric fields with NULL values