Project

General

Profile

Bug #1723

Information gets deleted from map

Added by Nina Richards 4 months ago. Updated 4 months ago.

Status:
Closed
Priority:
Normal
Category:
Maps
Target version:
Start date:
2022-05-20
Estimated time:
Found in version:

Description

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

Related to Feature #1736: Keep form map data after failed backend validationAssigned2022-06-08Actions

History

#1

Updated by Alexander Watzinger 4 months 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

#2

Updated by Alexander Watzinger 4 months 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/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.

#3

Updated by Alexander Watzinger 4 months ago

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

Updated by Andreas Olschnögger 4 months 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

#5

Updated by Alexander Watzinger 4 months 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