From 2c60281ab4102551d46dc793a1ca35af9ad5f9c0 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 14 Jan 2022 19:39:02 +0000 Subject: [PATCH] Bug 29889: Incorrect library check in patron message deletion logic This patch corrects the logic controlling whether a patron message on the circulation or patron details page has a "Delete" link. An error in the logic prevented messages from being removed by staff who should have been authorized to do so. To reproduce the bug, check that your AllowAllMessageDeletion preference is disabled. - In the staff client, check out to a patron whose home library doesn't match the library you're logged in at. - Add a message to the patron's account. - You should see no "Delete" link next to the newly-added message. - If you edit the patron so that their home library matches the library you're logged in at the delete link will appear. To test, apply the patch and follow the steps above. The delete link should aways appear if the message was left by someone logged in at the same library. Signed-off-by: Jonathan Druart Signed-off-by: Fridolin Somers --- koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc index 72e747bd14..0c1d8f88dc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc @@ -217,7 +217,7 @@ [% END %] "[% patron_message.message | html %]" - [% IF patron_message.branchcode == patron.branchcode OR Koha.Preference('AllowAllMessageDeletion') %] + [% IF patron_message.branchcode == Branches.GetLoggedInBranchcode OR Koha.Preference('AllowAllMessageDeletion') %] Delete [% END %] -- 2.39.5