Closed seth-shaw-asu closed 2 years ago
Adding to milestone, although I'm sure that simply adding the PR patch to the composer.json will resolve this.
Resolved with https://github.com/asulibraries/islandora-repo/commit/b6ab306a9b3753b1c5cb411b19f0cc694ea2c83b, although hopefully the JSON-LD PR will be merged soon and make the composer patch obsolete.
The Drupal logs show several instances of 'User error: "target_id" is an invalid render array' on OAI-PMH GetRecord and ListRecords requests. E.g. https://keep.lib.asu.edu/oai/request?identifier=oai%3Akeep.lib.asu.edu%3Anode-133403&metadataPrefix=oai_dc&verb=GetRecord.
For some unknown reason, these records are loading in the rest_oai_pmh with a copyright field with an erroneous target_id array reference to a '0' entity, which doesn't exist. (I'm not able to replicate seeing the incorrectly set field item using
php:cli
or the web-editor.) This target_id array gets passed to the JSON-LDEntityReferenceConverter::linkedFieldPassthrough()
which, as written, sends the value right back because it can't load the entity. Now,DublinCoreRdf::transformRecord()
will check target_id arrays and return the target_id value if it can't load the entity, but not if it was sent through a converter first. This results in our target_id array being past as-is to the Twig rendering which then chokes on it.The simplest solution is probably to have
EntityReferenceConverter::linkedFieldPassthrough()
return either the target_id value (astransformRecord()
does) or an empty value. We should probably also havetransformRecord()
NOT add an empty value to the elements render array.