https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383

--- Comment #48 from Tomás Cohen Arazi (tcohen) <[email protected]> ---
Created attachment 209581
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209581&action=edit
Bug 42383: (QA follow-up) Keep the ONLYMESSAGE keyword out of check-in messages

UpdateNotForLoanStatusOnCheckin accepts ONLYMESSAGE as a rule value,
meaning 'display the not for loan status, do not change it'.
_attach_messages_to_checkin passed the AddReturn NotForLoanStatusUpdated
hash through as the not_for_loan_status_updated payload, so for those
rules the API reported { from => X, to => 'ONLYMESSAGE' } and the
check-in page had to know the syspref keyword to render it.

This patch makes _attach_messages_to_checkin translate that case into
its own not_for_loan_status_notice message, with a { status } payload.
not_for_loan_status_updated is only used for actual changes, and its
'to' is always a not for loan value. The $messages hash returned by
AddReturn (used by SIP) is unchanged.

The check-in page renders the notice with the status description, as
the legacy page did, and no longer checks for 'ONLYMESSAGE'.

Test plan:
1. Apply this patch, rebuild the API bundle and the JS and restart:
   $ ktd --shell
  k$ yarn api:bundle
  k$ yarn build
  k$ restart_all
2. Set UpdateNotForLoanStatusOnCheckin to:
   _ALL_:
     1: ONLYMESSAGE
3. Check out an item, set its not for loan status to 1 and check it in
   on the check-in page
=> SUCCESS: 'Not for loan' is displayed, and the item keeps its status
4. Set UpdateNotForLoanStatusOnCheckin to:
   _ALL_:
     1: 0
5. Repeat step 3
=> SUCCESS: 'Not for loan status updated. Old value: Not for loan. New
   value: Available for loan.' is displayed
6. Run:
  k$ prove t/db_dependent/Circulation.t \
           t/db_dependent/Circulation/issue.t \
           xt/api.t
=> SUCCESS: Tests pass!
7. Sign off :-D

Assisted-by: Opus 5.5 (Anthropic)
Signed-off-by: Brendan Lawlor <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to