Skip to content

Commit

Permalink
Prevent showing list entry notes temporarily for reservation lists (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
LuomaJuha authored Oct 17, 2024
1 parent ba540ab commit fc39ad0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions module/Finna/src/Finna/View/Helper/Root/Record.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
2 changes: 1 addition & 1 deletion themes/finna2/templates/reservationlist/displaylist.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
/** @var \Finna\View\Helper\Root\Record */
$recordHelper = $this->record($current);
?>
<?= $recordHelper->renderTemplate('list-entry.phtml', ['driver' => $current, 'user' => $this->user]) ?>
<?= $recordHelper->renderTemplate('list-entry.phtml', ['driver' => $current, 'user' => $this->user, 'list' => null]) ?>
<?php endforeach; ?>
</form>
</div>
Expand Down

0 comments on commit fc39ad0

Please sign in to comment.