Bug report #8977

rulebased styling with a dash in the field name

Added by Harm Olthof about 11 years ago. Updated over 10 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Symbology
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

Description

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 (-)

History

#1 Updated by Nathan Woodrow about 11 years ago

  • Assignee set to Nathan Woodrow

Strange. I'll take a look.

#2 Updated by Giovanni Manghi over 10 years ago

  • Priority changed from High to Normal

There is no crash or data corruption, so I'm lowering the priority.

#3 Updated by Harm Olthof over 10 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.

#4 Updated by Giovanni Manghi over 10 years ago

  • Priority changed from Normal to High

#5 Updated by Martin Dobias over 10 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.

My testcase:
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)

#6 Updated by Jürgen Fischer over 10 years ago

  • Assignee deleted (Nathan Woodrow)

fixed with f3b26494

Also available in: Atom PDF