Value Map Widget NULL value breaks for text field shorter than 38 characters #59368
Open
2 tasks done
Labels
Bug
Either a bug report, or a bug fix. Let's hope for the latter!
Forms
Regression
Something which used to work, but doesn't anymore
Widgets
What is the bug or the crash?
For some reason, the NULL value is not retained correctly (see steps for more details).

What's odd is that this is not consistent. Some attributes don't have this issue, others do.
My data is stored in a PostGIS table, where the field is allowed to be NULL (I checked).
When running a
SELECT DISTINCT
the resulting values are correct (with NULL showing as NULL, and not what garbage QGIS is showing).However, QGIS is insisting that the value is that uuid string as shown here when the value map widget is setup (it should be NULL):

Steps to reproduce the issue
Versions
Supported QGIS version
New profile
Additional context
At first, I thought it displayed the first value of the Display field for the layer (like how the expression editor shows for the feature preview). However, when I change the display field, this garbage value does not change when deleting and re-adding the NULL option.
The text was updated successfully, but these errors were encountered: