From a4dc81d592d732fe1d79380227dd1604918c0f81 Mon Sep 17 00:00:00 2001 From: "user.email" Date: Fri, 15 Nov 2024 15:07:03 -0500 Subject: [PATCH] DDST-747: Fix error on Newspaper Members page --- src/Plugin/Block/DisplayCitationsBlock.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Plugin/Block/DisplayCitationsBlock.php b/src/Plugin/Block/DisplayCitationsBlock.php index ae19e99..83608f3 100644 --- a/src/Plugin/Block/DisplayCitationsBlock.php +++ b/src/Plugin/Block/DisplayCitationsBlock.php @@ -176,9 +176,11 @@ public function blockSubmit($form, FormStateInterface $form_state) { * {@inheritdoc} */ public function getCacheTags() { - // Retrieve the node ID. + // Retrieve the node parameter. $node = $this->routeMatch->getParameter('node'); - $node_id = $node instanceof NodeInterface ? $node->id() : NULL; + + // If it's an object, get the ID. Otherwise, assume it's already the ID. + $node_id = is_object($node) ? $node->id() : $node; // Return cache tags. if ($node_id) {