Bug #1723


Information gets deleted from map

Added by Nina Richards about 2 years ago. Updated almost 2 years ago.

Target version:
Start date:
Estimated time:
Found in version:


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.

Related issues 1 (0 open1 closed)

Related to OpenAtlas - Feature #1736: Keep form map data after failed backend validationClosedAndreas Olschnögger2022-06-08Actions
Actions #1

Updated by Alexander Watzinger about 2 years ago

  • Category set to Maps
  • Status changed from New to Assigned
  • Assignee set to Andreas Olschnögger
  • Target version set to 7.4.0

Can confirm

Actions #2

Updated by Alexander Watzinger almost 2 years 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.

Although this won't solve the underlying issue (losing form data if backend validation fails, we would have to look into this at some point too) it would be great if JavaScript validation for reference systems could be solved before the next release to at least remedy that point of failure, which probably happens quite often.

There is already some general validation code in: openatlas/static/js/forms.js
Place were reference systems are added to forms: openatlas/util/ -> add_reference_systems_to_form()
Example form:

As always, in case of questions we can take a look at it together.

Actions #3

Updated by Alexander Watzinger almost 2 years ago

  • Related to Feature #1736: Keep form map data after failed backend validation added
Actions #4

Updated by Andreas Olschnögger almost 2 years 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

Actions #5

Updated by Alexander Watzinger almost 2 years 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.
Thanks a lot Nina for reporting and Andi for adding the JavaScript validation.


Also available in: Atom PDF