From 71208f5428232d818dba1d41ea91b6b6ee6d0e4e Mon Sep 17 00:00:00 2001 From: bach Date: Fri, 28 Jun 2024 11:31:04 +0200 Subject: [PATCH] php bug fix --- .../reha_mod/src/Plugin/Block/PrevNext.php | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/web/modules/reha_mod/src/Plugin/Block/PrevNext.php b/web/modules/reha_mod/src/Plugin/Block/PrevNext.php index b92e96e..1889bc2 100644 --- a/web/modules/reha_mod/src/Plugin/Block/PrevNext.php +++ b/web/modules/reha_mod/src/Plugin/Block/PrevNext.php @@ -52,25 +52,25 @@ class PrevNext extends BlockBase { } } - } - $return = [ - '#cache' => [ - 'max-age' => 0, - ] - ]; - - if ($prevnode) { - $prev_link_title = Markup::create('Site pilote précédent'); - $prev_options = ['absolute' => FALSE, 'attributes' => ['class' => 'prev-site']]; - $prev_link_object = Link::createFromRoute($prev_link_title, 'entity.node.canonical', ['node' => $prevnode->id()], $prev_options); - $return[] = $prev_link_object->toRenderable(); - } - - if ($nextnode) { - $next_link_title = Markup::create('Site pilote suivant'); - $next_options = ['absolute' => FALSE, 'attributes' => ['class' => 'next-site']]; - $next_link_object = Link::createFromRoute($next_link_title, 'entity.node.canonical', ['node' => $nextnode->id()], $next_options); - $return[] = $next_link_object->toRenderable(); + $return = [ + '#cache' => [ + 'max-age' => 0, + ] + ]; + + if (isset($prevnode)) { + $prev_link_title = Markup::create('Site pilote précédent'); + $prev_options = ['absolute' => FALSE, 'attributes' => ['class' => 'prev-site']]; + $prev_link_object = Link::createFromRoute($prev_link_title, 'entity.node.canonical', ['node' => $prevnode->id()], $prev_options); + $return[] = $prev_link_object->toRenderable(); + } + + if (isset($nextnode)) { + $next_link_title = Markup::create('Site pilote suivant'); + $next_options = ['absolute' => FALSE, 'attributes' => ['class' => 'next-site']]; + $next_link_object = Link::createFromRoute($next_link_title, 'entity.node.canonical', ['node' => $nextnode->id()], $next_options); + $return[] = $next_link_object->toRenderable(); + } } }