Bug report #8977
rulebased styling with a dash in the field name
|Affected QGIS version:||2.0.1||Regression?:||No|
|Operating System:||windows||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||fixed/implemented|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||17638|
I have loaded an sld, containing the following filter:
plus_type = 'boom'
This is loaded without complains, however the count yields 0 objects.
The filter does work if I change the filter to:
"plus_type" = 'boom'
when I save to sld or qml, the quoting is not saved. This means that each time the style is loaded all filters have to be manually adjusted as described. The same behaviour is observed when using a underscore (_) instead of a dash (-)
#3 Updated by Harm Olthof almost 6 years ago
- Target version set to Version 2.2
Giovanni Manghi wrote:
There is no crash or data corruption, so I'm lowering the priority.
There is (configuration)data corruption, since user settings are not preserved.
Actually the only workaround was to rename all attrributes (tens of attributes and tables) and edit all sld files conformally. So I had to make a local version a data model in order to workaround a bug.
This is a huge impact for a bug which probably is solved very easy. Please change priority back to high.
#5 Updated by Martin Dobias almost 6 years ago
- Status changed from Open to Closed
- Resolution set to fixed/implemented
I can replicate the issue in 2.0.1 with a field name with a dash ("a-b") but not with underscore ("a_b"). In QGIS master even the field with dash is properly quoted -> closing the ticket.
1. get SLD from http://docs.geoserver.org/stable/en/user/_downloads/point_attribute.sld (it uses "pop" field)
2. create a point shapefile with few points and fields: pop, p_p, p-p with reasonable values (20000, 60000, etc)
3. try to import that SLD file as a style for the layer -> everything works (i.e. layer is displayed correctly)
4. update SLD to contain use p_p instead of pop - then load SLD file -> everything works (p_p is not quoted - it does not need to be)
5. update SLD to contain p-p instead of pop - then load SLD file -> everything works (p-p is quoted - because it has to be)