Bug report #21281
Bug with multiple Else items in rule-based style
|Affected QGIS version:||3.5(master)||Regression?:||Yes|
|Operating System:||Any||Easy fix?:||No|
|Pull Request or Patch supplied:||Yes||Resolution:||fixed/implemented|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||29099|
Attached is a polygon shapefile plus three rule-based .qml stylesheet files, as follows:
And, the rule-based stylesheets:
- Two sets of scale range rules with Else.qml
- One set of scale range rules with Else.qml
- Two sets of scale range rules with IS NULL OR IN expression.qml
In QGIS 2.18, all three styles behave correctly. You can identify and select all the features, and snap to and edit the vertices.
In QGIS 3.4, Style 1 (Two sets of scale range rules with Else.qml) reveals a bug, whereby for those features covered by the Else part of the rule expression, although you can edit their boundaries with the some of the digitising tools, you cannot do the following:
- Identify them with the Identify Features tool
- Select them with the Select Features tool
- Snap to their vertices or segments with digitizing tools
- Edit their vertices with the Vertex tool
This problem does not occur for the same features when either of the other two stylesheets (numbered 2 and 3 above) are applied. Therefore, I conclude that the problem is occurring only for features covered by the 'Else' part of a rule-based expression and only when the 'Else' item is present more than once in the list of rules. The problem is a regression in QGIS 3.4, because it does not occur in QGIS 2.18.
The repeating of the same items in the rule list allows us to control the width of borders for different scale ranges.
The same problem occurs for these features and styles in a geopackage, so it is not specific to shapefiles.
I have tested the issue only for polygons, so not sure if it would be the same for lines or points.
I selected "Symbology" for the category, although it also affects other categories. Perhaps it should be category "Expressions"?
#3 Updated by Alessandro Pasotti over 2 years ago
- Pull Request or Patch supplied changed from No to Yes
- Operating System changed from Windows 10 to Any
- Priority changed from Normal to High
- Status changed from Open to In Progress
- Affected QGIS version changed from 3.4.4 to 3.5(master)
- Resolution set to fixed/implemented