Bug #13499

Saving a resource with incomplete relation data causes a 500 error

Added by José Raddaoui Marín 5 months ago. Updated 3 months ago.

Status:QA/ReviewStart date:04/22/2021
Priority:MediumDue date:
Assignee:-% Done:

0%

Category:Form validation
Target version:Release 2.7.0
Google Code Legacy ID: Tested version:
Sponsored:No Requires documentation:No

Description

Originally reported by community user Matt Innes. See his community PR addressing this issue for more information:

Summary

If a user tries to add a relationship to an entity, but leaves the related entity blank, this will cause a 500 error on save, causing all other data entered into the template to be lost. While the application should not allow empty relations to be created, losing all other form data can be frustrating. This issue seeks to address this problem by ignoring the empty relationship and providing a warning on save instead. This way, other form data is preserved, and the user can re-enter edit mode to properly add a relationship if desired.

To reproduce

  • Create a new entity that supports relationships, such as an authority record or a function
  • While creating your new entity, add a new relation in the Relationship area. Leave the related entity field blank
  • Continue populating other parts of the form
  • Save the record

Error encountered

  • 500 error
  • Loss of all form data
  • No record created

Expected result

  • Ideally, a warning is provided either before or after form submission, and other form data is not lost

Notes

Matt's PR adds basic validation in the relationship dialog itself for the following entities and relations:

  • ISAAR - Related authority records
  • ISAAR - Related resources
  • ISDF - Related authority records
  • ISDF - Related resources

Relations not yet covered:

  • Accession records - Related donors
  • ISDF - Related functions

The PR also addresses several other minor bugs and layout issues, particular with Functions. See the "PR":* https://github.com/artefactual/atom/pull/1276 for more information.

History

#1 Updated by Dan Gillean 5 months ago

  • Description updated (diff)
  • Category set to Form validation
  • Assignee set to José Raddaoui Marín
  • Target version set to Release 2.7.0
  • Requires documentation set to No

#2 Updated by José Raddaoui Marín 3 months ago

  • Status changed from New to QA/Review
  • Assignee deleted (José Raddaoui Marín)

Merged in qa/2.x.

#3 Updated by José Raddaoui Marín 3 months ago

Check also #10682, #13218 and #13425

Also available in: Atom PDF