Information gets deleted from map
I ran into a bug today. I entered information into the external reference field but forgot to set a precision. After trying to save the data (which of course did not work), all the information I drew into the map was deleted. The same happens when I enter invalid data into the date fields.
Updated by Alexander Watzinger 22 days ago
We would need to validate the form before submission so that if the identifier field of a reference system (e.g. Wikidata) isn't empty, the precision has to be set too. It might be tricky because these fields are generating dynamically but I hope you (Andi) can figure something out.
There is already some general validation code in: openatlas/static/js/forms.js
Place were reference systems are added to forms: openatlas/util/util.py -> add_reference_systems_to_form()
Example form: https://demo.openatlas.eu/insert/place
As always, in case of questions we can take a look at it together.
Updated by Andreas Olschnögger 18 days ago
- Status changed from Assigned to Resolved
Now the input fields for the precisions are validated before submission. It is only checked weather it is empty or not.
Other more complex validation like correct dates or correct id format are still done after submission.
Changes are on develop
Updated by Alexander Watzinger 18 days ago
- Status changed from Resolved to Closed
I tested it and seems to work great.
I also created a new issue (#1736) for the underlying problem and put a related link to this issue and, as already mentioned, will take a look at it myself.