php bug fix

This commit is contained in:
2024-06-28 11:31:04 +02:00
parent 00a8ce493f
commit 71208f5428
@@ -52,25 +52,25 @@ class PrevNext extends BlockBase {
} }
} }
} $return = [
$return = [ '#cache' => [
'#cache' => [ 'max-age' => 0,
'max-age' => 0, ]
] ];
];
if (isset($prevnode)) {
if ($prevnode) { $prev_link_title = Markup::create('<span>Site pilote précédent</span>');
$prev_link_title = Markup::create('<span>Site pilote précédent</span>'); $prev_options = ['absolute' => FALSE, 'attributes' => ['class' => 'prev-site']];
$prev_options = ['absolute' => FALSE, 'attributes' => ['class' => 'prev-site']]; $prev_link_object = Link::createFromRoute($prev_link_title, 'entity.node.canonical', ['node' => $prevnode->id()], $prev_options);
$prev_link_object = Link::createFromRoute($prev_link_title, 'entity.node.canonical', ['node' => $prevnode->id()], $prev_options); $return[] = $prev_link_object->toRenderable();
$return[] = $prev_link_object->toRenderable(); }
}
if (isset($nextnode)) {
if ($nextnode) { $next_link_title = Markup::create('<span>Site pilote suivant</span>');
$next_link_title = Markup::create('<span>Site pilote suivant</span>'); $next_options = ['absolute' => FALSE, 'attributes' => ['class' => 'next-site']];
$next_options = ['absolute' => FALSE, 'attributes' => ['class' => 'next-site']]; $next_link_object = Link::createFromRoute($next_link_title, 'entity.node.canonical', ['node' => $nextnode->id()], $next_options);
$next_link_object = Link::createFromRoute($next_link_title, 'entity.node.canonical', ['node' => $nextnode->id()], $next_options); $return[] = $next_link_object->toRenderable();
$return[] = $next_link_object->toRenderable(); }
} }
} }