Bug #9869

Unrecognized note types in EAD import will cause 500 error

Added by Dan Gillean about 6 years ago. Updated almost 6 years ago.

Status:VerifiedStart date:05/19/2016
Priority:MediumDue date:
Assignee:Dan Gillean% Done:

0%

Category:EAD
Target version:Release 2.3.0
Google Code Legacy ID: Tested version:2.3
Sponsored:No Requires documentation:

Description

Before issue #6143 was resolved, we had 2 separate database fields for RAD vs ISAD general notes - and consequently, 2 different CSV import columns and 2 different EAD mappings. Now all of that has been resolved.

However, as a part of testing #6141, I tried importing a file with the old RAD general note mapping:

<odd type="general" encodinganalog="1.8B21">
    <p>Other notes: General note (RAD 1.8B21)</p>
</odd>

Resulting error

500 error; import fails.

Error log output:

2016/05/19 21:26:04 [error] 3149#0: *1 FastCGI sent in stderr: "PHP message: Unable to execute INSERT statement. [wrapped: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`atom`.`note`, CONSTRAINT `note_FK_2` FOREIGN KEY (`type_id`) REFERENCES `term` (`id`) ON DELETE SET NULL)]" while reading response header from upstream, client: 10.10.10.1, server: _, request: "POST /object/import HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.atom.sock:", host: "10.10.10.10", referrer: "http://10.10.10.10/object/importSelect?type=xml" 

Really, we should fail more gracefully from this kind of thing.

Ideal outcomes

There are at lest 2 good possibilities.

1) Unrecognized note types are skipped; the user is given a warning about them but the import proceeds
2) Unrecognized note types are also mapped to General note in the database


Related issues

Related to Access to Memory (AtoM) - Bug #6141: General note <odd> dropped during XML import Verified 12/17/2013

History

#1 Updated by Dan Gillean about 6 years ago

  • Related to Bug #6141: General note <odd> dropped during XML import added

#2 Updated by Mike Cantelon about 6 years ago

  • Status changed from New to Code Review
  • Assignee set to José Raddaoui Marín

#3 Updated by Mike Cantelon about 6 years ago

  • Status changed from Code Review to QA/Review
  • Assignee changed from José Raddaoui Marín to Dan Gillean

Mike G reviewed code. Now merged.

#4 Updated by Dan Gillean almost 6 years ago

  • Target version set to Release 2.3.0

Realized this was being overlooked in 2.3 QA because it had no target version added.

#5 Updated by Dan Gillean almost 6 years ago

  • Status changed from QA/Review to Verified

Works great!

Also available in: Atom PDF