From fc39ad0b49ee45c6146c91c50479635eccdb8fce Mon Sep 17 00:00:00 2001 From: Juha Luoma <33253757+LuomaJuha@users.noreply.github.com> Date: Thu, 17 Oct 2024 09:32:44 +0300 Subject: [PATCH] Prevent showing list entry notes temporarily for reservation lists (#3057) --- .../Finna/src/Finna/View/Helper/Root/Record.php | 17 +++++++++++++++++ .../templates/reservationlist/displaylist.phtml | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/module/Finna/src/Finna/View/Helper/Root/Record.php b/module/Finna/src/Finna/View/Helper/Root/Record.php index 44e3d93481e..270ea07b165 100644 --- a/module/Finna/src/Finna/View/Helper/Root/Record.php +++ b/module/Finna/src/Finna/View/Helper/Root/Record.php @@ -1541,4 +1541,21 @@ public function getBanner(): string } return ''; } + + /** + * Get notes associated with this record in user lists. + * + * @param int $list_id ID of list to load tags from (null for all lists) + * @param int $user_id ID of user to load tags from (null for all users) + * + * @return string[] + */ + public function getListNotes($list_id = null, $user_id = null) + { + // TODO: handle notes for different list types more properly + if ($this->getView()->layout()->templateDir === 'reservationlist') { + return []; + } + return parent::getListNotes($list_id, $user_id); + } } diff --git a/themes/finna2/templates/reservationlist/displaylist.phtml b/themes/finna2/templates/reservationlist/displaylist.phtml index ade105554b9..de45f166972 100644 --- a/themes/finna2/templates/reservationlist/displaylist.phtml +++ b/themes/finna2/templates/reservationlist/displaylist.phtml @@ -103,7 +103,7 @@ /** @var \Finna\View\Helper\Root\Record */ $recordHelper = $this->record($current); ?> - renderTemplate('list-entry.phtml', ['driver' => $current, 'user' => $this->user]) ?> + renderTemplate('list-entry.phtml', ['driver' => $current, 'user' => $this->user, 'list' => null]) ?>