Bug 29889: Incorrect library check in patron message deletion logic
authorOwen Leonard <oleonard@myacpl.org>
Fri, 14 Jan 2022 19:39:02 +0000 (19:39 +0000)
committerKyle Hall <kyle@bywatersolutions.com>
Mon, 7 Feb 2022 11:35:06 +0000 (06:35 -0500)
commit46eef4db9ff3d07817c5b0a2959d7e4df0fe1ab7
tree73217f17ea604048cdb53544f42c9312f02c93d5
parent39ee7666a9de8941f8cfd8dcaca93e04ae3afb55
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 <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc