Bug report #10151

expression-based label regression, wrongly displaying NULL instead of nothing

Added by Mathieu Pellerin - nIRV almost 10 years ago. Updated almost 10 years ago.

Status:Closed
Priority:Severe/Regression
Assignee:Jürgen Fischer
Category:Expressions
Affected QGIS version:2.2.0 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:18608

Description

In the recent weeks, a regression has made its way to QGIS master resulting in expression-based labels labelling features with NULL when it should simply not show any label. It's a pretty significant issue.

For example, if your opening an OpenStreetMap roads dataset and only want to show labels for primary roads, the following expression was working just fine under QGIS 2.2: CASE WHEN ("highway" = 'primary') THEN "name" END

Under QGIS 2.3, applying the above expression will have all of the non-primary roads labelled NULL.

See attached project.

label_regression.zip (4.49 KB) Mathieu Pellerin - nIRV, 2014-05-01 08:49 PM


Related issues

Related to QGIS Application - Bug report #9998: Error Null values in PostGIS Closed 2014-04-03

Associated revisions

Revision 3d916633
Added by Jürgen Fischer almost 10 years ago

labeling: 'show' empty string instead of configured representation for NULL (party reverts e497a5c; refs #9998; fixes #10151)

History

#1 Updated by Nathan Woodrow almost 10 years ago

  • Assignee changed from Nathan Woodrow to Jürgen Fischer

Yes this was changed by Jurgen but I do agree it's the wrong behavior. NULL should only be shown in attribute table, and controls like that.

#2 Updated by Mathieu Pellerin - nIRV almost 10 years ago

It's definitively not desirable for labels to show NULL in a negative conditional expression; beyond the fact that the needed behavior is for no labels to show, it's also misleading the users into thinking the column's value is NULL (i.e. a positive conditional expression who's resulting field is NULL).

#3 Updated by Jürgen Fischer almost 10 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF