Bug #4303

MODS XML export/import roundtripping issue - 500 error produced when attempting to import MODS XML

Added by Dan Gillean almost 10 years ago. Updated about 7 years ago.

Status:VerifiedStart date:
Priority:MediumDue date:
Assignee:Dan Gillean% Done:

0%

Category:Import/Export
Target version:Release 2.1.0
Google Code Legacy ID:atom-2355 Tested version:
Sponsored:No Requires documentation:

Description

To reproduce this error:
1)Switch the default template to MODS Version 3.3 (Logged in as an admin, navigate to Admin > Settings > Default template > Information object and change the template here)
2)Navigate to an information object show screen
3)Select the Export > MODS 3.3 XML option from the right-hand context menu, and save the resulting XML file
4) Delete the information object
5) Re-import the information object using the saved MODS XML file

Resulting error:
500 error encountered - description fails to import. See attached screenshot/ stack trace

Expected result:
MODS XML file should import properly

NB: See related #2783

[g] Legacy categories: Import/Export

MODS-roundtrip-error.PNG (93.6 KB) Dan Gillean, 12/01/2012 05:29 AM

mods-import-error-stackTrace.htm Magnifier (94.7 KB) Dan Gillean, 03/11/2014 04:09 PM


Related issues

Related to Access to Memory (AtoM) - Bug #6877: MODS import doesn't work if namespace attributes included Verified 06/21/2014

History

#1 Updated by Jessica Bushey almost 10 years ago

  • Status changed from New to New
  • Priority set to Medium
  • Target version set to Release 1.3

[g] Labels added: Priority-Medium, Milestone-Release-1.3, Component-Import-Export
[g] New owner: Dan Gillean

#2 Updated by Dan Gillean about 8 years ago

  • File mods-import-error-stackTrace.htmMagnifier added
  • Subject changed from MODS XML export/import roundtripping issue to MODS XML export/import roundtripping issue - 500 error produced when attempting to import MODS XML
  • Description updated (diff)
  • Category set to Import/Export
  • Sponsored set to No

Tested recently in AtoM 2.x (post 2.0.1 release; dev version 2.1.0 - 108) and encountering the same issue (500 error). Stack trace attached.

#3 Updated by Tim Hutchinson about 8 years ago

I started looking into MODS earlier, since I've been wondering about options for exchanging data with Islandora. It looks like the MODS import hasn't actually been developed - there's a mods.yml file, but none of the element mappings are there.
https://github.com/artefactual/atom/blob/2.x/apps/qubit/modules/object/config/import/mods.yml

#4 Updated by Tim Hutchinson about 8 years ago

I did a bit more testing - the 500 error is caused by the fact that the relevant line in lib/QubitXmlImport.class.php is commented out. ( 'mods' => 'mods' )

Of course, as I noted above, the mods.yml file also needs to be populated. I added a couple elements, enough for a basic test, and encountered a similar issue as in #6064 for EAD - the import doesn't work at all if namespace information is present, e.g.:
<mods xmlns="http://www.loc.gov/mods/v3" xmlns:mods="http://www.loc.gov/mods/v3" xmlns:xlink="http://www.w3.org/1999/xlink">

Removing the namespace values - leaving <mods> - I was able to import a skeleton record.

#5 Updated by Tim Hutchinson about 8 years ago

Pull requests:
https://github.com/artefactual/atom/pull/18
https://github.com/artefactual/atom/pull/19
(sorry, I wasn't sure how to combine two commits into the same pull request, via the github website)

As noted in the first pull request, this just enables import based on the existing MODS template in AtoM - no other elements are added, and language is not imported.

#6 Updated by Dan Gillean about 8 years ago

  • Assignee changed from Dan Gillean to Jesús García Crespo
  • Target version set to Release 2.0.2

You're a machine, Tim! Assigning to Jesus for triage.

#7 Updated by Mike Gale almost 8 years ago

  • Status changed from New to QA/Review
  • Assignee changed from Jesús García Crespo to Dan Gillean

I merged this pull request from Tim.

#8 Updated by Dan Gillean almost 8 years ago

  • Target version changed from Release 2.0.2 to Release 2.1.0

#9 Updated by Mike Gale almost 8 years ago

  • Status changed from QA/Review to Feedback

MODS still doesn't seem to import--when I try exporting a MODS file then importing it back into a clean AtoM instance, it says import successful but doesn't seem to actually import anything.

#10 Updated by Tim Hutchinson almost 8 years ago

Mike, does your test file include the namespace elements? In my testing, I had to remove that to make it work - so running into issue #6064. I thought I had reported that in the other ticket, but I must have been holding off until the pull request was merged. Please let me know if that's not the problem.

#11 Updated by Dan Gillean almost 8 years ago

  • Status changed from Feedback to Verified

Catching up on this in light of other related MODS work. Removing the namespaces causes the import to work. Not all elements are currently roundtripping with 100% fidelity but that will be tackled in other issues. Tim, your pull requests have been merged in 2x, and will be included in the 2.1 public release. As always, thank you!

#12 Updated by Dan Gillean about 7 years ago

  • Related to Bug #6877: MODS import doesn't work if namespace attributes included added

#13 Updated by Dan Gillean about 7 years ago

Update for public users - MODS import has been improved, and namespace import issues were resolved in #6877. MODS export was fixed in #7712, and bulk MODS export via CLI has been added in #7263

Also available in: Atom PDF