|
@@ -82,7 +82,7 @@ class CorpusController extends ControllerBase {
|
|
|
if(!$audio_file) continue;
|
|
|
|
|
|
$son_uri = $audio_file->getFileUri();
|
|
|
- $audio_url = file_create_url($son_uri);
|
|
|
+ $audio_url = \Drupal::service('file_url_generator')->generateAbsoluteString($son_uri);
|
|
|
|
|
|
// has article ?
|
|
|
$article_value = $node->body->getValue();
|
|
@@ -233,11 +233,11 @@ class CorpusController extends ControllerBase {
|
|
|
public function docsindexjson() {
|
|
|
|
|
|
$renderable = $this->docsindexToRenderable();
|
|
|
- // $rendered = render($renderable);
|
|
|
+ // $rendered = \Drupal::service('renderer')->render($renderable);
|
|
|
// We can't render directly the entity as it throw an exception with cachable data
|
|
|
//http://blog.dcycle.com/blog/2018-01-24/caching-drupal-8-rest-resource/#the-dreaded-leaked-metadata-error
|
|
|
$rendered = \Drupal::service('renderer')->executeInRenderContext(new RenderContext(), function () use ($renderable) {
|
|
|
- return render($renderable);
|
|
|
+ return \Drupal::service('renderer')->render($renderable);
|
|
|
});
|
|
|
|
|
|
$data = [
|
|
@@ -256,7 +256,7 @@ class CorpusController extends ControllerBase {
|
|
|
'#attributes' => ['class' => ["language-switcher-{$links->method_id}",],],
|
|
|
'#set_active_class' => TRUE,
|
|
|
];
|
|
|
- $translations_rendered = \Drupal::service('renderer')->executeInRenderContext(new RenderContext(), function () use ($translations_build) {return render($translations_build);});
|
|
|
+ $translations_rendered = \Drupal::service('renderer')->executeInRenderContext(new RenderContext(), function () use ($translations_build) {return \Drupal::service('renderer')->render($translations_build);});
|
|
|
|
|
|
$data['translations_links'] = $translations_rendered;
|
|
|
}
|
|
@@ -345,11 +345,11 @@ class CorpusController extends ControllerBase {
|
|
|
public function lastdocsjson() {
|
|
|
|
|
|
$renderable = $this->toRenderable();
|
|
|
- // $rendered = render($renderable);
|
|
|
+ // $rendered = \Drupal::service('renderer')->render($renderable);
|
|
|
// We can't render directly the entity as it throw an exception with cachable data
|
|
|
//http://blog.dcycle.com/blog/2018-01-24/caching-drupal-8-rest-resource/#the-dreaded-leaked-metadata-error
|
|
|
$rendered = \Drupal::service('renderer')->executeInRenderContext(new RenderContext(), function () use ($renderable) {
|
|
|
- return render($renderable);
|
|
|
+ return \Drupal::service('renderer')->render($renderable);
|
|
|
});
|
|
|
|
|
|
$data = [
|
|
@@ -370,7 +370,7 @@ class CorpusController extends ControllerBase {
|
|
|
'#attributes' => ['class' => ["language-switcher-{$links->method_id}",],],
|
|
|
'#set_active_class' => TRUE,
|
|
|
];
|
|
|
- $translations_rendered = \Drupal::service('renderer')->executeInRenderContext(new RenderContext(), function () use ($translations_build) {return render($translations_build);});
|
|
|
+ $translations_rendered = \Drupal::service('renderer')->executeInRenderContext(new RenderContext(), function () use ($translations_build) {return \Drupal::service('renderer')->render($translations_build);});
|
|
|
|
|
|
$data['translations_links'] = $translations_rendered;
|
|
|
}
|
|
@@ -458,11 +458,11 @@ class CorpusController extends ControllerBase {
|
|
|
public function articlesindexjson() {
|
|
|
|
|
|
$renderable = $this->articlesToRenderable();
|
|
|
- // $rendered = render($renderable);
|
|
|
+ // $rendered = \Drupal::service('renderer')->render($renderable);
|
|
|
// We can't render directly the entity as it throw an exception with cachable data
|
|
|
//http://blog.dcycle.com/blog/2018-01-24/caching-drupal-8-rest-resource/#the-dreaded-leaked-metadata-error
|
|
|
$rendered = \Drupal::service('renderer')->executeInRenderContext(new RenderContext(), function () use ($renderable) {
|
|
|
- return render($renderable);
|
|
|
+ return \Drupal::service('renderer')->render($renderable);
|
|
|
});
|
|
|
|
|
|
$data = [
|
|
@@ -484,7 +484,7 @@ class CorpusController extends ControllerBase {
|
|
|
'#attributes' => ['class' => ["language-switcher-{$links->method_id}",],],
|
|
|
'#set_active_class' => TRUE,
|
|
|
];
|
|
|
- $translations_rendered = \Drupal::service('renderer')->executeInRenderContext(new RenderContext(), function () use ($translations_build) {return render($translations_build);});
|
|
|
+ $translations_rendered = \Drupal::service('renderer')->executeInRenderContext(new RenderContext(), function () use ($translations_build) {return \Drupal::service('renderer')->render($translations_build);});
|
|
|
|
|
|
$data['translations_links'] = $translations_rendered;
|
|
|
}
|
|
@@ -557,11 +557,11 @@ class CorpusController extends ControllerBase {
|
|
|
|
|
|
public function collectionjson(){
|
|
|
$renderable = $this->collectionToRenderable();
|
|
|
- // $rendered = render($renderable);
|
|
|
+ // $rendered = \Drupal::service('renderer')->render($renderable);
|
|
|
// We can't render directly the entity as it throw an exception with cachable data
|
|
|
//http://blog.dcycle.com/blog/2018-01-24/caching-drupal-8-rest-resource/#the-dreaded-leaked-metadata-error
|
|
|
$rendered = \Drupal::service('renderer')->executeInRenderContext(new RenderContext(), function () use ($renderable) {
|
|
|
- return render($renderable);
|
|
|
+ return \Drupal::service('renderer')->render($renderable);
|
|
|
});
|
|
|
|
|
|
$data = [
|
|
@@ -581,7 +581,7 @@ class CorpusController extends ControllerBase {
|
|
|
'#attributes' => ['class' => ["language-switcher-{$links->method_id}",],],
|
|
|
'#set_active_class' => TRUE,
|
|
|
];
|
|
|
- $translations_rendered = \Drupal::service('renderer')->executeInRenderContext(new RenderContext(), function () use ($translations_build) {return render($translations_build);});
|
|
|
+ $translations_rendered = \Drupal::service('renderer')->executeInRenderContext(new RenderContext(), function () use ($translations_build) {return \Drupal::service('renderer')->render($translations_build);});
|
|
|
|
|
|
$data['translations_links'] = $translations_rendered;
|
|
|
}
|