mobile icon indicating copy to clipboard operation
mobile copied to clipboard

Incorrectly configured date/time field blocks saving of form

Open saberraz opened this issue 3 years ago • 1 comments

I have a project with some constraints. I fill the form to satisfy the constraints but still the app does not allow me to save the feature: https://app.merginmaps.com/projects/saber/null_issue

saberraz avatar Jul 27 '22 09:07 saberraz

A quick analysis of the problem:

  • the offending field is last_modified in wcc_weed_control layer
  • the field config is not correctly configured, as even QGIS just sets NULL to last_modified instead of using correct date/time when adding a new feature. I think the default value should be just now() instead of format_date(now(), 'dd-MM-yyyy hh:mm:ss')
  • there is an error in Input - the logic for evaluation of constraints is apparently wrong, because there's no constraint, yet it does not allow adding the feature -- we should fix that (it is due to QgsField::convertCompatible() not accepting the passed value)

It is also not very clear how to configure date/time stuff correctly - it https://merginmaps.com/docs/layer/settingup_forms/#date-and-time - we should somehow make it easier to understand (with some examples of correct use)

wonder-sk avatar Jul 27 '22 14:07 wonder-sk