fix (13412) : update json serializer

parent 0edf487c
Pipeline #7144 canceled with stages
......@@ -45,12 +45,11 @@ class JsonSerializer
}
if (is_object($data)) {
$return = clone($data);
foreach ($data as $key => $value) {
$return->{$key} = $this->getRefs($value);
$data->{$key} = $this->getRefs($value);
}
return $return;
return $data;
}
if (is_resource($data)) {
......
......@@ -554,7 +554,14 @@ trait archiveAccessTrait
$binaryDataObject = \laabs::newInstance("recordsManagement/BinaryDataObject");
$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->filename = $digitalResource->fileName;
......
Markdown is supported
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