Commit 7e9c0d8f authored by Cyril Vazquez's avatar Cyril Vazquez
Browse files

Merge branch 'fix/13343_Read_Resource_from_API' into 'Support/2.6.X'

FIX #13343 Test ServiceClient instead of Presentation to return contents

See merge request !430
parents 869ef605 b7ce00ee
Pipeline #7035 canceled with stages
...@@ -554,10 +554,12 @@ trait archiveAccessTrait ...@@ -554,10 +554,12 @@ trait archiveAccessTrait
$binaryDataObject = \laabs::newInstance("recordsManagement/BinaryDataObject"); $binaryDataObject = \laabs::newInstance("recordsManagement/BinaryDataObject");
$binaryDataObject->attachment = new \stdClass(); $binaryDataObject->attachment = new \stdClass();
if (\laabs::hasPresentation()) { if (\laabs::isServiceClient()) {
$binaryDataObject->attachment->data = $digitalResource->getHandler(); // Returns base64 encoded contents for web service clients
} else {
$binaryDataObject->attachment->data = base64_encode($digitalResource->getContents()); $binaryDataObject->attachment->data = base64_encode($digitalResource->getContents());
} else {
// Let presenter stream the contents
$binaryDataObject->attachment->data = $digitalResource->getHandler();
} }
$binaryDataObject->attachment->uri = ""; $binaryDataObject->attachment->uri = "";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment