Bug report #18583

Widget "Range": Representation for NULL value is NOT always displayed correctly

Added by Manuel K over 2 years ago. Updated almost 2 years ago.

Status:Closed
Priority:Normal
Assignee:Alessandro Pasotti
Category:Forms
Affected QGIS version:master Regression?:No
Operating System:Windows Easy fix?:No
Pull Request or Patch supplied:Yes Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:26471

Description

Attribute of type integer;
DB: PostGIS
Allow NULL is checked; Editable
Minimum value: 2018; Maximum value: 2099; Step: 1

Problem:
In the form a NULL value is wrongly displayed as (Minimum value)-1 (i.e 2017) if "Representation for NULL values" in options was left empty (my preferred Setting). However, the value in the database is correct (NULL).

range_widget_display.jpg (7.2 KB) Manuel K, 2018-09-17 03:02 PM

range_widget_config.jpg (39.9 KB) Manuel K, 2018-09-17 03:02 PM

representation_for_NULL_values_empty.jpg (4.47 KB) Manuel K, 2018-09-17 03:04 PM

Associated revisions

Revision f3682be9
Added by Matthias Kuhn about 2 years ago

Handle invalid step size

in range widgets in combination with NULL values.

Fix #18583 https://issues.qgis.org/issues/18583

Revision 528aee07
Added by Matthias Kuhn about 2 years ago

Handle invalid step size

in range widgets in combination with NULL values.

Fix #18583 https://issues.qgis.org/issues/18583

Revision d179635b
Added by Alessandro Pasotti almost 2 years ago

[bugfix] Allow empty null representation in spinboxes

Fixes #18583 - Widget "Range": Representation for NULL value is NOT always displayed correctly

History

#1 Updated by Anonymous about 2 years ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

#2 Updated by Manuel K almost 2 years ago

The described bug persists (master 3.3.0-71 and nightly 3.2.3-1).
And not only for attributes of type integer, but also for attributes of type numeric.

Example (type numeric):

Range widget configuration: Minimum: 0.00; Maximum: 399.90; Step: 0.10; Precision: 1; Allow NULL is checked.
--> In the form the NULL value is displayed as -0.1 (what corresponds to "[Minimum]-10^-[Precision]") instead of an empty field.

#3 Updated by Alessandro Pasotti almost 2 years ago

  • Assignee set to Alessandro Pasotti

#4 Updated by Alessandro Pasotti almost 2 years ago

  • Status changed from Reopened to In Progress
  • Pull Request or Patch supplied changed from No to Yes

#5 Updated by Anonymous almost 2 years ago

  • Status changed from In Progress to Closed

Also available in: Atom PDF