Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Value relation, value 0 = NULL #27803

Closed
qgib opened this issue Sep 30, 2018 · 5 comments
Closed

Value relation, value 0 = NULL #27803

qgib opened this issue Sep 30, 2018 · 5 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Forms

Comments

@qgib
Copy link
Contributor

qgib commented Sep 30, 2018

Author Name: Casper Bertelsen (Casper Bertelsen)
Original Redmine Issue: 19981
Affected QGIS version: 3.2.3
Redmine category:edit_widget
Assignee: Alessandro Pasotti


I have a value of 0 in a column of data type integer.

The column is set to widget type "Value relation", relating to a table having descriptions for each possible value. However if I tick Allow NULL value, existing objects having value 0 are shown as (No selection) instead of the proper value from the drop down relating to value 0.

Relating to the issue, testing it further:

  • When the form shows after digitizing the Value relation widget is completely blank by default when Allow NULL value is on. However sometimes it is set to (No selection) by default I haven't been able to find out when it does that and when it doesn't. - But couldn't this be case either way that the default value in the drop down is (No selection) when no other default value has been set?

  • When default value is set to 0, the default value is (No selection) instead of the value 0 from the drop-down.


@qgib
Copy link
Contributor Author

qgib commented Sep 30, 2018

Author Name: Alessandro Pasotti (@elpaso)


It would be great if you could attach a minimal project to reproduce the issue.

@qgib
Copy link
Contributor Author

qgib commented Sep 30, 2018

Author Name: Giovanni Manghi (@gioman)


  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Oct 1, 2018

Author Name: Casper Bertelsen (Casper Bertelsen)


Sure, i have exported two tables into a geopackage (originally from postgres). One polygon layer as well as a layer without geometry (look up). In the project I have linked to the polygon layer twice, so it’s easy to see the actual value as well as how it results using value relation.

As you can see the existing polygon is set to no selection even though it has the value 0, represented in the look up-table. If you digitize a new polygon, I have set the relation to default to zero however this results in no selection by default.


  • 13396 was configured as zero_null.zip

@qgib
Copy link
Contributor Author

qgib commented Oct 1, 2018

Author Name: Alessandro Pasotti (@elpaso)


Thanks for the report and the test project, I'll have a look ASAP!


  • assigned_to_id was configured as Alessandro Pasotti

@qgib
Copy link
Contributor Author

qgib commented Oct 1, 2018

Author Name: Anónimo (Anónimo)


Applied in changeset 6574e69.


  • done_ratio was changed from 0 to 100
  • status_id was changed from Feedback to Closed

@qgib qgib closed this as completed Oct 1, 2018
@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Forms labels May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Forms
Projects
None yet
Development

No branches or pull requests

1 participant