Verified Commit 8743dc70 authored by Alexandre Morin's avatar Alexandre Morin
Browse files

fix (13412) : update json serializer

parent 0edf487c
Pipeline #7144 canceled with stages
...@@ -45,12 +45,11 @@ class JsonSerializer ...@@ -45,12 +45,11 @@ class JsonSerializer
} }
if (is_object($data)) { if (is_object($data)) {
$return = clone($data);
foreach ($data as $key => $value) { foreach ($data as $key => $value) {
$return->{$key} = $this->getRefs($value); $data->{$key} = $this->getRefs($value);
} }
return $return; return $data;
} }
if (is_resource($data)) { if (is_resource($data)) {
......
...@@ -554,7 +554,14 @@ trait archiveAccessTrait ...@@ -554,7 +554,14 @@ trait archiveAccessTrait
$binaryDataObject = \laabs::newInstance("recordsManagement/BinaryDataObject"); $binaryDataObject = \laabs::newInstance("recordsManagement/BinaryDataObject");
$binaryDataObject->attachment = new \stdClass(); $binaryDataObject->attachment = new \stdClass();
$binaryDataObject->attachment->data = $digitalResource->getHandler(); if (\laabs::isServiceClient()) {
// Returns base64 encoded contents for web service clients
$binaryDataObject->attachment->data = \core\Encoding\Base64::encode($digitalResource->getHandler());
} else {
// Let presenter stream the contents
$binaryDataObject->attachment->data = $digitalResource->getHandler();
}
$binaryDataObject->attachment->uri = ""; $binaryDataObject->attachment->uri = "";
$binaryDataObject->attachment->filename = $digitalResource->fileName; $binaryDataObject->attachment->filename = $digitalResource->fileName;
......
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