Skip to content

In fields with value map widgets, NULL is accepted as valid even if the constraint "not null" is enabled. Works as expected on QGIS Desktop. #4497

@gioman

Description

@gioman

Description

Take a field with a value map. The value map has also an entry for the NULL value (added by clicking "add NULL value")

Image

then also enable the "not null" constraint

Image

In QGIS Desktop all works as expected, if a value from the list is first selected (manually or using a default value), then the user chooses the NULL entry, the constraint does is job:

Image

On MM App the NULL entry from the list is accepted as a valid value:

Image

If the "NULL" entry from the value map is the default value then the constraint works also in MM App (but not if the user changes to another entry then goes back to "NULL").

Not even evaluating "NULL" as text in a custom expression (rather than using the normal "not null" constraint) helps workaround this problem.

Application (+ app version, build, operating system)

2026.2.0

Metadata

Metadata

Assignees

Labels

formsrelated to attribute forms

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions