There are a lot of sub-records in ASpace that are essentially treated as 
ephemeral but which have full concrete tables backing them; they’re not 
addressable in the system, their representations in the JSONModel are as 
primitive values (strings, array of strings, etc) rather than objects, etc.  
Instances are kind of this way – you can’t grab an instance, only the things 
attached to it, but it has a database ID, etc.

You _might_ be able to insert refs to the subrecords that aren’t changing, 
rather than the values/records themselves?  That _might_ keep the values the 
same, but I’m not sure it’ll be legal everywhere.  You could also try 
explicitly setting created_by and created_at; I am at a conf but could poke at 
this later (maybe tonight or tomorrow) if you’ll remind me.

--
Dave Mayo (he/him)
Senior Digital Library Software Engineer
Harvard University > HUIT > LTS

From: <archivesspace_users_group-boun...@lyralists.lyrasis.org> on behalf of 
Rachel Donahue <rachel.dona...@lac-group.com>
Reply-To: Archivesspace Users Group 
<archivesspace_users_group@lyralists.lyrasis.org>
Date: Friday, October 11, 2019 at 11:52 AM
To: "archivesspace_users_group@lyralists.lyrasis.org" 
<archivesspace_users_group@lyralists.lyrasis.org>
Subject: [Archivesspace_Users_Group] Oddities when updating Agents via the API

Hi all,

I'm running some bulk updates to Agents (in this case people) via the API and 
noticed some rather odd changes to sub-records when I check the JSON after 
successfully running the update.

1. Every sub-record (e.g. names, telephones) has replaced "created_by" with the 
user authenticated by the API and create_time with the time of the API call. 
The Agent itself retains its created_by and time, thankfully, but all the bits 
and pieces lose it.
2. Possibly related to this, a new telephone number is created even though 
nothing about the phone number has changed. (e.g. what was /telephone/99 is now 
/telephone/204)
3. The lock_version for the sub-records isn't changing from 0.

The only thing changing in these updates is the name source and we're using 
ArchivesSpace 2.6.0. I have been reposting the entire object in the update--is 
it possible to post *only* the changing fields and perhaps avoid the problem?

While this isn't a make-or-break problem, I'd really like to retain the 
created_by information for names, as it is often *not* the same as the person 
who created the initial record. I'm also not sure if this is a bug or something 
I'm doing wrong. Any insights would be much appreciated!

Best,
Rachel

--

Please note that I currently do not have access to ARS email. If you need to 
contact me, use my LAC address: 
rachel.dona...@lac-group.com<mailto:rachel.dona...@lac-group.com>

The information contained in this e-mail message is confidential. If you are 
not the intended recipient, any dissemination or copying is strictly 
prohibited. If you think that you have received this e-mail message in error, 
please contact the sender.
_______________________________________________
Archivesspace_Users_Group mailing list
Archivesspace_Users_Group@lyralists.lyrasis.org
http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group

Reply via email to