mobile
mobile copied to clipboard
Value must be a number constraint error in autogenerated fid field
When I create feature or add to table with no geometry and have fid field in form with autogenerated value visible as "Autogenerate" in form input I get "Value must be a number" constraint error and can't save form. When I delete fid field from form I can save new feature as usual. Before 1.0.2 update it worked.
Just checked my other projects and found next thing. If fid field has an alias then constraint appers but if field has no alias for fid field everything works fine. Language of Alias doesn't matter checked with latin and cyrillyc symbols.
Sorry for screenshots but I can't share projects
Got exactly the same issue this morning with two enumerators who were not able to submit forms while doing data collection on the ground. Our form was working fine on both on iOS and Android with v1.0.1, but as soon as the app was updated to 1.0.2 the form became locked (Save was red). Since Fid was configured as Hidden in my form, it took me a while to find out the root cause. I first started by dropping all constraints on all the visible form fields, but in the end only fid was left so I just removed it from the form in QGIS and voilà ....
Let's add it to the sprint and fix the issue for the next release.
Many thanks for the detail bug report and the work-around.
Hi. I'm having what I assume is something similar. We have bigserials in Postgres database which transform to integer64 in geopackage after mergin-db-sync. In QGIS everythings works fine, I add a new feature, QGIS displays "autogenerate" in the id field at first, but after saving an integer is generated.
In Input I see a string value of "Autogenerate" which naturally conflicts with an Integer pk field.
At first try hiding primary key field doesn't help. All of the constraints are met, but I'm still prompted to "check all required fields".
To continue on my previous comment. My issue was related to primary keys being named "id" instead of "fid". So most probably a separate issue after all. I'll open a separate ticket.
Hi @Koivusto, thanks for reaching out. It seems like the same issue as others are having so there is no need to create additional ticket.
Currently, fid column must be called fid
otherwise Input will try to validate its value and since autogenerate
is a text and fid should be a number, it yells that the number is not valid. It does not matter if the field is visible or not.
Problem occurs on v1.4.0 when the autogenerated fid field has an alias. Galaxy Tab A SM-T295, Android 10