+ Logger::error('compacting error');
+ // Sooner or later we should log some details as well - but currently this leads to memory issues
+ // Logger::log('compacting error:' . substr(print_r($e, true), 0, 10000), Logger::DEBUG);
+ }
+
+ $json = json_decode(json_encode($compacted, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), true);
+
+ if (isset($json['as:object']['as:source']['as:content']) && !empty($content)) {
+ $json['as:object']['as:source']['as:content'] = $content;