[Archivesspace_Users_Group] Plugin causing RDE validation error

Seth Shaw seth.shaw at unlv.edu
Tue Jul 18 16:55:47 EDT 2017


*Apologies for cross-listing, trying to figure out where best to post
this type of question.*

I just inherited a plugin that adds a "publish" boolean value to an
extent note to allow recording both linear and cubic feet but only
publish one of them
(https://github.com/UNLV-Libraries/ArchivesSpace-authority-project/tree/master/extents_ext).
It appears to work fine, however it causes a validation error on the
rapid data entry right away (before any data entry begins).

I'm not sure why the validator is complaining; other elements that
have required components (e.g. you can't just enter and end date) but
it doesn't complain until there is data entered whereas it now
complains about extent automatically.

I've included request and response data from a test below; the same
form data can be sent when the plugin is and isn't enabled. Without
the plugin it simply reports the level of description being absent
(expected). With the plugin enabled it also reports extent values
missing (which shouldn't happen unless we have entered data first).

You can see from the plugin source that we've simply added a simple
schema extension. Any idea why this is causing the validator to
complain and, more importantly, how to resolve it?

Thanks.

For reference:

Validation Call Request Headers:

POST /archival_objects/validate_rows HTTP/1.1
Host: archivestest:8080
Connection: keep-alive
Content-Length: 3065
Origin: http://archivestest:8080
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115
Safari/537.36
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Accept: application/json, text/javascript, */*; q=0.01
X-Requested-With: XMLHttpRequest
Referer: http://archivestest:8080/resources/1039/edit
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.8
**Cookie and CSFR Tokens Removed**

Form Data (prettified):

archival_record_children[children][0][level]:
archival_record_children[children][0][other_level]:
archival_record_children[children][0][publish]: 1
archival_record_children[children][0][title]:
archival_record_children[children][0][component_id]:
archival_record_children[children][0][language]:
archival_record_children[children][0][dates][0][expression]:
archival_record_children[children][0][dates][0][date_type]:
archival_record_children[children][0][dates][0][label]:
archival_record_children[children][0][dates][0][begin]:
archival_record_children[children][0][dates][0][end]:
archival_record_children[children][0][extents][0][portion]:
archival_record_children[children][0][extents][0][number]:
archival_record_children[children][0][extents][0][extent_type]:
archival_record_children[children][0][extents][0][container_summary]:
archival_record_children[children][0][extents][0][physical_details]:
archival_record_children[children][0][extents][0][dimensions]:
archival_record_children[children][0][instances][0][instance_type]:
archival_record_children[children][0][instances][0][container][type_1]:
archival_record_children[children][0][instances][0][container][indicator_1]:
archival_record_children[children][0][instances][0][container][barcode_1]:
archival_record_children[children][0][instances][0][container][type_2]:
archival_record_children[children][0][instances][0][container][indicator_2]:
archival_record_children[children][0][instances][0][container][type_3]:
archival_record_children[children][0][instances][0][container][indicator_3]:
archival_record_children[children][0][notes][0][type]:
archival_record_children[children][0][notes][0][jsonmodel_type]: note_singlepart
archival_record_children[children][0][notes][0][label]:
archival_record_children[children][0][notes][0][content][0]:
archival_record_children[children][0][notes][1][type]:
archival_record_children[children][0][notes][1][jsonmodel_type]: note_singlepart
archival_record_children[children][0][notes][1][label]:
archival_record_children[children][0][notes][1][content][0]:
archival_record_children[children][0][notes][2][type]:
archival_record_children[children][0][notes][2][jsonmodel_type]: note_singlepart
archival_record_children[children][0][notes][2][label]:
archival_record_children[children][0][notes][2][content][0]: (empty)
validate_only: true

Response without the plugin:

[{"errors":{"level":["Property is required but was missing"]}}]

Response withe the plugin:

[{"errors":{"extents/0/portion":["Property is required but was
missing"],"extents/0/number":["Property is required but was
missing"],"extents/0/extent_type":["Property is required but was
missing"],"level":["Property is required but was missing"]}}]


More information about the Archivesspace_Users_Group mailing list