Information object properties are not always saved when save() is called
|Assignee:||Dan Gillean||% Done:|
|Target version:||Release 2.1.1|
|Google Code Legacy ID:||Tested version:||2.1|
It's possible for an information object's properties to not all be saved when calling the object's save() function. This happens if the information object was previously saved, for instance from setActorByNAme().
This occurs when importing EAD records which contain authority records. The top level of description will be saved twice - first when the authority is added, then when the item is complete. Logging shows that the second time the information object is saved, all of its properties are present (title, etc.). However, those properties are not saved into the database.
The workflow in EAD import looks something like this:
1) Information object is created
2) Authority records are added. setActorByName() causes the information object to be saved immediately.
3) Further properties are added.
4) The record's save() method is called to save the information object to the database.
This has been observed to cause the following properties not to save:
- Custodial history
- Scope and content
This issue was introduced by commit bdbd63f7c2b22dd7666b9ca53e719fdee34b573e, which causes the information object to save itself when setActorByName() is called: https://github.com/artefactual/atom/commit/bdbd63f7c2b22dd7666b9ca53e719fdee34b573e#diff-2454f613f1d7fbd4aa61c376d2438550R1314
#3 Updated by Mike Gale about 6 years ago
Here's a sample file where the issue is confirmed to be present (a client's data so I put it in google drive): https://drive.google.com/a/artefactual.com/file/d/0B2qFrFnz76qrWGlPTkUzSkpqWjA/edit?usp=sharing
It's a pretty large XML file so if you don't want to wait for import, you can put a break here, and it'll stop the import after the first info object is imported (which will be the 'problem' one): https://github.com/artefactual/atom/blob/qa/2.2.x/lib/QubitXmlImport.class.php#L280