fix (13412) : update json serializer

parent 2a9ea3fd
Pipeline #7138 canceled with stages
......@@ -78,10 +78,10 @@ class json
public static function encode($data)
{
require_once __DIR__.'/JsonSerializer.php';
$serializer = new JsonSerializer();
$serializer = new \JsonSerializer();
//$jsonString = \json_encode($data, \JSON_PRETTY_PRINT + \JSON_UNESCAPED_SLASHES + \JSON_UNESCAPED_UNICODE);
$jsonString = $serializer($data, \JSON_PRETTY_PRINT + \JSON_UNESCAPED_SLASHES + \JSON_UNESCAPED_UNICODE);
$jsonString = $serializer->serialize($data, \JSON_PRETTY_PRINT + \JSON_UNESCAPED_SLASHES + \JSON_UNESCAPED_UNICODE);
if ($jsonString === false) {
return false;
......
......@@ -554,14 +554,7 @@ trait archiveAccessTrait
$binaryDataObject = \laabs::newInstance("recordsManagement/BinaryDataObject");
$binaryDataObject->attachment = new \stdClass();
if (\laabs::isServiceClient()) {
// Returns base64 encoded contents for web service clients
$binaryDataObject->attachment->data = base64_encode($digitalResource->getContents());
} else {
// Let presenter stream the contents
$binaryDataObject->attachment->data = $digitalResource->getHandler();
}
$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