[Bug 42383] New: Vue-based interface for check-in
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Bug ID: 42383 Summary: Vue-based interface for check-in Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: andrew@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle@bywatersolutions.com Depends on: 24401 Bug 36540 proposes a Vue-based interface or checkout. This bug is for a vue-based checkin page. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24401 [Bug 24401] REST API: Check-in -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |42643 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42643 [Bug 42643] [OMNIBUS] Assorted performance and stability work -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@openfifth.c | |o.uk Blocks|42643 |42959 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42643 [Bug 42643] [OMNIBUS] Assorted performance and stability work https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42959 [Bug 42959] Migrate staff interface functionality from CGI controller + Template Toolkit to REST API + Vue.js -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Initiative type|--- |Epic Target Milestone|--- |26.11 Strategic theme|--- |Modernisation -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Vue-based interface for |Migrate check-in to Vue |check-in | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Migrate check-in to Vue |Migrate check-in page to | |Vue -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |43017 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43017 [Bug 43017] [OMNIBUS] Interface optimization -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |43077 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|43017 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43017 [Bug 43017] [OMNIBUS] Interface optimization https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43077 [Bug 43077] Add encode_claims/decode_claims to Koha::Token -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |blawlor@clamsnet.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Bug 42383 depends on bug 43454, which changed state. Bug 43454 Summary: Add REST endpoint to cancel a transfer (POST /transfers/{transfer_id}/cancellation) https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43454 What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |DUPLICATE -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |43454 Depends on|43454 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43454 [Bug 43454] Add REST endpoint to cancel a transfer (POST /transfers/{transfer_id}/cancellation) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |42443 CC| |tomascohen@gmail.com Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 [Bug 42443] Update transferstoreceive.pl to use the API to fetch transfer information -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|24401 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24401 [Bug 24401] Add POST /checkins endpoint with availability check and confirmation flow -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |43486 URL| |https://github.com/bywaters | |olutions/bywater-koha-devel | |/tree/bug_42383_vuejs_check | |in Status|NEW |Needs Signoff Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43486 [Bug 43486] Add permission-gated patron notification info to the checkin hold.patron embed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #1 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- This is submitted to a branch, because of the many deps and constant required rebases it would pollute the report. Once we get some eyes on it and the dependencies move, I can submit here. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #2 from Lisette Scheer <lisette@bywatersolutions.com> --- Is there a test plan on one of the commits, if so can you link to which one it is here? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Benjamin Daeuber <bdaeuber@cityoffargo.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bdaeuber@cityoffargo.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #3 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- What I did was starting two KTD instances in parallel: ```shell cd ~/git/koha-worktrees/bug_42383 SYNC_REPO=$PWD ktd --proxy --name bug_42383 up -d ``` ```shell cd ~/git/koha SYNC_REPO=$PWD ktd --proxy --name vanille up -d ``` Then I went through all the scenarios to compare the outcome. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #4 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Hi, this is fully implemented as I mentioned on my previous comment. A few more fixes were added in the meantime, mostly cosmetic. I'll try to upload a full test plan. What I did was launching the current version and the new ones in parallel using KTD, and replicating the same scenarios covering all UC from the UC file. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #5 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 206762 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206762&action=edit Test plan -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |zoho.roboto@bywatersolution | |s.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |matt.blenkinsop@openfifth.c |y.org |o.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Alex Carver [Acerock7] <alex@rcls.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |alex@rcls.org --- Comment #6 from Alex Carver [Acerock7] <alex@rcls.org> --- Hiya Tomás-- I'm working through the test plan and wanted to share some things I've found. I'll map them to the same sections in the plan: 1. Core check-in flow I don't see the sidenav when in checkin.pl at all Non-public notes on items do not appear in check-in table, though there is a note column. Public notes also do not appear in my testing. On main, they appear in red in this column. 2. Check in Options "Effective Checkin Date" message does not appear when clicking book drop mode. Book drop mode sets return date as today's date. Double checked that library calendar was set correctly for the logged in library. While using "Specify return date" and using a date earlier than the checkout date, the book stays on the patron record. "Forgive overdue charges" option not available 3. Item Status Alerts NotForLoan status is not updated on Checkin. Tested with _ALL_ 2:0 setting in the syspref -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #7 from Brendan Lawlor <blawlor@clamsnet.org> --- I'm also working through the test plan and comparing to the current checkin page. I also used Claude Opus 5.5 to help analyze the difference between the two and flag possible bugs to look into. Now I am going through the list to verify everything before posting. The side nav issue Alex noted is because checkin.tt still uses Koha.Preference('CircSidebar'), which was removed by bug 42344. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #8 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Hi folks. I'll be travelling tomorrow for KohaCon but I'll try to re-run my side-by-side check and try to address your findings. I didn't know about bug 42344 so, oh well. Thanks for pointing that out! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #9 from Alex Carver [Acerock7] <alex@rcls.org> --- Have a great time at KohaCon!! I've gone through the entire test plan save for one section. Pasting all my findings here to gather them in one place. Forgive the double posting: 1. Core check-in flow Don't see sidenav when in checkin.pl Non-public note does not appear in check-in table, though there is a note column. Public notes also do not appear. 2. Check in Options "Effective Checkin Date" message does not appear when clicking book drop mode. Book drop mode sets return date as today's date "Forgive overdue charges" option not available 3. Item Status Alerts NotForLoan status is not updated on Checkin. Tested with _ALL_ 2:0 4. Holds With HoldsAutoFill set to "Do" I still get the confirmation popup. 5. Transfers With `TransfersBlockCirc` off, and 'AutomaticConfirmTransfer` on, modal appears briefly but disappears before user interacts with it. Unsure if that's intended behavior of these two sysprefs together. 6. Recalls OK 7. Fines and Fees OK 8. Patron Information Patron notes do not appear when an item is checked in. After turning on `AutoClaimReturnStatusOnCheckin` and checking in a claimed book, claim status was removed, but book remained checked out to patron. Book was showing as a resolved claim and a current checkout simultaneously. 9. Confirmation dialogs OK 10. Checked-in items table Print checkin slip opens a popup with the patron checkout page rather than printing a slip. Total checkouts does not appear in the patron column. 11. Book drop / outside return (Repeated from Section 2) "Effective Checkin Date" message does not appear when clicking book drop mode. "Forgive overdue charges" option not available 12. Error states OK 13. API / policy header This part is a little over my head so I'll leave it to others. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #10 from Brendan Lawlor <blawlor@clamsnet.org> --- I used Claude Opus 5.5 to test this with ktd proxy running current main and the bug's branch side by side. Most of the things that it caught I was able to confirm. Here's Claude's findings in order of severity with some notes from me: Tested branch bug_42383_vuejs_checkin on KTD against the full test plan, using real data and a headless browser. Most of the plan passes; the problems are below. FAILURES 1. HoldsAutoFill is ignored (test plan 4.6) With HoldsAutoFill on, the hold found modal still appears and the hold is not filled. Nothing in the new code reads the preference. Legacy returns.pl called ModReserveAffect and requested a transfer when needed. - Confirmed with manual human testing 2. Hold cancellation reason is never saved (4.4) HoldCancellationModal.vue binds r.authorised_value, but /authorised_value_categories/.../authorised_values returns "value". The options have no real value, so no reason is sent to hold_cancellation and the cancelled hold has cancellation_reason NULL. - Confirmed with manual human testing using ktd --dbshell after cancelling a hold 3. Wrong transfers are not repaired (5.4) Item in transit MPL -> FPL, checked in at CPL: the "Wrong transfer detected" modal is correct, but the transfer is left as MPL -> FPL. Legacy returns.pl replaced it (request_transfer with replace => 'WrongTransfer', ignore_limits => 1). "Yes, transfer" can't fix it either: the store only calls transfer_confirmation when entry.transfer_id is set, and it is null here. - Confirmed with Manual testing and verifying in ktd --dbshell. My understanding of the legacy checkin is that whe a wrong transfer is detected the original row in branchtransfers should get a datecancelled and cancellation_reason = 'WrongTransfer'. A new branch transfer should be created for the new transfer with the datesent. 4. Bundle "Confirm checkin and mark missing items as lost" does nothing (9.2) verified_bundle_barcodes is in the API spec (paths/checkins.yaml) but no Perl code reads it. With 2 of 3 bundle items scanned, the missing item was not set to BundleLostValue. Legacy did this in returns.pl (and removed unexpected items from the bundle). The Title and Author columns in the verification table are also empty: the component reads biblio_title / biblio_author, which the items response doesn't provide. - Confirmed with manual human testing. Confirm chekcin and mark missing items as lost does not update the item's lost status. Title and Author don't display in the confirm bundle contents table, and 5. "Remove from bundle" does nothing (3.5) The button in the in_bundle alert (Main.vue) has no click handler; onMessagesClick only handles .resolve-claim-btn. "View host item" also links to the checked-in item's own biblio (latest.item.biblio.biblio_id) rather than the host's. - Confirmed with Manual testing, Remove from bundle button does not work and View host item links to the bundled item instead of host 6. "Print checkin slip" opens the quick slip (10.5) slip-printer.js opens circulation.pl?borrowernumber=X&print=qslip. Legacy opened members/printslip.pl?borrowernumber=X&print=checkinslip. - Confirmed with manual human testing. Also this just opened the route in a new windo, not the actual print dialog 7. Patrons with privacy "Never" (10.5) With AnonymousPatron set, the row shows the anonymous patron's name and offers "Print checkin slip" for the anonymous patron. The embedded checkout is already anonymised (privacy 1), so the privacy check never hides the button. - Confirmed with manual human testing. I guess the Anonymous patron name and print checkin slip button should not be displayed in this case 8. Checkout note (issue.note) not shown on a normal return (8.3) The note is in the API response but is only rendered inside ConfirmationModal, so it appears only when a hold/transfer/recall modal opens, and the date is shown as a raw ISO timestamp. Legacy showed the "Patron note" box, with a formatted date, on every return that had one. - Confirmed with manual human testing. It's an ISO timestamp instead of a formatted date, so it's a very minor issue. 9. Circulation sidebar never shows (1.5) checkin.tt still uses Koha.Preference('CircSidebar'), which was removed by bug 42344. All other circ templates now use [% WRAPPER 'main-container.inc' aside='circ-nav' %]. - Confirmed by manual human testing. SMALLER ISSUES - Every normal return gets an "Already returned" badge. It comes from the WasReturned message, which just means the checkout was returned; legacy never displayed it. - Confirmed by manual human testing. It should just say 'Returned' - Hold for another library (4.3): the modal says "Hold at <library>" / "Confirm hold (Y)" rather than "Transfer to" / "Confirm hold and transfer", because the response has no needs_transfer message. The transfer itself is created correctly on confirm. - Confirmed by manual human testing - Ignore (I) on a hold modal marks the row "Not checked in" although the item was checked in (dismissPending is used for post-checkin actions as well). -Confirmed by manual human testing - Re-checking in an item already waiting for a hold (4.5): the modal doesn't say the hold is already waiting (legacy: "Hold found (item is already waiting)"). - Confirmed by manual human testing. No item is already waiting message' - "No, don't transfer (N)" cancels the transfer, but the row still shows "Transferred" and "Transfer to <library>". - Confirmed by manual human testing - Invalid barcode shows "Item not found"; legacy showed "No item with barcode: X". - Confirmed with manual human testing - UpdateNotForLoanStatusOnCheckin: shown only as a raw "not for loan status updated" badge, without the from/to values. - Patron column: the name is not a link and there is no checkouts count (checkouts_count isn't embedded). - Confirmed by manual human testing - When a lost item is returned and a new overdue fine is charged, both "refund applied" and "refund applied and new overdue charge calculated" are shown; legacy showed one (IF/ELSIF). - "Forgive fees for manually expired holds" is emitted by CheckinOptions but never sent by the store. - Koha::Module::Policy::Checkin sets recalls_enabled from preference('UseRecalls') ? 1 : 0, which is true for 'off'. It should compare with ne 'off'. Nothing in the Vue code reads it yet. PASSED - Core flow: scan, barcode clears and refocuses, fast scans processed independently (newest first), not checked out, RecordLocalUseOnReturn. - Options: book drop (warning highlight, fine uses the drop-box date), forgive overdue charges, return date override, "Remember return date", book drop and forgive combined; exempt_fine hidden without updatecharges: writeoff, and a forced request gets a 403 with X-Koha-Module-Policy (payload exempt_fine = 0). - BlockReturnOfWithdrawnItems / BlockReturnOfLostItems blocking modals and the withdrawn warning; UpdateNotForLoanStatusOnCheckin changes the status. - Hold found modal details (patron, category, address, phone, email, SMS, restricted, address in doubt, notification methods, main contact method), confirm (waiting), confirm for another library (transfer created), Print slip and confirm, WaitingNotifyAtCheckin. - Transfers: blocking and non-blocking modals, scanning while a modal is open, print transfer slip, AutomaticConfirmTransfer, transfer arrived, AllowReturnToBranch=homebranch blocking. - Recalls: modal details, confirm (waiting), confirm with transfer (in_transit). - Lost fee refunded / remains / charged, processing fee message, FineNotifyAtCheckin with payment link. - Restriction messages (new, previously restricted, indefinite), return claim warning, resolve claim modal (PUT /return_claims/{id}/resolve), AutoClaimReturnStatusOnCheckin. - CircConfirmItemParts confirm and deny; bundle verification modal UI, progress counter, confirm without verifying, cancel. - Table: TablesSettings column hiding, numReturnedItemsToShow cap, overdue flag, Blocked / Not checked in indicators. - Network error message and retry; the page and the API are refused without circulate_remaining_permissions. - API: GET /checkins/availability (blockers/confirms/warnings, no side effects), POST by item_id and external_id, 412 with confirmation token then 200, 400 without an identifier, 404 for an unknown item; hold_confirmation, hold_cancellation, transfer_confirmation, transfer_cancellation, recall_confirmation. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #11 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Rechecked all of Alex's feedback in Comment 9. All issues addressed successfully except: "With `TransfersBlockCirc` off, and 'AutomaticConfirmTransfer` on, modal appears briefly but disappears before user interacts with it. Unsure if that's intended behavior of these two sysprefs together." On current main, if TransfersBlockCirc is off the modal is dismissed when one clicks anywhere outside the modal. With these patches, the modal will not go away until one interacts with it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #12 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- (In reply to Andrew Fuerste-Henry from comment #11)
Rechecked all of Alex's feedback in Comment 9. All issues addressed successfully except:
"With `TransfersBlockCirc` off, and 'AutomaticConfirmTransfer` on, modal appears briefly but disappears before user interacts with it. Unsure if that's intended behavior of these two sysprefs together."
On current main, if TransfersBlockCirc is off the modal is dismissed when one clicks anywhere outside the modal. With these patches, the modal will not go away until one interacts with it.
Correcting myself slightly -- the modal isn't dismissed by clicking elsewhere in the window, but it is dismissed by checkin in another item. I don't feel this is a blocker. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #13 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- (In reply to Andrew Fuerste-Henry from comment #12)
(In reply to Andrew Fuerste-Henry from comment #11)
Rechecked all of Alex's feedback in Comment 9. All issues addressed successfully except:
"With `TransfersBlockCirc` off, and 'AutomaticConfirmTransfer` on, modal appears briefly but disappears before user interacts with it. Unsure if that's intended behavior of these two sysprefs together."
On current main, if TransfersBlockCirc is off the modal is dismissed when one clicks anywhere outside the modal. With these patches, the modal will not go away until one interacts with it.
Correcting myself slightly -- the modal isn't dismissed by clicking elsewhere in the window, but it is dismissed by checkin in another item. I don't feel this is a blocker.
I'm starting to think my 'cool idea' of keeping the focus on the input and allowing super quick scanning and async processing was not the best idea, as y'all can see some of this changes as regressions... If you feel I should make it more strictly similar to the old behavior, I can do it tomorrow morning. I really like the current implementation and would like to keep it, though. Mentioning in case it is a strong blocker for y'all. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #14 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- (In reply to Tomás Cohen Arazi (tcohen) from comment #13)
I'm starting to think my 'cool idea' of keeping the focus on the input and allowing super quick scanning and async processing was not the best idea, as y'all can see some of this changes as regressions...
If you feel I should make it more strictly similar to the old behavior, I can do it tomorrow morning. I really like the current implementation and would like to keep it, though. Mentioning in case it is a strong blocker for y'all.
Overall, I like your implementation. I like that one can just keep scanning and the next item makes the modal go away. But I think the user should also be able to just click somewhere outside the modal to make it go away if they don't want to scan another item. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #15 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- (In reply to Brendan Lawlor from comment #10) Checked the issues Brendan found previously, 3 are still problematic:
- UpdateNotForLoanStatusOnCheckin: shown only as a raw "not for loan status updated" badge, without the from/to values.
When updating an item to a not for loan value of 0, the interface just shows 0. Previously, it said "Available for loan"
- When a lost item is returned and a new overdue fine is charged, both "refund applied" and "refund applied and new overdue charge calculated" are shown; legacy showed one (IF/ELSIF).
I didn't get a message about my new overdue fine being calculated. Steps to reproduce: - set a circ rule with an overdue fine - set lost item refund policy to "refund lost item charge and charge new overdue fine" - have an item with a replacement cost - check the item out with a due date in the past - mark the item lost - confirm your patron has a lost fee but no overdue fine - check the item in - there is no message about new overdue charge - confirm your patron's lost fee for refunded and a new overdue charge was created
- "Forgive fees for manually expired holds" is emitted by CheckinOptions but never sent by the store.
When I check the "Forgive fees for manually expired holds" checkbox, my hold would not cancel manually. Steps to recreate: - set a value in ExpireReservesMaxPickUpDelayCharge - place a hold, capture item for hold - from the db, update the hold expirationdate to a date in the past - go to checkin page, check box for "Forgive fees for manually expired holds" - check item in, get "item is already waiting" modal, click Cancel Hold - get hold cancellation reason modal, click Cancel Hold - get "item is already waiting" modal again, repeat until bored -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #17 from Brendan Lawlor <blawlor@clamsnet.org> --- I tested again and all the issues that have been brought up have been addressed. One very minor inconsistency, not blocking: With TransfersBlockCirc and AutomaticItemReturn off, after closing the "Transfer now?" modal with Escape or clicking outside the modal, no transfer is created, but the row still shows the destination library and "Return to home library" in the Transfer to / Transfer reason columns. "No, don't transfer" clears them. This is a big upgrade to the check in page. Nice work Tomás! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #18 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Rebased on top of main now that bug 42418 is pushed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #19 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209552 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209552&action=edit Bug 42383: Add Koha::Module::Policy framework This patch adds a module policy framework that exposes per-module capabilities as signed JWTs in API response headers. This replaces the pattern of dedicated GET /config endpoints (like GET /erm/config) with a reactive, session-scoped mechanism. A module policy is the intersection of: - System preferences (feature toggles) - User permissions (what this staff member can do) - Library context (branch-specific configuration) The JWT is attached to every API response. The client decodes the payload to render appropriate UI controls. The server remains authoritative - the JWT is informational, not an access token. Components: - Koha::Module::Policy - Base class with new(), to_hashref(), as_jwt() - Koha::Module::Policy::Checkin - Checkin module policy with 19 keys covering fines, holds, recalls, transfers, display, and blockers Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Module/Policy.t \ t/db_dependent/Koha/Module/Policy/Checkin.t => SUCCESS: Tests pass 3. Tests cover: - Base class constructor validation - Abstract method enforcement - scope() derivation from class name - Permission-gated capabilities (exempt_fine, forgive_hold_fees) - Superlibrarian vs limited user - JWT generation and payload verification 4. Sign off :-D Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #20 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209553 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209553&action=edit Bug 42383: Add Koha::REST::Plugin::Policy This patch adds a Mojolicious plugin that provides the attach_module_policy helper to any API controller. Usage: $c->attach_module_policy('Checkin'); $c->attach_module_policy('Checkin', { library => $library_id }); The helper dynamically loads the appropriate Koha::Module::Policy subclass, generates the JWT, and sets the X-Koha-Module-Policy response header. This avoids duplicating policy attachment logic across controllers. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/checkins.t => SUCCESS: Tests pass 3. Sign off :-D Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #21 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209554 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209554&action=edit Bug 42383: Add Koha::Checkin->confirm_hold This patch adds a confirm_hold() domain method to Koha::Checkin that sets the trapped hold to waiting. If the pickup library differs from the checkin library, it also creates a transfer and sets it in transit. This moves the logic out of the controller into the domain object, making it testable independently and reusable (e.g. for HoldsAutoFill). Throws Koha::Exceptions::MissingParameter if the checkin has no hold_id. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Checkin.t => SUCCESS: Tests pass 3. Tests cover: - confirm_hold at same library (hold set to waiting, no transfer) - confirm_hold at different library (hold in transit, transfer created) - confirm_hold without hold_id (throws MissingParameter) 4. Sign off :-D Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #22 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209555 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209555&action=edit Bug 42383: Add Koha::Checkin->cancel_hold This patch adds a cancel_hold() domain method to Koha::Checkin that cancels the trapped hold and clears the hold_id on the checkin record. Accepts an optional hashref with a 'reason' key for the cancellation reason (authorised value from HOLD_CANCELLATION). Throws Koha::Exceptions::MissingParameter if the checkin has no hold_id. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Checkin.t => SUCCESS: Tests pass 3. Tests cover: - cancel_hold without reason (no notification) - cancel_hold with reason (letter warning expected, reason stored) - cancel_hold without hold_id (throws MissingParameter) 4. Sign off :-D Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #23 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209556 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209556&action=edit Bug 42383: Add Koha::Checkin->confirm_transfer This patch adds a confirm_transfer() domain method to Koha::Checkin that sets the associated transfer in transit (populates datesent). The method is idempotent — calling it on an already-sent transfer is a no-op. Throws Koha::Exceptions::MissingParameter if the checkin has no transfer_id. No fuzzy fallbacks to item->get_transfer. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Checkin.t => SUCCESS: Tests pass 3. Tests cover: - confirm_transfer sets transfer in transit - confirm_transfer is idempotent on already-sent transfer - confirm_transfer without transfer_id (throws MissingParameter) - Returns $self for chaining 4. Sign off :-D Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #24 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209557 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209557&action=edit Bug 42383: Add Koha::Checkin->cancel_transfer This patch adds a cancel_transfer() domain method to Koha::Checkin that cancels the associated transfer and clears the transfer_id. If UseRecalls is enabled and the item has a recall in transit, the recall transfer is also reverted. Throws Koha::Exceptions::MissingParameter if the checkin has no transfer_id. No fuzzy fallbacks. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Checkin.t => SUCCESS: Tests pass 3. Tests cover: - cancel_transfer cancels the transfer (datecancelled set) - transfer_id cleared on the checkin - cancel_transfer without transfer_id (throws MissingParameter) 4. Sign off :-D Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #25 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209558 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209558&action=edit Bug 42383: Add Koha::Checkin->confirm_recall This patch adds a confirm_recall() domain method to Koha::Checkin that resolves the recall associated with the checkin: - If the recall's pickup library matches the checkin library, sets the recall to waiting with a calculated expiration date. - If the pickup library differs, starts a transfer (sets status to in_transit). The method is idempotent — calling it on an already-resolved recall is a no-op. Throws Koha::Exceptions::MissingParameter if the checkin has no recall_id. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Checkin.t => SUCCESS: Tests pass 3. Tests cover: - confirm_recall at same library (set to waiting + expiration date) - confirm_recall at different library (set to in_transit) - Idempotent on already in-transit recall - confirm_recall without recall_id (throws MissingParameter) 4. Sign off :-D Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #26 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209559 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209559&action=edit Bug 42383: Add checkin sub-resource confirmation/cancellation endpoints Adds the hold/transfer/recall confirmation and cancellation sub-resource endpoints on top of the checkin REST API: * POST /checkins/{checkin_id}/hold_confirmation * POST /checkins/{checkin_id}/hold_cancellation * POST /checkins/{checkin_id}/transfer_confirmation * POST /checkins/{checkin_id}/transfer_cancellation * POST /checkins/{checkin_id}/recall_confirmation Each delegates to the matching Koha::Checkin method and renders a shared 201 response via _render_checkin_response (Location header included). Module policy (X-Koha-Module-Policy) is attached only on the permission error paths (exempt_fine, forgive_hold_fees, return_date), not on success responses: the Vue app is hydrated with the policy at template load time, so recomputing and signing the policy JWT on every successful checkin would waste CPU. The checkin definition gains the full `messages` documentation and the availability definition its confirms/item_parts additions. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove xt/api.t t/db_dependent/api/v1/checkins.t => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #27 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209560 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209560&action=edit Bug 42383: Add checkin messages and item-parts/bundle confirmations Extends the checkin flow with net-new behavior on top of the checkin audit record: * _attach_messages_to_checkin gains three independent messages: - item_type_checkinmsg: the item type's checkin message - patron_has_fines: when FineNotifyAtCheckin is on and the patron who had the item has an outstanding balance - patron_has_waiting_holds: when WaitingNotifyAtCheckin is on and the patron has holds waiting for pickup at the current branch * Koha::Item::Availability::Checkin gains two confirmations: - item_parts: multi-part item (CircConfirmItemParts) needs staff acknowledgement of the accompanying materials - items_bundle: bundle items need content verification The existing blocker/confirmation key names (NotIssued, BlockedWithdrawn, Wrongbranch, BlockedLost) are intentionally left unchanged; renaming them is out of scope here and would ripple into SIP, AddReturn and existing tests. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Circulation.t t/db_dependent/Koha/Item/Availability/Checkin.t t/db_dependent/Koha/Checkin.t => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #28 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209561 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209561&action=edit Bug 42383: Add Vue.js checkin page Adds the Vue-based checkin (returns) page that consumes the checkin REST API and its sub-resource confirmation/cancellation endpoints: * circ/checkin.pl + checkin.tt entry point * Vue module, store and components (BarcodeInput, CheckedInItems, CheckinOptions, ConfirmationModal, ResolveClaimModal, BundleVerificationModal, Main) under vue/components/Circ/Checkin/ * checkin-api-client fetch client, registered in the Vue api-client * rspack: new `checkin` entry building to js/vue/dist/checkin.js * http-client: honour return_response on non-ok responses so callers can inspect the error body/headers * Koha::Checkin->verify_bundle for the bundle verification modal * docs/checkin-vue-usecases.md The Vue app reads its module policy from the page hydration at load time (X-Koha-Module-Policy is not fetched per request). Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ yarn build => SUCCESS: rspack compiles, js/vue/dist/checkin.js is produced 3. Enable the page, go to Circulation -> Check in (checkin.pl), scan a barcode => SUCCESS: item is checked in, confirmations/messages render 4. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #29 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209562 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209562&action=edit Bug 42383: Remove legacy returns.pl, wire checkin.pl Retires the legacy circ/returns.pl checkin page in favour of the new Vue circ/checkin.pl, and repoints every entry point to it: * circ-nav.inc, checkin-search-box.inc, circulation-home.tt, staff-global.js: 'Check in' links/search now target checkin.pl * ILL SupplyingResource.vue: checkin action targets checkin.pl * circ/returns.pl and circ/returns.tt are removed * Main.vue honours a ?barcode= deep-link query param so links carried over from returns.pl keep working (auto-submits the checkin) * basic_workflow.t selenium flow updated to the new page The transfers-to-receive page keeps its bug 42443 AJAX DataTable implementation (it already cancels transfers through the REST API and never linked to returns.pl), so its 42383-era changes are not needed. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ yarn build => SUCCESS: rspack compiles 3. From the circ home, nav sidebar, and header search 'Check in', confirm they all open circ/checkin.pl 4. Visit /cgi-bin/koha/circ/checkin.pl?barcode=<known barcode> => SUCCESS: the item is checked in automatically 5. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #30 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209563 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209563&action=edit Bug 42383: Add tests for checkin sub-resource endpoints and messages Adds API test coverage for the Bug 42383 additions: * sub-resource confirmation endpoints (hold/transfer confirmation and cancellation): not-found, no-associated-resource (400), and the happy paths (201 + Location, hold set waiting, transfer set in transit / cancelled) * add - post-checkin messages: was_lost message serialization; the not-issued case keeps the 24401 confirmation flow (412 confirmation_required) * add - return_date and dropbox_mode coverage * X-Koha-Module-Policy header on error paths: the module policy JWT is attached on the exempt_fine permission error (403), not on success responses (the Vue app is hydrated with the policy at template load) Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/checkins.t => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #31 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209564 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209564&action=edit Bug 42383: Use snake_case for checkin availability keys The checkin availability object (Koha::Item::Availability::Checkin) is surfaced directly to the API through GET /checkins/availability and the 412 confirmation response, so its blocker/confirmation/warning keys are API-facing values and should be standard, meaningful snake_case: NotIssued -> not_issued (confirmation) BlockedWithdrawn -> blocked_withdrawn (blocker) BlockedLost -> blocked_lost (blocker) Wrongbranch -> wrong_branch (blocker) { Wrongbranch, Rightbranch } -> { wrong_branch, right_branch } The keys are now documented in the checkin_availability definition. AddReturn keeps consuming the availability object internally, and still exposes its own legacy $messages hashref (Wrongbranch => { Wrongbranch, Rightbranch }, NotIssued, ...) unchanged, so C4::SIP and existing AddReturn callers/tests are unaffected: the snake_case values are mapped back to the legacy structure where AddReturn builds $messages. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Item/Availability/Checkin.t \ t/Koha/Result/Availability.t \ t/db_dependent/api/v1/checkins.t \ t/db_dependent/Circulation.t \ t/db_dependent/SIP/Transaction.t \ xt/api.t => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #32 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209565 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209565&action=edit Bug 42383: (follow-up) Match the legacy hold/transfer checkin modals Bring the Vue checkin confirmation modal in line with the legacy returns page for the hold and transfer cases: - Show the item as a "Title (barcode)" heading, linked to moredetail.pl - Show the patron note recorded on the checkout - Show library names and the "Hold at" / "Checked in at" headings - Match the legacy hold modal title and "Hold for" layout - Match the legacy transfer modal behaviour - Offer hold cancellation from the hold modal via a secondary (nested) modal rather than an inline action Test plan: 1. Exercise hold-found and transfer checkins on the Vue checkin page => SUCCESS: the confirmation modal matches the legacy returns page 2. From a hold-found checkin, cancel the hold => SUCCESS: cancellation is confirmed through a secondary modal 3. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #33 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209566 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209566&action=edit Bug 42383: (follow-up) Show item type checkin message text The check in message area rendered the item_type_checkinmsg message as the raw "item type checkinmsg" key. Render its payload text instead (the item type's configured checkin message), matching what the legacy returns.pl dialog shows in its dedicated box. Test plan: 1. Apply patch, yarn build 2. Set a checkin message on an item type; check in such an item => SUCCESS: the modal shows the actual checkin message text 3. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #34 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209567 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209567&action=edit Bug 42383: (follow-up) Flesh out the recall found checkin modal The recall modal was a stub (title + an empty "Recall found" line). Bring it in line with the legacy returns.pl recall dialog: * "Recall placed by:" bulleted patron block (name link, address, phone, email) from the embedded recall.patron. * Recall notes, when present. * "Transfer required for recall" hint when the recall needs a transfer. * "Recall at <library name>" heading from the recall pickup library. * Add the "Ignore (I)" button alongside Confirm / Print and confirm. Test plan: 1. Apply patch, yarn build 2. Recall an item (UseRecalls) checked out to another patron, then check it in => SUCCESS: the modal shows who placed the recall, the pickup library, and Confirm / Print and confirm / Ignore 3. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #35 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209568 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209568&action=edit Bug 42383: (follow-up) Show patron notification info in hold and recall modals The legacy returns page shows how the patron will be notified in the hold and recall confirmation dialogs. Consume the notification_summary embed (Bug 43486) to render the same detail: - "Patron notification: Email, SMS." (or "Patron is not notified.") - "Main contact method: ..." The hold modal uses the Hold_Filled transports; the recall modal uses the Recall_Waiting transports (the notice that fires when a recall is set waiting on checkin). The boxes are styled like the legacy page. This wires hold.patron.notification_summary and recall.patron.notification_summary into the checkin embed (client and swagger enum) and renders the lines in ConfirmationModal. Test plan: 1. Have a patron with a Hold_Filled and/or Recall_Waiting messaging preference set, and place a hold/recall 2. Check the item in, yarn build => SUCCESS: the confirmation modal shows the patron notification line and the main contact method, matching the legacy returns page 3. Try a patron with no messaging preference => SUCCESS: the modal shows "Patron is not notified." in a grey box 4. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #36 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209569 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209569&action=edit Bug 42383: (follow-up) Match legacy behaviour for blocked, bundle, waiting-hold, claim and local-use checkins Round out the Vue checkin page so the remaining returns.pl use cases match the legacy behaviour: - Blocked check-ins (e.g. wrong branch) open a "Cannot check in" modal with the destination library and accompanying-materials note - The bundle verification status column is consistent (Verified / Not verified / Lost) - The waiting-holds alert names the patron (via the checkout.patron embed) and is shown first - The return-claim modal shows the lost/fee check-in messages inline and uses the standard button palette and "Ignore" idiom - Not-issued items are checked in directly via x-koha-override, recording local use when RecordLocalUseOnReturn is set - "Print slip and confirm" for holds and recalls ports bug 42505: an empty popup is opened during the click (so it is not blocked) and the hold slip is only loaded into it after the confirm_hold/confirm_recall call succeeds, so waitingdate/expirationdate are current on the first print. The popup is closed if the confirmation fails. Test plan: 1. Exercise each of the above checkin scenarios on the Vue checkin page => SUCCESS: behaviour and layout match the legacy returns page 2. Set HoldsAutoFill to "Don't", add Waiting since: [% hold.waitingdate | $KohaDates %] to the HOLD_SLIP notice, check in an item with a hold for the check-in library and click "Print slip and confirm" => SUCCESS: The popup is not blocked and the slip shows today's waiting date on the first print 3. prove t/db_dependent/api/v1/checkins.t => SUCCESS 4. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #37 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209570 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209570&action=edit Bug 42383: (QA follow-up) Restore legacy post-return processing in the checkin API QA testing (comments 9 and 10) found several things returns.pl did after AddReturn that POST /checkins did not. This patch adds them: - HoldsAutoFill: when a hold is found (and not already waiting) the hold is now filled on checkin, as returns.pl did, using Koha::Checkin->confirm_hold. A 'hold_auto_filled' message is added so the client can skip the hold modal. - Wrong transfers: a new Koha::Checkin->replace_wrong_transfer replaces the transfer with one from the checkin library (replace => 'WrongTransfer', ignore_limits => 1) and links it to the checkin, so transfer_confirmation/transfer_cancellation work on it. - Bundles: verified_bundle_barcodes is now processed. verify_bundle also sets datelastborrowed, records a return claim and charges the replacement fee (WhenLostChargeReplacementFee) for missing items, like returns.pl. 'bundle_missing_items' and 'bundle_unexpected_items' messages report the outcome. The patron is the one returned by AddReturn, as the stored checkout may already be anonymized. - Koha::Checkin->cancel_hold honours forgive_hold_fees (it was accepted by the endpoint but ignored), charging the cancellation fee otherwise. - The in_bundle message payload now carries the host biblio id and barcode, so the client can link to the host record. - checkout.patron.checkouts+count can be embedded. - The checkin module policy exposes dropbox_date and anonymous_patron_id, and recalls_enabled is now false when UseRecalls is 'off' (it was always true). Koha::Checkin->cancel_transfer had the same UseRecalls check. Test plan: 1. Apply this patch 2. Run: $ ktd --shell k$ yarn api:bundle k$ restart_all k$ prove t/db_dependent/Koha/Checkin.t \ t/db_dependent/api/v1/checkins.t \ t/db_dependent/Koha/Module/Policy/Checkin.t \ t/db_dependent/Circulation.t \ xt/api.t => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #38 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209571 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209571&action=edit Bug 42383: (QA follow-up) Address check-in page QA findings This patch addresses the check-in page findings from QA (comments 9 and 10), using the API changes from the previous patch: - Sidebar: checkin.tt used the CircSidebar preference, removed by bug 42344, so the circulation sidebar never showed. - Notes column: read the API keys (staff_notes, public_notes, internal_notes) so patron and item notes are displayed. - Patron column: link the patron and show the checkouts count (checkout.patron.checkouts+count). Anonymized checkouts (privacy "Never") no longer show the AnonymousPatron or a checkin slip button. - Print checkin slip opens members/printslip.pl?print=checkinslip. - Book drop mode shows the effective checkin date. - HoldsAutoFill: auto-filled holds don't open the hold modal; a "Hold filled for" box with a Print button is shown, and the slip is printed when HoldsAutoFillPrintSlip is set. - AutomaticConfirmTransfer: the transfer modal no longer confirms itself after a second. As on the legacy page, a non-blocking transfer is confirmed when staff move on (scan the next item). - Hold cancellation: the reason is now sent (wrong authorised value key) together with "Forgive fees for manually expired holds". - "Ignore" on hold, recall and claim modals keeps the row as checked in instead of marking it "Not checked in". - "No, don't transfer" clears the transfer from the row. - Hold modal: "Transfer to" / "Confirm hold and transfer" for holds at another library, and "Hold found (item is already waiting)". - Bundles: the verification table shows title and author, all scanned barcodes are sent (unexpected items are removed from their bundle), missing and unexpected items are reported, "Remove from bundle" works and links to the host record. - Messages: no "Already returned" badge on every return, a single lost item fee outcome (as the legacy IF/ELSIF), not for loan and shelving location changes show old and new values, the checkout note is shown on every return with a formatted date, and an unknown barcode shows "No item with barcode: X". - Values interpolated into the message boxes are HTML-escaped. Test plan: 1. Apply this patch and rebuild: $ ktd --shell k$ yarn js:build k$ restart_all 2. Go to Circulation -> Check in and repeat the scenarios from the QA comments 9 and 10, comparing with the legacy page on main => SUCCESS: Behaviour matches the legacy page 3. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #39 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209572 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209572&action=edit Bug 42383: (QA follow-up) Fix check-in page findings from browser testing This patch fixes differences with the legacy returns.pl page found by testing both pages side by side in the browser. Changes: - Main.vue: a transfer modal disables the barcode input when TransfersBlockCirc is set, so a scanner cannot check in the next item behind it. The input is focused again once the transfer is resolved. - ConfirmationModal.vue: "Cancel hold" is only offered for holds that are already waiting, as on the legacy page. On an unconfirmed record-level hold it failed with a 500 (Koha::Hold->cancel needs an item to calculate the cancellation fee). - stores/checkin.js: confirming a hold that needs a transfer shows the transfer (destination and reason) on the row. - CheckedInItems.vue: due and acquisition dates are formatted with $date() (dateformat syspref) instead of the browser locale. - POST /checkins accepts the item+strings, hold.patron+strings and recall.patron+strings embeds. The table shows shelving location, item type and collection descriptions, and the hold/recall modals show the patron category description, instead of the codes. - The transfer modal no longer shows "Already returned": was_returned is set on every return and the legacy page never displayed it. - Patron card numbers are shown next to the patron names. - The item type check-in message gets a label in the status column. - The print button reads "Print slip, transfer, and confirm (P)" when the hold needs a transfer, as on the legacy page. Test plan: 1. Apply patch and rebuild: $ ktd --shell k$ yarn api:bundle && yarn js:build && restart_all 2. Set TransfersBlockCirc to "Block", AutomaticItemReturn to "Do", HoldsAutoFill to "Don't", and set your browser language to one that uses day/month dates (e.g. Spanish) 3. Check out to a patron: an item from another library (A), an item with a shelving location (B), an item with a record-level hold for pickup at another library (C) 4. Go to Circulation > Check in, check in A => SUCCESS: The transfer modal shows, the barcode input is disabled => SUCCESS: No "Already returned" message in the modal 5. Scan B with the modal open => SUCCESS: Nothing is checked in 6. Click "Yes, transfer" => SUCCESS: The barcode input is enabled and focused 7. Check in B => SUCCESS: Dates follow the dateformat syspref => SUCCESS: Shelving location and item type show their descriptions => SUCCESS: The patron card number is shown 8. Check in C => SUCCESS: The patron category description and card number show => SUCCESS: There is no "Cancel hold" button => SUCCESS: The print button reads "Print slip, transfer, and confirm" 9. Click "Confirm hold and transfer" => SUCCESS: The row shows the destination library and "Hold" reason 10. Check in an item with a waiting hold, click "Cancel hold", pick a reason and confirm => SUCCESS: The hold is cancelled with the chosen reason 11. Run: k$ prove t/db_dependent/api/v1/checkins.t xt/api.t => SUCCESS: Tests pass! 12. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #40 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209573 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209573&action=edit Bug 42383: (QA follow-up) Ask to transfer when AutomaticItemReturn is disabled When an item checked in needs to go back to another library and AutomaticItemReturn is disabled, AddReturn does not create a transfer and only reports NeedsTransfer. The legacy page asked "Transfer now?" and created the transfer on "Yes". The new page showed no modal at all, so there was no way to start the transfer from the check-in page. This patch: - Makes Koha::Checkin->confirm_transfer accept to_library_id and reason. If the checkin has no transfer yet, it requests one to that library (reason defaults to Manual) and sets it in transit. - Makes POST /checkins/{checkin_id}/transfer_confirmation accept an optional body with to_library_id and reason. It returns 400 if there is no transfer and no valid library, and 409 if the transfer is not allowed by the branch transfer limits or one is already pending. - Makes the check-in page show the transfer modal for needs_transfer, with "Transfer now?" and a "No, don't transfer" button. "Yes" requests the transfer using the destination and reason the checkin reported. Test plan: 1. Set AutomaticItemReturn to "Don't automatically transfer" 2. Check out an item whose home library is not your logged in library 3. Go to Circulation > Check in and check the item in => FAIL: No modal is shown, the transfer cannot be started 4. Apply this patch, rebuild and restart: $ ktd --shell k$ yarn api:bundle && yarn js:build && restart_all 5. Repeat steps 2 and 3 => SUCCESS: The modal asks "Transfer now?" 6. Click "Yes, transfer" => SUCCESS: The row shows the transfer, the item is in transit to its home library (check the item details page) 7. Repeat steps 2 and 3, click "No, don't transfer" => SUCCESS: No transfer is created, the row shows no transfer 8. Run: k$ prove t/db_dependent/Koha/Checkin.t \ t/db_dependent/api/v1/checkins.t \ xt/api.t => SUCCESS: Tests pass! 9. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #41 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209574 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209574&action=edit Bug 42383: (QA follow-up) Format restriction and return dates on the check-in page This patch fixes the remaining dates on the check-in page that did not follow the dateformat syspref: - The "Patron is now restricted" and "Patron was earlier restricted" messages now include the restriction end date, formatted with $date() as the legacy page did with $KohaDates. They used to omit the date. - The "Return date" badge shown while the options panel is collapsed displayed the raw ISO date (2026-10-10). It is now formatted. Test plan: 1. Apply patch and rebuild: $ ktd --shell k$ yarn js:build && restart_all 2. Set the 'Suspension in days' circulation rule to 1 and check out an overdue item to a patron (e.g. backdate the checkout) 3. Go to Circulation > Check in and check the item in => SUCCESS: "Patron is now restricted until <date>." uses the dateformat syspref 4. Check in another overdue item of the same patron => SUCCESS: "Reminder: Patron was earlier restricted until <date>." uses the dateformat syspref 5. Enable SpecifyReturnDate, open the check-in settings, pick a return date and collapse the settings => SUCCESS: The "Return date" badge uses the dateformat syspref 6. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #42 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209575 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209575&action=edit Bug 42383: Do not set a hold aside for an item checked out in the meantime Bug 43803 made ModReserveAffect return 0 and leave the hold untouched when the item has been checked out again while the hold confirmation was pending (e.g. from another workstation). The legacy returns.pl displayed a warning and skipped the transfer in that case, but Koha::Checkin->confirm_hold ignored the return value: it created and sent a transfer to the pickup library for an item that is on loan, and the hold_confirmation endpoint reported success. This patch makes Koha::Checkin->confirm_hold throw the new Koha::Exceptions::Checkin::ItemCheckedOut exception (before any transfer is created) when ModReserveAffect refuses the hold, and makes POST /checkins/{checkin_id}/hold_confirmation return 409 with the 'item_checked_out' error code. The check-in page shows the error and keeps the hold pending. Test plan: 1. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Checkin.t \ t/db_dependent/api/v1/checkins.t => SUCCESS: Tests pass! 2. Make sure HoldsAutoFill is disabled 3. Place an item-level hold on an item checked out to patron A (hold for patron B, pickup at a different library) 4. Go to Circulation > Check in, check in the item => SUCCESS: The "Hold found" modal appears. Leave it open 5. From another tab, check out the item to patron C, confirming the checkout without cancelling the hold 6. Back on the first tab, click "Confirm hold" => SUCCESS: An error is displayed: "The item has been checked out in the meantime: the hold has not been set aside and remains pending" => SUCCESS: The hold is still pending and no transfer was created 7. Check the item in again and confirm the hold => SUCCESS: The hold is set in transit to the pickup library 8. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #43 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209576 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209576&action=edit Bug 42383: (QA follow-up) Close non-blocking transfer modals on click outside or Escape With TransfersBlockCirc disabled, the legacy returns.pl transfer modals had no static backdrop: clicking outside of them or pressing Escape closed them, and with AutomaticConfirmTransfer enabled closing them confirmed the transfer. On the Vue check-in page the only way out of a non-blocking transfer modal was one of its buttons, or scanning the next item. This patch makes ConfirmationModal emit 'close' when a non-blocking transfer modal gets a click outside of the dialog or an Escape key press. Main.vue then confirms the transfer if the checkin has one and AutomaticConfirmTransfer is enabled, and otherwise moves on leaving the transfer as it is. Blocking transfer modals (TransfersBlockCirc enabled) and the other modals are unchanged. Test plan: 1. Apply this patch and rebuild the JS: $ ktd --shell k$ yarn build 2. Set TransfersBlockCirc to "Don't block" and AutomaticConfirmTransfer to "Do" 3. Put an item in transit to library A, and check it in at library B (wrong transfer) => SUCCESS: The "Please return item to A" modal shows 4. Click anywhere outside of the modal => SUCCESS: The modal closes => SUCCESS: The item shows as in transit to A on its details page 5. Repeat 3, press Escape instead of clicking outside => SUCCESS: Same as step 4 6. Set AutomaticConfirmTransfer to "Don't" and repeat 3 and 4 => SUCCESS: The modal closes and the transfer is not sent 7. Click inside the modal (e.g. on its text) => SUCCESS: The modal stays open 8. Set TransfersBlockCirc to "Block" and repeat 3 and 4 => SUCCESS: The modal stays open until one of its buttons is used 9. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #44 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209577 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209577&action=edit Bug 42383: (QA follow-up) Show 'Available for loan' for a not for loan value of 0 When UpdateNotForLoanStatusOnCheckin sets an item's not for loan status to 0, the check-in page displayed the raw '0' as the new value. The avDescription helper only treated undef and the empty string as 'Available for loan', while the legacy returns.tt treated any false value (including 0) that way. This patch adds notForLoanDescription, which shows 'Available for loan' for any value that is not a non-zero number, and locationDescription for the UpdateItemLocationOnCheckin message. The latter also fixes an empty shelving location being displayed as 'Available for loan': it now shows 'Blank', as the legacy page did. Test plan: 1. Set UpdateNotForLoanStatusOnCheckin to: BK: 1: 0 2. Check out a BK item, then set its not for loan status to 1 3. Check the item in on the check-in page => FAIL: The message reads 'Not for loan status updated. Old value: ... New value: 0.' 4. Apply this patch and rebuild the JS: $ ktd --shell k$ yarn build 5. Repeat steps 2 and 3 => SUCCESS: The new value reads 'Available for loan' 6. Set UpdateItemLocationOnCheckin to: _BLANK_: CART and check in an item with no shelving location => SUCCESS: The old value reads 'Blank' 7. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #45 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209578 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209578&action=edit Bug 42383: (QA follow-up) Show the new overdue charge message on lost returns With the lost item refund policy 'Refund lost item charge and charge new overdue fine', AddReturn reports both lost_item_fee_refunded and lost_item_fee_charged. The check-in page shows a single lost fee outcome, picking the first one found in a list that started with lost_item_fee_refunded, so the new overdue charge was never mentioned. This patch makes lost_item_fee_charged and lost_item_fee_restored take precedence over lost_item_fee_refunded. Their texts already state that the lost item charge was refunded. Test plan: 1. Set a circulation rule with an overdue fine and finesMode to 'Calculate and charge' 2. Set the lost item refund policy (Default lost item fee refund on return policy) to 'Refund lost item charge and charge new overdue fine' 3. Check out an item with a replacement cost and a due date in the past, then mark it lost 4. Check the item in on the check-in page => FAIL: Only 'A refund for the lost item charge has been applied to the borrowing patron's account.' is displayed 5. Apply this patch and rebuild the JS: $ ktd --shell k$ yarn build 6. Repeat steps 3 and 4 => SUCCESS: The message also says 'and new overdue charge has been calculated and applied', and it is displayed only once 7. Check the patron's account => SUCCESS: The lost fee was refunded and a new overdue fine created 8. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #46 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209579 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209579&action=edit Bug 42383: (QA follow-up) Add tests for forgive_hold_fees on hold_cancellation This patch adds tests for POST /checkins/{checkin_id}/hold_cancellation with forgive_hold_fees. They highlight that the endpoint rejects the parameter: the request body schema does not allow it, so the request fails with a 400 and the hold is never cancelled. The tests cover: - 403 (no_permission_for_forgive_hold_fees) without updatecharges.writeoff - No ExpireReservesMaxPickUpDelayCharge fee when the fees are forgiven - The fee being charged when they are not Test plan: 1. Apply this patch 2. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/checkins.t => FAIL: Tests fail! The forgive_hold_fees requests return 400 3. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #47 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209580 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209580&action=edit Bug 42383: (QA follow-up) Allow forgiving fees when cancelling a hold on check-in With 'Forgive fees for manually expired holds' checked, cancelling a waiting hold from the check-in page did nothing and the hold modal kept coming back. The page sends forgive_hold_fees to POST /checkins/{checkin_id}/hold_cancellation, but the request body schema did not include it and has additionalProperties: false, so the request was rejected with a 400. The error was swallowed by the store, the check-in stayed pending and its modal was shown again. This patch: - Adds forgive_hold_fees to the hold_cancellation body schema. The controller already handled it, including the updatecharges.writeoff permission check. - Makes the check-in store report a failed hold, transfer or recall action in the page error box, so a rejected action is no longer silently retried. Test plan: 1. Set ExpireReservesMaxPickUpDelayCharge to 5 2. Place a hold and check the item in to set it waiting 3. Set the hold's expiration date in the past: $ ktd --dbshell k> UPDATE reserves SET expirationdate = '2026-01-01' WHERE reserve_id = X; 4. On the check-in page, open the settings and check 'Forgive fees for manually expired holds' 5. Check the item in, click 'Cancel hold', then 'Cancel hold' in the cancellation pop-up => FAIL: The 'Hold found (item is already waiting)' modal comes back and the hold is not cancelled 6. Apply this patch, rebuild the API bundle and the JS and restart: $ ktd --shell k$ yarn api:bundle k$ yarn build k$ restart_all 7. Repeat steps 4 and 5 => SUCCESS: The hold is cancelled, the modal closes and the patron is not charged the expired hold fee 8. Run: k$ prove t/db_dependent/api/v1/checkins.t xt/api.t => SUCCESS: Tests pass! 9. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #48 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- 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 <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #49 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209582 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209582&action=edit Bug 42383: (QA follow-up) Clear the suggested transfer when closing 'Transfer now?' With AutomaticItemReturn disabled, the check-in only suggests a transfer (needs_transfer message) and the 'Transfer now?' modal asks whether to create it. Closing that modal with Escape or by clicking outside it created no transfer, as expected, but the row kept showing the suggested destination and reason in the 'Transfer to' and 'Transfer reason' columns. 'No, don't transfer' cleared them. This patch makes closing the modal without a transfer behave like 'No, don't transfer'. Closing a modal for an existing transfer is unchanged: it is confirmed when AutomaticConfirmTransfer is set, and left pending otherwise. Test plan: 1. Set TransfersBlockCirc and AutomaticItemReturn to "Don't" 2. Check in an item whose home library is not the current library => SUCCESS: The 'Transfer now?' modal is displayed 3. Press Escape => FAIL: No transfer is created, but the row still shows the home library and 'Return to home library' in the transfer columns 4. Apply this patch and rebuild the JS: $ ktd --shell k$ yarn build 5. Repeat steps 2 and 3, then once more clicking outside the modal instead of pressing Escape => SUCCESS: No transfer is created and the transfer columns are empty 6. Repeat step 5 with AutomaticConfirmTransfer set to "Do" => SUCCESS: Same result, no transfer is created 7. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #50 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Initial QA feedback: 1) http-client.js line 44 you're early returning if return_response is set but we already default every DELETE and COUNT request in all Vue modules to return this so those endpoints will now skip the existing error handling. Either needs its own checkin specific flag or the error handling needs re-thinking 2) XSS in Main.vue - the checkin message is customisable in the staff interface and is then put directly into v-html with no parsing. In the old TT version html_line_break was used to filter the message but we have no fallback here 3) Fetching the page can checkin an item - checkout an item and then paste the following into the browser with the barcode of that item: localhost:8081/cgi-bin/koha/circ/checkin.pl?barcode=<barcode>. A checkin will be handled silently and will appear in the database table but not in the UI. This used to be a CSRF protected POST but now fires on a page GET 4) No barcode filtering - Legacy code called barcodedecode - itemBarcodeInputFilter and the item_barcode_transform plugin hook also no longer apply to check-in through the Checkins.pm endpoints 5) Holds queue not updated - BatchUpdateBiblioHoldsQueue isn't called anywhere in the process flow and skip_holds_queue is passed through the AddReturn flow so the holds queue never reflects the check-in 6) audio-alert classes are added but playSound is never called after the initial page load 7) printAndResolveRecall, ConfirmationModal.vue line 966 - pulls the reserve_id from recallInfo but recallInfo doesn't carry a reserve_id property payload => { recall_id => $recall->id, needs_transfer => $messages->{RecallNeedsTransfer} ? 1 : 0, }, 8) xt/tt_script_tidy.t fails 9) No cypress tests - some of the existing Selenium tests are no longer robust, for example basic_workflow.t matches a static page title which exists before the Vue page has even mounted so is no longer actually proving anything. The Selenium tests either need updating or replacing with Cypress tests. This is a huge re-write for which good test coverage is critical 10) ModReserveAffect no longer receives a desk_id - any waiting hold will lose their desk 11) If MarkIssueReturned anonymises a patron record, when _attach_messages_to_checkin access $checkin->checkout->patron it is accessing the anonymous patron and not the actual patron involved. Any fines or waiting holds are incorrectly notified 12) Checkin.pm line 265 you throw an error based on the unless condition but ModReserveAffect can either return 0 or silently return if the hold isn't found (e.g. was deleted). This seems like if could incorrectly throw the exception in some cases 13) The /checkins/*_confirmation and /checkins/*_cancellation endpoints seem like they should probably require the same JWT confirmation flow as some of the work in bug 24401? These could be used to alter holds or transfers multiple days after they are created 14) Koha/Manual.pm needs updating to the new page URLs 15) ResolveClaimModal.vue uses the fetch api instead of the APIClient pattern. It also emits 'resolved' regardless of the response status which is then marked as a success further up the chain, even if a 4/500 error is thrown by the API 16) CheckinOptions.vue specifies MM/DD/YYYY which conflicts with Koha's date formatting options. The date is also no validated, should this use a flatpickr window? 17) checkin.js - fetch used for libraries which already have an APIClient - APIClient is already imported in the file. There are also multiple error strings throughout the file which aren't wrapped for translations - please check and update them 18) Missing translation wrapper in ConfirmationModal.vue line 799 19) TODO in ConfirmationModal.vue line seems like a regression/missing feature - is there a follow-up for this? 20) ConfirmationModal.vue line 799 - should this use patron_to_html to format the name? Same in CheckedInItems.vue line 442 21) recall_confirmation API method has no unit test 22) Policy.pm - the global keys are added to the hash before the subclass which means they can be overwritten. Should this not be reversed? 23) JWT is used for Module::Policy classes but the signature is never read in the UI. Either we need to check the signature or move away from JWT as it isn't adding anything -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off --- Comment #51 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Thanks a lot Matt! One follow-up per point, so you can review them one by one: 1) Make returning error responses opt-in in HttpClient - new return_error_response flag, only used by checkins.create. DELETE/COUNT behave as before. 2) Escape the item type check-in message (escaped, then newlines to <br>, like html_line_break). 3) Do not check in items from the barcode URL param - ?barcode= only prefills the input now. 4) Apply barcode filters on check-in by barcode (barcodedecode in POST /checkins). 5) Update the holds queue on check-in (BatchUpdateBiblioHoldsQueue when RealTimeHoldsQueue is on; hold cancellation already enqueues via Koha::Hold->cancel). 6) Play audio alerts after each check-in (and when a confirmation modal opens). 7) Print the recall pickup slip for recalls (uses recall_id). 8) Fix xt/tt_script_tidy.t for circ/checkin.tt. 9) Add Cypress tests for the check-in page - 10 end-to-end tests on real data, outcomes verified in the DB: simple check-in, unknown barcode, ?barcode= prefill, escaped checkin message, blocked (withdrawn), hold here, hold elsewhere + transfer, hold cancellation, return transfer with TransfersBlockCirc, recall. Also: Make basic_workflow.t check in for real (drives the Vue page and checks the DB). Writing them uncovered: Do not return $__ from the check-in components (Vue warning on every mount), and a 43486 Cypress patron-data issue, fixed there. 10) Set confirmed holds waiting at the check-in desk. 11) Use the returning patron for check-in notices (regression test included). 12) Tell 'hold not found' from 'item on loan' - 409 hold_not_found vs item_checked_out. 13) Two patches: Reject follow-up actions on stale checkins (409 stale_checkin if it is not the item's latest checkin), and Require a token for checkin follow-up actions - POST /checkins returns action_tokens (JWT tied to checkin, staff user and action, 15 minutes) and the 5 sub-resource endpoints require it. 14) Map the check-in page to the manual. 15) Use the API client to resolve return claims (only reports success on success). 16) Show the configured date format for the return date (it was already flatpickr). 17) Use APIClient for libraries and translate store strings. 18) and 20) Format patron names with $patron_to_html (also makes 'Patron #%s' translatable). 19) Restore hold group handling in the hold modal (group info, 'View patron's holds', 'Cancel all holds in hold group'). 21) Add API tests for recall_confirmation. 22) Prevent module policies from overriding globals. 23) Send module policies as plain JSON - agreed, the JWT added nothing there. Known leftovers, happy to file separate bugs: - Cancelling a record-level hold (no item assigned) with a cancellation fee raises a 500 in Koha::Hold->cancel; the legacy page had the same code path. - Column visibility settings and export buttons for the checked-in table are not there yet. Setting back to Signed Off for your re-review. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #52 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209603 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209603&action=edit Bug 42383: (QA follow-up) Map the check-in page to the manual This patch renames the 'circ/returns' key in Koha::Manual's mapping to 'circ/checkin', as circ/returns.pl has been replaced by circ/checkin.pl. Without it, the 'Help' link on the new check-in page points to the manual's main page instead of the check-in section. It addresses point 14 of the QA comment. Test plan: 1. Go to Circulation > Check in 2. Click the 'Help' link on the top right => FAIL: The manual's front page opens 3. Apply this patch and restart plack: $ ktd --shell k$ koha-plack --restart kohadev 4. Repeat 2 => SUCCESS: The manual opens on the 'Check in (returning)' section 5. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #53 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209604 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209604&action=edit Bug 42383: (QA follow-up) Prevent module policies from overriding globals This patch makes Koha::Module::Policy->to_hashref add the 'global' namespace after the subclass's _build_hashref keys. Before, the global keys were added first, so a subclass returning a 'global' key would silently replace them, contradicting the POD which states the global keys cannot be overridden by subclasses. A to_hashref() subtest is added, using a dummy subclass that tries to override 'global'. It addresses point 22 of the QA comment. Test plan: 1. Apply the tests only 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Module/Policy.t => FAIL: The subclass overrides the global namespace 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #54 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209605 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209605&action=edit Bug 42383: (QA follow-up) Apply barcode filters on check-in by barcode This patch makes POST /checkins run the passed external_id through C4::Circulation::barcodedecode before looking up the item. This applies the itemBarcodeInputFilter system preference and the item_barcode_transform plugin hook, as the legacy circ/returns.pl did. Before this patch, a barcode needing transformation (e.g. one scanned with spaces when itemBarcodeInputFilter is 'whitespace') could not be checked in, and returned a 404. It addresses point 4 of the QA comment. Test plan: 1. Set the itemBarcodeInputFilter system preference to 'Remove spaces from' 2. Check out an item to a patron 3. Go to Circulation > Check in 4. Check in the item, typing its barcode with a space in the middle => FAIL: 'No item with barcode' is displayed 5. Apply this patch and restart plack: $ ktd --shell k$ koha-plack --restart kohadev 6. Repeat 4 => SUCCESS: The item is checked in 7. Run: k$ prove t/db_dependent/api/v1/checkins.t => SUCCESS: Tests pass! 8. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #55 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209606 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209606&action=edit Bug 42383: (QA follow-up) Update the holds queue on check-in This patch makes POST /checkins enqueue a BatchUpdateBiblioHoldsQueue background job for the item's record when RealTimeHoldsQueue is enabled, as the legacy circ/returns.pl did. AddReturn passes skip_holds_queue internally, so without this the real-time holds queue was never refreshed after a check-in from the new page. The job is enqueued when: - the item was returned (legacy did it after AddReturn), or - a hold was found for the item. The legacy page enqueued the job when the staff chose 'Ignore' on the hold modal. The new page dismisses the hold modal client-side without calling the API, so the update is done at check-in time instead. Cancelling the hold found already updates the queue, as Koha::Hold->cancel enqueues the job itself. Confirming it did not update the queue in legacy either. It addresses point 5 of the QA comment. Test plan: 1. Enable RealTimeHoldsQueue 2. Check out an item and go to Administration > Jobs, note the number of 'Update holds queue for biblios' jobs 3. Check the item in on the check-in page 4. Reload the jobs page => FAIL: No new 'Update holds queue for biblios' job 5. Apply this patch and restart plack: $ ktd --shell k$ koha-plack --restart kohadev 6. Repeat 2 to 4 => SUCCESS: A new job is listed for the item's record 7. Run: k$ prove t/db_dependent/api/v1/checkins.t => SUCCESS: Tests pass! 8. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #56 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209607 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209607&action=edit Bug 42383: (QA follow-up) Set confirmed holds waiting at the check-in desk This patch makes Koha::Checkin->confirm_hold pass the checkin's desk_id to ModReserveAffect, so a hold confirmed (or auto-filled through HoldsAutoFill) on the check-in page is set waiting at the desk the staff member is using, as the legacy circ/returns.pl did. The checkin row already records the desk from the user environment. It addresses point 10 of the QA comment. Test plan: 1. Enable UseCirculationDesks and create a desk for your library 2. Set the desk for your session (Set library and desk) 3. Place an item level hold for a patron, pickup at your library 4. Check the item in on the check-in page and confirm the hold 5. Look at the hold on the record's holds page => FAIL: The waiting hold has no desk 6. Apply this patch and restart plack: $ ktd --shell k$ koha-plack --restart kohadev 7. Repeat 3 to 5 => SUCCESS: The hold is waiting at your desk 8. Run: k$ prove t/db_dependent/Koha/Checkin.t => SUCCESS: Tests pass! 9. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #57 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209608 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209608&action=edit Bug 42383: (QA follow-up) Tell 'hold not found' from 'item on loan' This patch makes Koha::Checkin->confirm_hold handle the three possible ModReserveAffect return values explicitly: - 1: the hold was set aside (success) - 0: the item is on loan and the hold is not waiting. A Koha::Exceptions::Checkin::ItemCheckedOut exception is thrown, as before - undef: the hold was not found. A new Koha::Exceptions::Checkin::HoldNotFound exception is thrown Before, an undef return was reported as 'item checked out', which was misleading. The hold not being found means it was cancelled or filled between the check-in and the confirmation (e.g. from another workstation): this is a conflict with the current state rather than a no-op, as the staff member asked for something that did not happen, so it is reported. confirm_hold now also throws HoldNotFound when the checkin's hold is gone before calling ModReserveAffect, instead of dying on an undefined value. POST /checkins/{checkin_id}/hold_confirmation maps HoldNotFound to a 409 response with the 'hold_not_found' error_code. It addresses point 12 of the QA comment. Test plan: 1. Apply this patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Checkin.t \ t/db_dependent/api/v1/checkins.t => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #58 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209609 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209609&action=edit Bug 42383: (QA follow-up) Use the returning patron for check-in notices This patch makes AddReturn pass the patron the item was checked out to down to _attach_messages_to_checkin, which uses it for the patron_has_fines (FineNotifyAtCheckin) and patron_has_waiting_holds (WaitingNotifyAtCheckin) messages. Before, those messages were built from $checkin->checkout->patron. The checkin's checkout is the old_issues row, which MarkIssueReturned has already anonymised for patrons with privacy set to 'Never' (when AnonymousPatron is set). The messages were then computed for, and pointed to, the anonymous patron instead of the patron who returned the item. It addresses point 11 of the QA comment. Test plan: 1. Set AnonymousPatron to an existing patron, and enable FineNotifyAtCheckin and WaitingNotifyAtCheckin 2. Pick a patron with no fines, set their privacy to 'Never'. Give them a manual fee and a waiting hold at your library 3. Check out an item to them, then check it in on the check-in page => FAIL: No fines or waiting holds message is displayed 4. Apply this patch and restart plack: $ ktd --shell k$ koha-plack --restart kohadev 5. Repeat 3 => SUCCESS: The fines and waiting holds messages are displayed and link to the right patron 6. Run: k$ prove t/db_dependent/Circulation.t => SUCCESS: Tests pass! 7. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #59 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209610 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209610&action=edit Bug 42383: (QA follow-up) Add API tests for recall_confirmation This patch adds tests for POST /checkins/{checkin_id}/recall_confirmation in line with the existing hold and transfer sub-resource tests. They cover: - 404 when the checkin does not exist - 403 when the user lacks the circulate permission - 400 when the checkin has no recall - 201 setting the recall waiting at the checkin library - 201 setting the recall in transit when the pickup library differs It addresses point 21 of the QA comment. Test plan: 1. Apply this patch 2. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/checkins.t => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #60 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209611 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209611&action=edit Bug 42383: (QA follow-up) Reject follow-up actions on stale checkins This patch makes the checkin follow-up endpoints refuse to act on a checkin that is not the latest checkin of its item: - POST /checkins/{checkin_id}/hold_confirmation - POST /checkins/{checkin_id}/hold_cancellation - POST /checkins/{checkin_id}/transfer_confirmation - POST /checkins/{checkin_id}/transfer_cancellation - POST /checkins/{checkin_id}/recall_confirmation Before, they only checked the permission and that the checkin existed, so an old checkin_id could be used to alter holds, transfers or recalls long after the item had circulated again. A new Koha::Checkin->is_latest method tells whether a later checkin exists for the item. The endpoints now return a 409 with the 'stale_checkin' error_code when it is not the latest. The shared lookup is done in a new _get_actionable_checkin controller helper. It addresses point 13 (a) of the QA comment. Test plan: 1. Apply this patch 2. Run: $ ktd --shell k$ yarn api:bundle k$ prove t/db_dependent/Koha/Checkin.t \ t/db_dependent/api/v1/checkins.t \ xt/api.t => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #61 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209612 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209612&action=edit Bug 42383: (QA follow-up) Require a token for checkin follow-up actions This patch makes the checkin follow-up endpoints require a short-lived signed token, issued when checking in, tied to the checkin, the staff member and the action: - POST /checkins/{checkin_id}/hold_confirmation - POST /checkins/{checkin_id}/hold_cancellation - POST /checkins/{checkin_id}/transfer_confirmation - POST /checkins/{checkin_id}/transfer_cancellation - POST /checkins/{checkin_id}/recall_confirmation It reuses the bug 24401 mechanism (Koha::Token generate_jwt/check_jwt, as for the checkin and checkout confirmation tokens). Changes: - Koha::Checkin->pending_actions returns the follow-up actions offered for the checkin (hold found, transfer triggered or needed, recall found) - Koha::Checkin->action_tokens returns a token for each of them, valid for 15 minutes (ACTION_TOKEN_EXPIRY_SECONDS) - Koha::Checkin->check_action_token validates a token - POST /checkins returns the tokens in a new 'action_tokens' attribute, an object keyed by action name - The endpoints above take a required 'action_token' query parameter, and return a 403 with the 'invalid_action_token' error_code when it is not valid for the checkin, user and action, or has expired - The check-in page passes the token of the action it performs Together with the stale checkin check, a checkin_id can no longer be used to alter holds, transfers or recalls outside of the check-in it was returned from. It addresses point 13 (b) of the QA comment. Test plan: 1. Apply this patch, rebuild the API bundle and the Vue files, and restart plack: $ ktd --shell k$ yarn api:bundle k$ yarn js:build k$ koha-plack --restart kohadev 2. Place a hold on an item, check it out to another patron 3. Check the item in on the check-in page and confirm the hold => SUCCESS: The hold is set waiting 4. Repeat 2 and 3, cancelling the hold instead => SUCCESS: The hold is cancelled 5. Repeat with a transfer and a recall => SUCCESS: They are confirmed/cancelled as expected 6. Run: k$ prove t/db_dependent/Koha/Checkin.t \ t/db_dependent/api/v1/checkins.t \ xt/api.t => SUCCESS: Tests pass! 7. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #62 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209613 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209613&action=edit Bug 42383: (QA follow-up) Send module policies as plain JSON This patch drops the JWT serialization of module policies. The policy was signed with Koha::Token->encode_claims and sent in the X-Koha-Module-Policy header on some error responses, but nothing ever verified the signature: the page bootstraps from the plain JSON policy injected by circ/checkin.tt, and the client just base64-decoded the JWT payload. The signature added complexity and suggested a guarantee that did not exist. The policy is informational (the server validates every action), so it is now sent as a plain JSON object in the X-Koha-Module-Policy header, the same representation the page is bootstrapped with: - Koha::Module::Policy->as_jwt is removed - Koha::REST::Plugin::Policy sets the header to the JSON-encoded to_hashref - The check-in page parses the header as JSON - POD, OpenAPI header descriptions and tests are updated Koha::Token->encode_claims and decode_claims are kept, as the bug 24401 availability tokens use them. It addresses point 23 of the QA comment. Test plan: 1. Apply this patch, rebuild the API bundle and the Vue files, and restart plack: $ ktd --shell k$ yarn api:bundle k$ yarn js:build k$ koha-plack --restart kohadev 2. Log in as a staff member with the writeoff permission, open the check-in page and tick 'Forgive overdue charges' 3. In another tab, remove the updatecharges > writeoff permission from that staff member 4. Check in a checked out item on the first tab => SUCCESS: The check-in is refused and the 'Forgive overdue charges' option is no longer offered 5. Run: k$ prove t/db_dependent/Koha/Module/Policy.t \ t/db_dependent/Koha/Module/Policy/Checkin.t \ t/db_dependent/Koha/REST/Plugin/Policy.t \ t/db_dependent/api/v1/checkins.t \ xt/api.t => SUCCESS: Tests pass! 6. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #63 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209614 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209614&action=edit Bug 42383: (QA follow-up) Do not check in items from the barcode URL param The check-in page kept the legacy ?barcode= deep link working by submitting a check-in for it on page load. That turns a GET request into a state change: any link or embedded resource pointing at circ/checkin.pl?barcode=XXX checks the item in for the logged in staff user. The legacy page required a CSRF protected POST (op=cud-checkin). This patch (QA comment point 3) makes the page only prefill the barcode input with the parameter value and focus it. Staff need to press 'Check in' (or Enter) to actually check the item in. A setBarcode() method is added to the BarcodeInput component for this. Test plan: 1. Check out an item to a patron 2. Visit /cgi-bin/koha/circ/checkin.pl?barcode=<the item barcode> => FAIL: The item is checked in on page load 3. Check the item out again 4. Apply this patch and rebuild: $ ktd --shell k$ yarn js:build k$ restart_all 5. Repeat step 2 => SUCCESS: The barcode input contains the barcode and has the focus => SUCCESS: Nothing is checked in, the item is still checked out 6. Press Enter => SUCCESS: The item is checked in 7. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #64 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209615 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209615&action=edit Bug 42383: (QA follow-up) Escape the item type check-in message The check-in page renders its alert boxes with v-html. Every value interpolated into them is escaped, except the item type check-in message (itemtypes.checkinmsg) used for the item_type_checkinmsg message, which was rendered as raw HTML. The legacy page displayed it with the html_line_break filter, which escapes the text and turns line breaks into <br>. This patch (QA comment point 2) escapes the message and converts its line breaks into <br>, matching the legacy rendering. The other alert boxes already escape the API provided data they interpolate. Test plan: 1. Go to Administration > Item types and edit the type of an item. Set 'Checkin message' to: <b>Bold</b><img src=x onerror=alert('XSS')> Second line 2. Check the item out, then check it in on the check-in page => FAIL: 'Bold' is rendered bold and a JS alert pops up 3. Apply this patch and rebuild: $ ktd --shell k$ yarn js:build k$ restart_all 4. Repeat step 2 => SUCCESS: The message is displayed literally, with the HTML tags visible, no alert pops up and 'Second line' is on its own line 5. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #65 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209616 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209616&action=edit Bug 42383: (QA follow-up) Make returning error responses opt-in in HttpClient The check-in page needs the raw response of POST /checkins for error statuses too (412 confirmation, 403 blocked, 404 not found), so an earlier patch made HttpClient::_fetchJSON return the response object for non-2xx responses whenever return_response was set. But delete() and count() default return_response to true, so every DELETE and count request in the Vue apps stopped going through the error handling: errors were no longer thrown nor reported with setError(), and callers treated failures as successes. This patch (QA comment point 1) restores the previous behaviour for return_response and adds a separate return_error_response parameter, false by default. It is only passed by post(), and only the check-in client (checkins.create) sets it. Test plan: 1. Apply this patch and rebuild: $ ktd --shell k$ yarn js:build k$ restart_all 2. Check in items on the check-in page, including: - an item that is not checked out - a barcode that does not exist - an item that requires a confirmation (e.g. a lost item with BlockReturnOfLostItems set) => SUCCESS: The page behaves as before: the right messages, modals and confirmation prompts are displayed 3. In the ERM module, try deleting an agreement that cannot be deleted (e.g. edit it in another tab and delete it there first, then delete it again from the first tab) => SUCCESS: The error is displayed at the top of the page, as it was before the check-in patches 4. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #66 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209617 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209617&action=edit Bug 42383: (QA follow-up) Play audio alerts after each check-in The check-in page marks the latest row with the audio-alert-warning or audio-alert-success classes, and the confirmation modal with audio-alert-action, so the default AudioAlerts selectors match them. But js_includes.inc only looks for the configured selectors and calls playSound() once, on document ready. The legacy page was reloaded after every check-in so it played a sound each time; the Vue page never did. This patch (QA comment point 6) adds a playAudioAlert() helper to the check-in page, which repeats the js_includes.inc logic: it walks window.AUDIO_ALERTS in precedence order and plays the sound of the first selector found in the page. It is called once the result of each check-in has been rendered, and when the next pending modal is opened after resolving one. The error box displayed for unknown barcodes and failed requests also gets the audio-alert-warning class, so these produce the warning sound like on the legacy page. Test plan: 1. Enable the AudioAlerts system preference 2. On the check-in page, check in: - an item that is checked out - a barcode that does not exist - an item with a hold on it => FAIL: No sound is played 3. Apply this patch and rebuild: $ ktd --shell k$ yarn js:build k$ restart_all 4. Repeat step 2 (check items out and place the hold again) => SUCCESS: The 'beep' sound plays for the normal check-in => SUCCESS: The 'critical' sound plays for the unknown barcode => SUCCESS: The 'opening' sound plays when the hold modal opens 5. Disable AudioAlerts and repeat step 2 => SUCCESS: No sound is played 6. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #67 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209618 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209618&action=edit Bug 42383: (QA follow-up) Print the recall pickup slip for recalls The 'Print slip and confirm (P)' button of the recall modal used recallInfo.reserve_id (falling back to the checkin hold_id) to load the hold transfer slip. The recall_found message payload only contains recall_id and needs_transfer, so no slip was ever printed, or the wrong one was. The legacy page opened recalls/recall_pickup_slip.pl?recall_id=X. This patch (QA comment point 7) adds a recallSlipUrl() helper to slip-printer.js and makes the button load the recall pickup slip for the payload recall_id, once the recall has been confirmed (same as the hold slip). Test plan: 1. Enable UseRecalls and set up circulation rules allowing recalls 2. Check an item out to patron A, then place a recall on it for patron B from the OPAC 3. Check the item in on the check-in page => SUCCESS: The recall modal is displayed 4. Click 'Print slip and confirm (P)' => FAIL: No slip, or an empty / wrong slip, is displayed 5. Apply this patch and rebuild: $ ktd --shell k$ yarn js:build k$ restart_all 6. Repeat steps 2 to 4 with a new item => SUCCESS: The recall is confirmed and the recall pickup slip for patron B is displayed in a popup 7. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #68 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209619 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209619&action=edit Bug 42383: (QA follow-up) Use the API client to resolve return claims The 'Resolve return claim' modal of the check-in page called PUT /api/v1/return_claims/{claim_id}/resolve with a raw fetch() and emitted 'resolved' whatever the response was. Failures (e.g. a missing permission or a claim deleted in the meantime) were silently reported as success and the modal closed. This patch (QA comment point 15) adds a return_claims.resolve() method to ClaimAPIClient, built on HttpClient.put() like the other API clients, and uses it from the modal through APIClient. 'resolved' is only emitted when the request succeeds; otherwise the error is displayed in the modal, which stays open. Test plan: 1. Set ClaimReturnedLostValue to a lost value 2. Check an item out to a patron and, from the patron's checkouts table, mark it as 'Claim returned' 3. Check the item in on the check-in page 4. Click 'Resolve' on the row, pick a resolution and click 'Resolve claim' => SUCCESS: The claim is resolved 5. Repeat steps 2 to 3, open the resolve modal and, before submitting it, delete the claim from the patron's 'Claims' tab in another browser tab. Submit the modal => FAIL: The modal closes as if the claim had been resolved 6. Apply this patch and rebuild: $ ktd --shell k$ yarn js:build k$ restart_all 7. Repeat steps 2 to 4 => SUCCESS: The claim is resolved and the modal closes 8. Repeat step 5 => SUCCESS: The modal stays open and displays the error returned by the API 9. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #69 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209620 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209620&action=edit Bug 42383: (QA follow-up) Fix xt/tt_script_tidy.t for circ/checkin.tt xt/tt_script_tidy.t checks that inline <script> blocks of templates do not contain Template::Toolkit tags, unless they are explicitly allowed. circ/checkin.tt passes the module policy, the library and the table settings to the Vue app through a <script> block with TT tags, which made the test fail. This patch (QA comment point 8) marks that block with data-tt-allowed="true", like other templates (e.g. recalls/request.tt) do for script blocks that only expose server side values to JS. Test plan: 1. Run: $ ktd --shell k$ prove xt/tt_script_tidy.t => FAIL: The test fails for koha-tmpl/intranet-tmpl/prog/en/modules/circ/checkin.tt 2. Apply this patch and repeat step 1 => SUCCESS: Tests pass 3. Restart and load the check-in page: $ ktd --shell k$ restart_all => SUCCESS: The page loads and items can be checked in 4. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #70 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209621 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209621&action=edit Bug 42383: (QA follow-up) Show the configured date format for the return date The check-in settings panel labelled the return date input 'Specify return date (MM/DD/YYYY):' whatever the dateformat system preference was. The input is a flatpickr date picker that uses the configured format, so the hint was wrong for every format but 'us'. The legacy page used date-format.inc to display the configured format. This patch (QA comment point 16) builds the hint from flatpickr_dateformat_string, set by calendar.inc from the dateformat system preference, so it reads e.g. DD/MM/YYYY, DD.MM.YYYY or YYYY-MM-DD as date-format.inc does. If it is not available, the label is displayed without a format. Test plan: 1. Enable SpecifyReturnDate and set dateformat to 'dd/mm/yyyy' 2. On the check-in page, open the check-in settings (sliders icon) => FAIL: The label reads 'Specify return date (MM/DD/YYYY):' 3. Apply this patch and rebuild: $ ktd --shell k$ yarn js:build k$ restart_all 4. Reload the page and open the settings => SUCCESS: The label reads 'Specify return date (DD/MM/YYYY):' 5. Try the other dateformat values => SUCCESS: The label matches the format used by the date picker 6. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #71 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209622 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209622&action=edit Bug 42383: (QA follow-up) Use APIClient for libraries and translate store strings The check-in Pinia store fetched the libraries list with a raw fetch('/api/v1/libraries?_per_page=-1') while APIClient, which has a library client, is already imported and used for authorised values. It also set some user visible error messages as plain, untranslatable strings. This patch (QA comment point 17) loads the libraries through APIClient.library.libraries.getAll() and wraps the remaining English strings of the store with $__(). Test plan: 1. Apply this patch and rebuild: $ ktd --shell k$ yarn js:build k$ restart_all 2. Check an item whose home library is not the logged in library in on the check-in page, with AutomaticItemReturn enabled => SUCCESS: The 'Transfer to' column and the transfer modal show the home library name (not its code) 3. Check the store strings are picked up for translation: $ ktd --shell k$ cd misc/translator k$ perl translate update fr-FR k$ grep -A1 'Network error. Please try again.' po/fr-FR-messages-js.po => SUCCESS: The string is listed 4. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #72 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209623 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209623&action=edit Bug 42383: (QA follow-up) Format patron names with $patron_to_html The check-in page built patron names by hand from surname and firstname in several places: the 'Returned by' column of the check-in table, the hold and recall patron in the confirmation modal, and the 'Hold filled for' and waiting holds alert boxes. This ignores the preferred name, middle name, other name and the 'A patron from X' fallback that the rest of the staff interface displays, and prints 'undefined' for patrons without a first name. The 'Patron #X' fallback was also not translatable. This patch (QA comment points 18 and 20) uses the global $patron_to_html helper, as other Vue components do, with invert_name (Surname, Firstname) and the card number where it was shown before. The 'Returned by' column uses its url option for the link to the patron's details page. 'Patron #%s' is wrapped with $__(). $patron_to_html escapes the patron data, so the names are rendered with v-html and no longer go through escapeHtml in the alert boxes. Test plan: 1. Create a patron with a first name, a middle name and a preferred name, and another one with only a surname 2. Check out items to both patrons, check them in on the check-in page => FAIL: The 'Returned by' column shows 'Surname, Firstname (card)', ignoring the preferred and middle names, and 'Surname, undefined' for the patron without a first name 3. Place a hold on an item for the first patron and check it in => FAIL: The hold modal shows the patron name built by hand too 4. Apply this patch and rebuild: $ ktd --shell k$ yarn js:build k$ restart_all 5. Repeat steps 2 and 3 => SUCCESS: Names are displayed as in the rest of the staff interface (e.g. 'Surname, Preferredname Middlename (cardnumber)'), linking to the same pages as before => SUCCESS: The patron without a first name shows only the surname 6. Repeat step 3 with HoldsAutoFill enabled => SUCCESS: The 'Hold filled for:' box shows the formatted name 7. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #73 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209624 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209624&action=edit Bug 42383: (QA follow-up) Restore hold group handling in the hold modal When DisplayAddHoldGroups is enabled and the hold found on check-in is part of a hold group, the legacy check-in page: - displayed 'Part of a hold group:' with a 'View patron's holds' link to the patron's holds, in the hold found modals - offered, for waiting holds, a 'Cancel all holds in hold group (X)' button calling POST /api/v1/patrons/{patron_id}/hold_groups/ {hold_group_id}/cancel with the selected cancellation reason, and labelled the single hold cancellation button 'Cancel this hold (X)' instead of 'Cancel hold (X)' The Vue page only had a TODO for it. This patch (QA comment point 19) ports that behaviour: - The hold group id comes from the embedded hold (hold.hold_group_id), already requested by the check-in client, and the display_hold_groups module policy flag (DisplayAddHoldGroups). No back-end change is needed. - A hold_groups.cancel() method is added to PatronAPIClient. - 'Cancel all holds in hold group' opens the existing cancellation pop-up, which asks for confirmation and the cancellation reason, and calls the new cancelHoldGroup() store action. On success the row is marked as checked in; on failure the error is displayed and the hold modal stays pending. Test plan: 1. Enable DisplayAddHoldGroups 2. Place a hold group for a patron on two records (staff interface, Place hold, search the patron, select 2 records and check 'Treat as hold group') 3. Check in an item of the first record => SUCCESS: The 'Hold found' modal is displayed => FAIL: There is no mention of the hold group 4. Confirm the hold, then check the item in again => FAIL: The 'Hold found (item is already waiting)' modal only offers 'Cancel hold (X)' 5. Apply this patch and rebuild: $ ktd --shell k$ yarn js:build k$ restart_all 6. Repeat step 4 => SUCCESS: The modal shows 'Part of a hold group:' and a 'View patron's holds' link opening the patron's holds in a new tab => SUCCESS: The buttons read 'Cancel all holds in hold group (X)' and 'Cancel this hold (X)' 7. Click 'Cancel all holds in hold group (X)', pick a reason and confirm => SUCCESS: The row is marked as checked in, and the patron's holds page shows both holds of the group as cancelled 8. Repeat steps 2 to 4 with DisplayAddHoldGroups disabled => SUCCESS: No hold group information is shown, and the button reads 'Cancel hold (X)' 9. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #74 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209625 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209625&action=edit Bug 42383: (QA follow-up) Do not return $__ from the check-in components The check-in components returned the $__ translation function from setup(). Vue reserves the '$' prefix for its internals and logs a warning on each mount in development builds: [Vue warn]: setup() return property "$__" should not start with "$" or "_" which are reserved prefixes for Vue internals. The function is already available to the templates as a global property, registered by the @koha-vue/i18n plugin the check-in app uses. This patch removes it from the setup() return values of the Circ/Checkin components. The Cypress support file fails the tests on any console warning, so this was making the check-in page Cypress tests fail. Test plan: 1. Run: $ ktd --shell k$ yarn js:build 2. Open the browser console and go to Circulation > Check in => FAIL: The Vue warning about "$__" is logged 3. Apply this patch, repeat 1 and 2 => SUCCESS: No warning 4. Check in some items, open the settings panel => SUCCESS: All the strings are displayed as before 5. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #75 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209626 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209626&action=edit Bug 42383: (QA follow-up) Add Cypress tests for the check-in page This patch adds end-to-end Cypress tests for the Vue check-in page (circ/checkin.pl), addressing point 9 of the QA comment. The data is created in the database using the Cypress tasks, the page is driven like staff would do it, and the outcome is verified in the database. The tests cover: - Checking in a checked out item: the row is displayed with the barcode and title, and the checkout is moved to old_issues - An unknown barcode displays an error - The barcode URL parameter prefills the input but does not check the item in - The item type check-in message is displayed as text, not HTML - A withdrawn item is not checked in with BlockReturnOfWithdrawnItems - Holds: confirming a hold for the logged in library sets it waiting, confirming a hold for another library puts it in transit with a transfer, and a waiting hold can be cancelled from the hold modal - Transfers: confirming the return to the home library sends the transfer, and TransfersBlockCirc blocks the barcode input meanwhile - Recalls: confirming a recall sets it waiting The system preferences used are set by each test, and restored to their original values afterwards. All the created data is removed. Test plan: 1. Apply this patch 2. Run: $ ktd --shell k$ yarn cypress run --spec t/cypress/integration/Circulation/Checkin_spec.ts => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #76 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209627 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209627&action=edit Bug 42383: (QA follow-up) Make basic_workflow.t check in for real The check-in step of basic_workflow.t loaded circ/checkin.pl with the barcode URL parameter and checked the page title. The new page does not check in items from the URL anymore, and the title is rendered before the Vue app is even mounted, so this proved nothing. This patch addresses point 9 of the QA comment by making the test drive the Vue page like staff would: it waits for the app to be mounted, types each barcode, submits the form and waits for the item to be listed in the checked in items table, along with its title. It then checks in the database that the patron has no checkouts left. Test plan: 1. Apply this patch 2. Run: $ ktd --selenium up -d $ ktd --shell k$ prove -v t/db_dependent/selenium/basic_workflow.t => SUCCESS: Tests pass! The check-in tests now list the barcodes 3. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #77 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Good progress here, just a few more follow-up points: 1) The error handling in confirm_hold has improved with the exceptions but there is an instance where it is called in Checkins.pm (line 258) with no try/catch block to handle these exceptions. The method would 500 error with no message bubbling back to the UI and the holds queue and bundle logic would be skipped 2) I think confirm_hold should maybe be wrapped in a transaction? There are multiple writes and if any exception is thrown in the transfer logic a hold could be stranded in transit with no transfer applied to it 3) onClaimResolved just looks for the first claim row in the table, it doesn't match the claim_id of the claim that was actually resolved - could create mismatches. The id should be passed with the emit and matched 4) CheckinOptions.vue the return-date-override formatting is much better but in the legacy code there was a block on entering dates in the future which we are now missing, as well as the ability to set the time 5) X-Koha-Module-Policy header is only defined in 2** response schemas but appears to be used on 403 responses where it isn't defined 6) The Location header for the /checkins/* endpoints doesn't resolve - it would return Location: /api/v1/checkins/1/hold_confirmation/1 which is appending an unnecessary id param to the end of the URL -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #78 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Re-uploaded the whole series. While working on point 23 we reworked the module policy design: instead of a header (signed JWT, then plain JSON), the policy is now returned as an optional, well-defined 'policy' attribute of the error object (module_policy envelope with typed 'global' and 'checkin' blocks, validated against the spec), the same structure the page is bootstrapped with. As it was a design change, it is folded into the original patches that introduced the policy code, so the 'Prevent module policies from overriding globals' and 'Send module policies as plain JSON' follow-ups are gone. All the other QA follow-ups are unchanged and still one per point. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #209552|0 |1 is obsolete| | Attachment #209553|0 |1 is obsolete| | Attachment #209554|0 |1 is obsolete| | Attachment #209555|0 |1 is obsolete| | Attachment #209556|0 |1 is obsolete| | Attachment #209557|0 |1 is obsolete| | Attachment #209558|0 |1 is obsolete| | Attachment #209559|0 |1 is obsolete| | Attachment #209560|0 |1 is obsolete| | Attachment #209561|0 |1 is obsolete| | Attachment #209562|0 |1 is obsolete| | Attachment #209563|0 |1 is obsolete| | Attachment #209564|0 |1 is obsolete| | Attachment #209565|0 |1 is obsolete| | Attachment #209566|0 |1 is obsolete| | Attachment #209567|0 |1 is obsolete| | Attachment #209568|0 |1 is obsolete| | Attachment #209569|0 |1 is obsolete| | Attachment #209570|0 |1 is obsolete| | Attachment #209571|0 |1 is obsolete| | Attachment #209572|0 |1 is obsolete| | Attachment #209573|0 |1 is obsolete| | Attachment #209574|0 |1 is obsolete| | Attachment #209575|0 |1 is obsolete| | Attachment #209576|0 |1 is obsolete| | Attachment #209577|0 |1 is obsolete| | Attachment #209578|0 |1 is obsolete| | Attachment #209579|0 |1 is obsolete| | Attachment #209580|0 |1 is obsolete| | Attachment #209581|0 |1 is obsolete| | Attachment #209582|0 |1 is obsolete| | Attachment #209603|0 |1 is obsolete| | Attachment #209604|0 |1 is obsolete| | Attachment #209605|0 |1 is obsolete| | Attachment #209606|0 |1 is obsolete| | Attachment #209607|0 |1 is obsolete| | Attachment #209608|0 |1 is obsolete| | Attachment #209609|0 |1 is obsolete| | Attachment #209610|0 |1 is obsolete| | Attachment #209611|0 |1 is obsolete| | Attachment #209612|0 |1 is obsolete| | Attachment #209613|0 |1 is obsolete| | Attachment #209614|0 |1 is obsolete| | Attachment #209615|0 |1 is obsolete| | Attachment #209616|0 |1 is obsolete| | Attachment #209617|0 |1 is obsolete| | Attachment #209618|0 |1 is obsolete| | Attachment #209619|0 |1 is obsolete| | Attachment #209620|0 |1 is obsolete| | Attachment #209621|0 |1 is obsolete| | Attachment #209622|0 |1 is obsolete| | Attachment #209623|0 |1 is obsolete| | Attachment #209624|0 |1 is obsolete| | Attachment #209625|0 |1 is obsolete| | Attachment #209626|0 |1 is obsolete| | Attachment #209627|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #79 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209739 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209739&action=edit Bug 42383: Add Koha::Module::Policy framework This patch adds a module policy framework that exposes per-module capabilities to the UI. This replaces the pattern of dedicated GET /config endpoints (like GET /erm/config) with a reactive, session-scoped mechanism. A module policy is the intersection of: - System preferences (feature toggles) - User permissions (what this staff member can do) - Library context (branch-specific configuration) The policy is a plain JSON structure: an envelope with the `module` name, a `global` block with the keys common to all modules, and the module-specific keys under the module name: { module => 'checkin', global => { audio_alerts => true, ... }, checkin => { exempt_fine => false, ... }, } Flags are JSON booleans. Modules cannot override the global keys, as they live in their own namespace. The page is bootstrapped with the policy, and the API returns it in the error object when it refuses a request because of it, so the client can refresh the UI. The server remains authoritative - the policy is informational, not an access token. Components: - Koha::Module::Policy - Base class with new(), module(), to_hashref() and scope() - Koha::Module::Policy::Checkin - Checkin module policy covering fines, holds, recalls, transfers, display, and blockers Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Module/Policy.t \ t/db_dependent/Koha/Module/Policy/Checkin.t => SUCCESS: Tests pass 3. Tests cover: - Base class constructor validation - Abstract method enforcement - scope() derivation from class name - The policy envelope, and globals not being overridable by modules - Permission-gated capabilities (exempt_fine, forgive_hold_fees) - Superlibrarian vs limited user - Flags being JSON booleans 4. Sign off :-D Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #80 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209740 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209740&action=edit Bug 42383: Add Koha::REST::Plugin::Policy This patch adds a Mojolicious plugin that provides the module_policy helper to any API controller. Usage: return $c->render( status => 403, openapi => { error => 'Return date override is not enabled', error_code => 'return_date_not_allowed', policy => $c->module_policy( 'Checkin', { library => $library_id } ), } ); The helper dynamically loads the appropriate Koha::Module::Policy subclass and returns the policy envelope for the authenticated user, so controllers can include it in the `policy` attribute of the error object when refusing a request because of it. This avoids duplicating the policy building logic across controllers. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/REST/Plugin/Policy.t => SUCCESS: Tests pass 3. Sign off :-D Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #81 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209741 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209741&action=edit Bug 42383: Add Koha::Checkin->confirm_hold This patch adds a confirm_hold() domain method to Koha::Checkin that sets the trapped hold to waiting. If the pickup library differs from the checkin library, it also creates a transfer and sets it in transit. This moves the logic out of the controller into the domain object, making it testable independently and reusable (e.g. for HoldsAutoFill). Throws Koha::Exceptions::MissingParameter if the checkin has no hold_id. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Checkin.t => SUCCESS: Tests pass 3. Tests cover: - confirm_hold at same library (hold set to waiting, no transfer) - confirm_hold at different library (hold in transit, transfer created) - confirm_hold without hold_id (throws MissingParameter) 4. Sign off :-D Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #82 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209742 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209742&action=edit Bug 42383: Add Koha::Checkin->cancel_hold This patch adds a cancel_hold() domain method to Koha::Checkin that cancels the trapped hold and clears the hold_id on the checkin record. Accepts an optional hashref with a 'reason' key for the cancellation reason (authorised value from HOLD_CANCELLATION). Throws Koha::Exceptions::MissingParameter if the checkin has no hold_id. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Checkin.t => SUCCESS: Tests pass 3. Tests cover: - cancel_hold without reason (no notification) - cancel_hold with reason (letter warning expected, reason stored) - cancel_hold without hold_id (throws MissingParameter) 4. Sign off :-D Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #83 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209743 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209743&action=edit Bug 42383: Add Koha::Checkin->confirm_transfer This patch adds a confirm_transfer() domain method to Koha::Checkin that sets the associated transfer in transit (populates datesent). The method is idempotent — calling it on an already-sent transfer is a no-op. Throws Koha::Exceptions::MissingParameter if the checkin has no transfer_id. No fuzzy fallbacks to item->get_transfer. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Checkin.t => SUCCESS: Tests pass 3. Tests cover: - confirm_transfer sets transfer in transit - confirm_transfer is idempotent on already-sent transfer - confirm_transfer without transfer_id (throws MissingParameter) - Returns $self for chaining 4. Sign off :-D Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #84 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209744 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209744&action=edit Bug 42383: Add Koha::Checkin->cancel_transfer This patch adds a cancel_transfer() domain method to Koha::Checkin that cancels the associated transfer and clears the transfer_id. If UseRecalls is enabled and the item has a recall in transit, the recall transfer is also reverted. Throws Koha::Exceptions::MissingParameter if the checkin has no transfer_id. No fuzzy fallbacks. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Checkin.t => SUCCESS: Tests pass 3. Tests cover: - cancel_transfer cancels the transfer (datecancelled set) - transfer_id cleared on the checkin - cancel_transfer without transfer_id (throws MissingParameter) 4. Sign off :-D Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #85 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209745 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209745&action=edit Bug 42383: Add Koha::Checkin->confirm_recall This patch adds a confirm_recall() domain method to Koha::Checkin that resolves the recall associated with the checkin: - If the recall's pickup library matches the checkin library, sets the recall to waiting with a calculated expiration date. - If the pickup library differs, starts a transfer (sets status to in_transit). The method is idempotent — calling it on an already-resolved recall is a no-op. Throws Koha::Exceptions::MissingParameter if the checkin has no recall_id. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Checkin.t => SUCCESS: Tests pass 3. Tests cover: - confirm_recall at same library (set to waiting + expiration date) - confirm_recall at different library (set to in_transit) - Idempotent on already in-transit recall - confirm_recall without recall_id (throws MissingParameter) 4. Sign off :-D Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #86 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209746 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209746&action=edit Bug 42383: Add checkin sub-resource confirmation/cancellation endpoints Adds the hold/transfer/recall confirmation and cancellation sub-resource endpoints on top of the checkin REST API: * POST /checkins/{checkin_id}/hold_confirmation * POST /checkins/{checkin_id}/hold_cancellation * POST /checkins/{checkin_id}/transfer_confirmation * POST /checkins/{checkin_id}/transfer_cancellation * POST /checkins/{checkin_id}/recall_confirmation Each delegates to the matching Koha::Checkin method and renders a shared 201 response via _render_checkin_response (Location header included). The module policy is returned, in the `policy` attribute of the error object, only on the permission error paths (exempt_fine, forgive_hold_fees, return_date), not on success responses: the Vue app is hydrated with the policy at template load time, so recomputing it on every successful checkin would waste CPU. The client refreshes its view of the policy exactly when it is stale: when the server refuses a request because of it. The checkin definition gains the full `messages` documentation and the availability definition its confirms/item_parts additions. The error definition gains the optional `policy` attribute, described by the new module_policy, module_policy_global and checkin_policy definitions. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove xt/api.t t/db_dependent/api/v1/checkins.t => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #87 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209747 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209747&action=edit Bug 42383: Add checkin messages and item-parts/bundle confirmations Extends the checkin flow with net-new behavior on top of the checkin audit record: * _attach_messages_to_checkin gains three independent messages: - item_type_checkinmsg: the item type's checkin message - patron_has_fines: when FineNotifyAtCheckin is on and the patron who had the item has an outstanding balance - patron_has_waiting_holds: when WaitingNotifyAtCheckin is on and the patron has holds waiting for pickup at the current branch * Koha::Item::Availability::Checkin gains two confirmations: - item_parts: multi-part item (CircConfirmItemParts) needs staff acknowledgement of the accompanying materials - items_bundle: bundle items need content verification The existing blocker/confirmation key names (NotIssued, BlockedWithdrawn, Wrongbranch, BlockedLost) are intentionally left unchanged; renaming them is out of scope here and would ripple into SIP, AddReturn and existing tests. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Circulation.t t/db_dependent/Koha/Item/Availability/Checkin.t t/db_dependent/Koha/Checkin.t => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #88 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209748 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209748&action=edit Bug 42383: Add Vue.js checkin page Adds the Vue-based checkin (returns) page that consumes the checkin REST API and its sub-resource confirmation/cancellation endpoints: * circ/checkin.pl + checkin.tt entry point * Vue module, store and components (BarcodeInput, CheckedInItems, CheckinOptions, ConfirmationModal, ResolveClaimModal, BundleVerificationModal, Main) under vue/components/Circ/Checkin/ * checkin-api-client fetch client, registered in the Vue api-client * rspack: new `checkin` entry building to js/vue/dist/checkin.js * http-client: honour return_response on non-ok responses so callers can inspect the error body/headers * Koha::Checkin->verify_bundle for the bundle verification modal * docs/checkin-vue-usecases.md The Vue app reads its module policy from the page hydration at load time (it is not fetched per request). When the API refuses a request because of the policy (e.g. a permission was revoked since the page was loaded), the error object carries the current policy: the store applies it, so the revoked options are no longer offered, and tells the user why the request was refused. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ yarn build => SUCCESS: rspack compiles, js/vue/dist/checkin.js is produced 3. Enable the page, go to Circulation -> Check in (checkin.pl), scan a barcode => SUCCESS: item is checked in, confirmations/messages render 4. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #89 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209749 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209749&action=edit Bug 42383: Remove legacy returns.pl, wire checkin.pl Retires the legacy circ/returns.pl checkin page in favour of the new Vue circ/checkin.pl, and repoints every entry point to it: * circ-nav.inc, checkin-search-box.inc, circulation-home.tt, staff-global.js: 'Check in' links/search now target checkin.pl * ILL SupplyingResource.vue: checkin action targets checkin.pl * circ/returns.pl and circ/returns.tt are removed * Main.vue honours a ?barcode= deep-link query param so links carried over from returns.pl keep working (auto-submits the checkin) * basic_workflow.t selenium flow updated to the new page The transfers-to-receive page keeps its bug 42443 AJAX DataTable implementation (it already cancels transfers through the REST API and never linked to returns.pl), so its 42383-era changes are not needed. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ yarn build => SUCCESS: rspack compiles 3. From the circ home, nav sidebar, and header search 'Check in', confirm they all open circ/checkin.pl 4. Visit /cgi-bin/koha/circ/checkin.pl?barcode=<known barcode> => SUCCESS: the item is checked in automatically 5. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #90 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209750 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209750&action=edit Bug 42383: Add tests for checkin sub-resource endpoints and messages Adds API test coverage for the Bug 42383 additions: * sub-resource confirmation endpoints (hold/transfer confirmation and cancellation): not-found, no-associated-resource (400), and the happy paths (201 + Location, hold set waiting, transfer set in transit / cancelled) * add - post-checkin messages: was_lost message serialization; the not-issued case keeps the 24401 confirmation flow (412 confirmation_required) * add - return_date and dropbox_mode coverage * module policy on error paths: the exempt_fine and return_date permission errors (403) carry the module policy in the `policy` attribute of the error object, other errors do not (the Vue app is hydrated with the policy at template load) Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/checkins.t => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #91 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209751 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209751&action=edit Bug 42383: Use snake_case for checkin availability keys The checkin availability object (Koha::Item::Availability::Checkin) is surfaced directly to the API through GET /checkins/availability and the 412 confirmation response, so its blocker/confirmation/warning keys are API-facing values and should be standard, meaningful snake_case: NotIssued -> not_issued (confirmation) BlockedWithdrawn -> blocked_withdrawn (blocker) BlockedLost -> blocked_lost (blocker) Wrongbranch -> wrong_branch (blocker) { Wrongbranch, Rightbranch } -> { wrong_branch, right_branch } The keys are now documented in the checkin_availability definition. AddReturn keeps consuming the availability object internally, and still exposes its own legacy $messages hashref (Wrongbranch => { Wrongbranch, Rightbranch }, NotIssued, ...) unchanged, so C4::SIP and existing AddReturn callers/tests are unaffected: the snake_case values are mapped back to the legacy structure where AddReturn builds $messages. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Item/Availability/Checkin.t \ t/Koha/Result/Availability.t \ t/db_dependent/api/v1/checkins.t \ t/db_dependent/Circulation.t \ t/db_dependent/SIP/Transaction.t \ xt/api.t => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #92 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209752 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209752&action=edit Bug 42383: (follow-up) Match the legacy hold/transfer checkin modals Bring the Vue checkin confirmation modal in line with the legacy returns page for the hold and transfer cases: - Show the item as a "Title (barcode)" heading, linked to moredetail.pl - Show the patron note recorded on the checkout - Show library names and the "Hold at" / "Checked in at" headings - Match the legacy hold modal title and "Hold for" layout - Match the legacy transfer modal behaviour - Offer hold cancellation from the hold modal via a secondary (nested) modal rather than an inline action Test plan: 1. Exercise hold-found and transfer checkins on the Vue checkin page => SUCCESS: the confirmation modal matches the legacy returns page 2. From a hold-found checkin, cancel the hold => SUCCESS: cancellation is confirmed through a secondary modal 3. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #93 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209753 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209753&action=edit Bug 42383: (follow-up) Show item type checkin message text The check in message area rendered the item_type_checkinmsg message as the raw "item type checkinmsg" key. Render its payload text instead (the item type's configured checkin message), matching what the legacy returns.pl dialog shows in its dedicated box. Test plan: 1. Apply patch, yarn build 2. Set a checkin message on an item type; check in such an item => SUCCESS: the modal shows the actual checkin message text 3. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #94 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209754 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209754&action=edit Bug 42383: (follow-up) Flesh out the recall found checkin modal The recall modal was a stub (title + an empty "Recall found" line). Bring it in line with the legacy returns.pl recall dialog: * "Recall placed by:" bulleted patron block (name link, address, phone, email) from the embedded recall.patron. * Recall notes, when present. * "Transfer required for recall" hint when the recall needs a transfer. * "Recall at <library name>" heading from the recall pickup library. * Add the "Ignore (I)" button alongside Confirm / Print and confirm. Test plan: 1. Apply patch, yarn build 2. Recall an item (UseRecalls) checked out to another patron, then check it in => SUCCESS: the modal shows who placed the recall, the pickup library, and Confirm / Print and confirm / Ignore 3. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #95 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209755 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209755&action=edit Bug 42383: (follow-up) Show patron notification info in hold and recall modals The legacy returns page shows how the patron will be notified in the hold and recall confirmation dialogs. Consume the notification_summary embed (Bug 43486) to render the same detail: - "Patron notification: Email, SMS." (or "Patron is not notified.") - "Main contact method: ..." The hold modal uses the Hold_Filled transports; the recall modal uses the Recall_Waiting transports (the notice that fires when a recall is set waiting on checkin). The boxes are styled like the legacy page. This wires hold.patron.notification_summary and recall.patron.notification_summary into the checkin embed (client and swagger enum) and renders the lines in ConfirmationModal. Test plan: 1. Have a patron with a Hold_Filled and/or Recall_Waiting messaging preference set, and place a hold/recall 2. Check the item in, yarn build => SUCCESS: the confirmation modal shows the patron notification line and the main contact method, matching the legacy returns page 3. Try a patron with no messaging preference => SUCCESS: the modal shows "Patron is not notified." in a grey box 4. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #96 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209756 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209756&action=edit Bug 42383: (follow-up) Match legacy behaviour for blocked, bundle, waiting-hold, claim and local-use checkins Round out the Vue checkin page so the remaining returns.pl use cases match the legacy behaviour: - Blocked check-ins (e.g. wrong branch) open a "Cannot check in" modal with the destination library and accompanying-materials note - The bundle verification status column is consistent (Verified / Not verified / Lost) - The waiting-holds alert names the patron (via the checkout.patron embed) and is shown first - The return-claim modal shows the lost/fee check-in messages inline and uses the standard button palette and "Ignore" idiom - Not-issued items are checked in directly via x-koha-override, recording local use when RecordLocalUseOnReturn is set - "Print slip and confirm" for holds and recalls ports bug 42505: an empty popup is opened during the click (so it is not blocked) and the hold slip is only loaded into it after the confirm_hold/confirm_recall call succeeds, so waitingdate/expirationdate are current on the first print. The popup is closed if the confirmation fails. Test plan: 1. Exercise each of the above checkin scenarios on the Vue checkin page => SUCCESS: behaviour and layout match the legacy returns page 2. Set HoldsAutoFill to "Don't", add Waiting since: [% hold.waitingdate | $KohaDates %] to the HOLD_SLIP notice, check in an item with a hold for the check-in library and click "Print slip and confirm" => SUCCESS: The popup is not blocked and the slip shows today's waiting date on the first print 3. prove t/db_dependent/api/v1/checkins.t => SUCCESS 4. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #97 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209757 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209757&action=edit Bug 42383: (QA follow-up) Restore legacy post-return processing in the checkin API QA testing (comments 9 and 10) found several things returns.pl did after AddReturn that POST /checkins did not. This patch adds them: - HoldsAutoFill: when a hold is found (and not already waiting) the hold is now filled on checkin, as returns.pl did, using Koha::Checkin->confirm_hold. A 'hold_auto_filled' message is added so the client can skip the hold modal. - Wrong transfers: a new Koha::Checkin->replace_wrong_transfer replaces the transfer with one from the checkin library (replace => 'WrongTransfer', ignore_limits => 1) and links it to the checkin, so transfer_confirmation/transfer_cancellation work on it. - Bundles: verified_bundle_barcodes is now processed. verify_bundle also sets datelastborrowed, records a return claim and charges the replacement fee (WhenLostChargeReplacementFee) for missing items, like returns.pl. 'bundle_missing_items' and 'bundle_unexpected_items' messages report the outcome. The patron is the one returned by AddReturn, as the stored checkout may already be anonymized. - Koha::Checkin->cancel_hold honours forgive_hold_fees (it was accepted by the endpoint but ignored), charging the cancellation fee otherwise. - The in_bundle message payload now carries the host biblio id and barcode, so the client can link to the host record. - checkout.patron.checkouts+count can be embedded. - The checkin module policy exposes dropbox_date and anonymous_patron_id, and recalls_enabled is now false when UseRecalls is 'off' (it was always true). Koha::Checkin->cancel_transfer had the same UseRecalls check. Test plan: 1. Apply this patch 2. Run: $ ktd --shell k$ yarn api:bundle k$ restart_all k$ prove t/db_dependent/Koha/Checkin.t \ t/db_dependent/api/v1/checkins.t \ t/db_dependent/Koha/Module/Policy/Checkin.t \ t/db_dependent/Circulation.t \ xt/api.t => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #98 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209758 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209758&action=edit Bug 42383: (QA follow-up) Address check-in page QA findings This patch addresses the check-in page findings from QA (comments 9 and 10), using the API changes from the previous patch: - Sidebar: checkin.tt used the CircSidebar preference, removed by bug 42344, so the circulation sidebar never showed. - Notes column: read the API keys (staff_notes, public_notes, internal_notes) so patron and item notes are displayed. - Patron column: link the patron and show the checkouts count (checkout.patron.checkouts+count). Anonymized checkouts (privacy "Never") no longer show the AnonymousPatron or a checkin slip button. - Print checkin slip opens members/printslip.pl?print=checkinslip. - Book drop mode shows the effective checkin date. - HoldsAutoFill: auto-filled holds don't open the hold modal; a "Hold filled for" box with a Print button is shown, and the slip is printed when HoldsAutoFillPrintSlip is set. - AutomaticConfirmTransfer: the transfer modal no longer confirms itself after a second. As on the legacy page, a non-blocking transfer is confirmed when staff move on (scan the next item). - Hold cancellation: the reason is now sent (wrong authorised value key) together with "Forgive fees for manually expired holds". - "Ignore" on hold, recall and claim modals keeps the row as checked in instead of marking it "Not checked in". - "No, don't transfer" clears the transfer from the row. - Hold modal: "Transfer to" / "Confirm hold and transfer" for holds at another library, and "Hold found (item is already waiting)". - Bundles: the verification table shows title and author, all scanned barcodes are sent (unexpected items are removed from their bundle), missing and unexpected items are reported, "Remove from bundle" works and links to the host record. - Messages: no "Already returned" badge on every return, a single lost item fee outcome (as the legacy IF/ELSIF), not for loan and shelving location changes show old and new values, the checkout note is shown on every return with a formatted date, and an unknown barcode shows "No item with barcode: X". - Values interpolated into the message boxes are HTML-escaped. Test plan: 1. Apply this patch and rebuild: $ ktd --shell k$ yarn js:build k$ restart_all 2. Go to Circulation -> Check in and repeat the scenarios from the QA comments 9 and 10, comparing with the legacy page on main => SUCCESS: Behaviour matches the legacy page 3. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #99 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209759 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209759&action=edit Bug 42383: (QA follow-up) Fix check-in page findings from browser testing This patch fixes differences with the legacy returns.pl page found by testing both pages side by side in the browser. Changes: - Main.vue: a transfer modal disables the barcode input when TransfersBlockCirc is set, so a scanner cannot check in the next item behind it. The input is focused again once the transfer is resolved. - ConfirmationModal.vue: "Cancel hold" is only offered for holds that are already waiting, as on the legacy page. On an unconfirmed record-level hold it failed with a 500 (Koha::Hold->cancel needs an item to calculate the cancellation fee). - stores/checkin.js: confirming a hold that needs a transfer shows the transfer (destination and reason) on the row. - CheckedInItems.vue: due and acquisition dates are formatted with $date() (dateformat syspref) instead of the browser locale. - POST /checkins accepts the item+strings, hold.patron+strings and recall.patron+strings embeds. The table shows shelving location, item type and collection descriptions, and the hold/recall modals show the patron category description, instead of the codes. - The transfer modal no longer shows "Already returned": was_returned is set on every return and the legacy page never displayed it. - Patron card numbers are shown next to the patron names. - The item type check-in message gets a label in the status column. - The print button reads "Print slip, transfer, and confirm (P)" when the hold needs a transfer, as on the legacy page. Test plan: 1. Apply patch and rebuild: $ ktd --shell k$ yarn api:bundle && yarn js:build && restart_all 2. Set TransfersBlockCirc to "Block", AutomaticItemReturn to "Do", HoldsAutoFill to "Don't", and set your browser language to one that uses day/month dates (e.g. Spanish) 3. Check out to a patron: an item from another library (A), an item with a shelving location (B), an item with a record-level hold for pickup at another library (C) 4. Go to Circulation > Check in, check in A => SUCCESS: The transfer modal shows, the barcode input is disabled => SUCCESS: No "Already returned" message in the modal 5. Scan B with the modal open => SUCCESS: Nothing is checked in 6. Click "Yes, transfer" => SUCCESS: The barcode input is enabled and focused 7. Check in B => SUCCESS: Dates follow the dateformat syspref => SUCCESS: Shelving location and item type show their descriptions => SUCCESS: The patron card number is shown 8. Check in C => SUCCESS: The patron category description and card number show => SUCCESS: There is no "Cancel hold" button => SUCCESS: The print button reads "Print slip, transfer, and confirm" 9. Click "Confirm hold and transfer" => SUCCESS: The row shows the destination library and "Hold" reason 10. Check in an item with a waiting hold, click "Cancel hold", pick a reason and confirm => SUCCESS: The hold is cancelled with the chosen reason 11. Run: k$ prove t/db_dependent/api/v1/checkins.t xt/api.t => SUCCESS: Tests pass! 12. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #100 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209760 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209760&action=edit Bug 42383: (QA follow-up) Ask to transfer when AutomaticItemReturn is disabled When an item checked in needs to go back to another library and AutomaticItemReturn is disabled, AddReturn does not create a transfer and only reports NeedsTransfer. The legacy page asked "Transfer now?" and created the transfer on "Yes". The new page showed no modal at all, so there was no way to start the transfer from the check-in page. This patch: - Makes Koha::Checkin->confirm_transfer accept to_library_id and reason. If the checkin has no transfer yet, it requests one to that library (reason defaults to Manual) and sets it in transit. - Makes POST /checkins/{checkin_id}/transfer_confirmation accept an optional body with to_library_id and reason. It returns 400 if there is no transfer and no valid library, and 409 if the transfer is not allowed by the branch transfer limits or one is already pending. - Makes the check-in page show the transfer modal for needs_transfer, with "Transfer now?" and a "No, don't transfer" button. "Yes" requests the transfer using the destination and reason the checkin reported. Test plan: 1. Set AutomaticItemReturn to "Don't automatically transfer" 2. Check out an item whose home library is not your logged in library 3. Go to Circulation > Check in and check the item in => FAIL: No modal is shown, the transfer cannot be started 4. Apply this patch, rebuild and restart: $ ktd --shell k$ yarn api:bundle && yarn js:build && restart_all 5. Repeat steps 2 and 3 => SUCCESS: The modal asks "Transfer now?" 6. Click "Yes, transfer" => SUCCESS: The row shows the transfer, the item is in transit to its home library (check the item details page) 7. Repeat steps 2 and 3, click "No, don't transfer" => SUCCESS: No transfer is created, the row shows no transfer 8. Run: k$ prove t/db_dependent/Koha/Checkin.t \ t/db_dependent/api/v1/checkins.t \ xt/api.t => SUCCESS: Tests pass! 9. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #101 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209761 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209761&action=edit Bug 42383: (QA follow-up) Format restriction and return dates on the check-in page This patch fixes the remaining dates on the check-in page that did not follow the dateformat syspref: - The "Patron is now restricted" and "Patron was earlier restricted" messages now include the restriction end date, formatted with $date() as the legacy page did with $KohaDates. They used to omit the date. - The "Return date" badge shown while the options panel is collapsed displayed the raw ISO date (2026-10-10). It is now formatted. Test plan: 1. Apply patch and rebuild: $ ktd --shell k$ yarn js:build && restart_all 2. Set the 'Suspension in days' circulation rule to 1 and check out an overdue item to a patron (e.g. backdate the checkout) 3. Go to Circulation > Check in and check the item in => SUCCESS: "Patron is now restricted until <date>." uses the dateformat syspref 4. Check in another overdue item of the same patron => SUCCESS: "Reminder: Patron was earlier restricted until <date>." uses the dateformat syspref 5. Enable SpecifyReturnDate, open the check-in settings, pick a return date and collapse the settings => SUCCESS: The "Return date" badge uses the dateformat syspref 6. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #102 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209762 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209762&action=edit Bug 42383: Do not set a hold aside for an item checked out in the meantime Bug 43803 made ModReserveAffect return 0 and leave the hold untouched when the item has been checked out again while the hold confirmation was pending (e.g. from another workstation). The legacy returns.pl displayed a warning and skipped the transfer in that case, but Koha::Checkin->confirm_hold ignored the return value: it created and sent a transfer to the pickup library for an item that is on loan, and the hold_confirmation endpoint reported success. This patch makes Koha::Checkin->confirm_hold throw the new Koha::Exceptions::Checkin::ItemCheckedOut exception (before any transfer is created) when ModReserveAffect refuses the hold, and makes POST /checkins/{checkin_id}/hold_confirmation return 409 with the 'item_checked_out' error code. The check-in page shows the error and keeps the hold pending. Test plan: 1. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Checkin.t \ t/db_dependent/api/v1/checkins.t => SUCCESS: Tests pass! 2. Make sure HoldsAutoFill is disabled 3. Place an item-level hold on an item checked out to patron A (hold for patron B, pickup at a different library) 4. Go to Circulation > Check in, check in the item => SUCCESS: The "Hold found" modal appears. Leave it open 5. From another tab, check out the item to patron C, confirming the checkout without cancelling the hold 6. Back on the first tab, click "Confirm hold" => SUCCESS: An error is displayed: "The item has been checked out in the meantime: the hold has not been set aside and remains pending" => SUCCESS: The hold is still pending and no transfer was created 7. Check the item in again and confirm the hold => SUCCESS: The hold is set in transit to the pickup library 8. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #103 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209763 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209763&action=edit Bug 42383: (QA follow-up) Close non-blocking transfer modals on click outside or Escape With TransfersBlockCirc disabled, the legacy returns.pl transfer modals had no static backdrop: clicking outside of them or pressing Escape closed them, and with AutomaticConfirmTransfer enabled closing them confirmed the transfer. On the Vue check-in page the only way out of a non-blocking transfer modal was one of its buttons, or scanning the next item. This patch makes ConfirmationModal emit 'close' when a non-blocking transfer modal gets a click outside of the dialog or an Escape key press. Main.vue then confirms the transfer if the checkin has one and AutomaticConfirmTransfer is enabled, and otherwise moves on leaving the transfer as it is. Blocking transfer modals (TransfersBlockCirc enabled) and the other modals are unchanged. Test plan: 1. Apply this patch and rebuild the JS: $ ktd --shell k$ yarn build 2. Set TransfersBlockCirc to "Don't block" and AutomaticConfirmTransfer to "Do" 3. Put an item in transit to library A, and check it in at library B (wrong transfer) => SUCCESS: The "Please return item to A" modal shows 4. Click anywhere outside of the modal => SUCCESS: The modal closes => SUCCESS: The item shows as in transit to A on its details page 5. Repeat 3, press Escape instead of clicking outside => SUCCESS: Same as step 4 6. Set AutomaticConfirmTransfer to "Don't" and repeat 3 and 4 => SUCCESS: The modal closes and the transfer is not sent 7. Click inside the modal (e.g. on its text) => SUCCESS: The modal stays open 8. Set TransfersBlockCirc to "Block" and repeat 3 and 4 => SUCCESS: The modal stays open until one of its buttons is used 9. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #104 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209764 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209764&action=edit Bug 42383: (QA follow-up) Show 'Available for loan' for a not for loan value of 0 When UpdateNotForLoanStatusOnCheckin sets an item's not for loan status to 0, the check-in page displayed the raw '0' as the new value. The avDescription helper only treated undef and the empty string as 'Available for loan', while the legacy returns.tt treated any false value (including 0) that way. This patch adds notForLoanDescription, which shows 'Available for loan' for any value that is not a non-zero number, and locationDescription for the UpdateItemLocationOnCheckin message. The latter also fixes an empty shelving location being displayed as 'Available for loan': it now shows 'Blank', as the legacy page did. Test plan: 1. Set UpdateNotForLoanStatusOnCheckin to: BK: 1: 0 2. Check out a BK item, then set its not for loan status to 1 3. Check the item in on the check-in page => FAIL: The message reads 'Not for loan status updated. Old value: ... New value: 0.' 4. Apply this patch and rebuild the JS: $ ktd --shell k$ yarn build 5. Repeat steps 2 and 3 => SUCCESS: The new value reads 'Available for loan' 6. Set UpdateItemLocationOnCheckin to: _BLANK_: CART and check in an item with no shelving location => SUCCESS: The old value reads 'Blank' 7. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #105 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209765 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209765&action=edit Bug 42383: (QA follow-up) Show the new overdue charge message on lost returns With the lost item refund policy 'Refund lost item charge and charge new overdue fine', AddReturn reports both lost_item_fee_refunded and lost_item_fee_charged. The check-in page shows a single lost fee outcome, picking the first one found in a list that started with lost_item_fee_refunded, so the new overdue charge was never mentioned. This patch makes lost_item_fee_charged and lost_item_fee_restored take precedence over lost_item_fee_refunded. Their texts already state that the lost item charge was refunded. Test plan: 1. Set a circulation rule with an overdue fine and finesMode to 'Calculate and charge' 2. Set the lost item refund policy (Default lost item fee refund on return policy) to 'Refund lost item charge and charge new overdue fine' 3. Check out an item with a replacement cost and a due date in the past, then mark it lost 4. Check the item in on the check-in page => FAIL: Only 'A refund for the lost item charge has been applied to the borrowing patron's account.' is displayed 5. Apply this patch and rebuild the JS: $ ktd --shell k$ yarn build 6. Repeat steps 3 and 4 => SUCCESS: The message also says 'and new overdue charge has been calculated and applied', and it is displayed only once 7. Check the patron's account => SUCCESS: The lost fee was refunded and a new overdue fine created 8. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #106 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209766 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209766&action=edit Bug 42383: (QA follow-up) Add tests for forgive_hold_fees on hold_cancellation This patch adds tests for POST /checkins/{checkin_id}/hold_cancellation with forgive_hold_fees. They highlight that the endpoint rejects the parameter: the request body schema does not allow it, so the request fails with a 400 and the hold is never cancelled. The tests cover: - 403 (no_permission_for_forgive_hold_fees) without updatecharges.writeoff - No ExpireReservesMaxPickUpDelayCharge fee when the fees are forgiven - The fee being charged when they are not Test plan: 1. Apply this patch 2. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/checkins.t => FAIL: Tests fail! The forgive_hold_fees requests return 400 3. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #107 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209767 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209767&action=edit Bug 42383: (QA follow-up) Allow forgiving fees when cancelling a hold on check-in With 'Forgive fees for manually expired holds' checked, cancelling a waiting hold from the check-in page did nothing and the hold modal kept coming back. The page sends forgive_hold_fees to POST /checkins/{checkin_id}/hold_cancellation, but the request body schema did not include it and has additionalProperties: false, so the request was rejected with a 400. The error was swallowed by the store, the check-in stayed pending and its modal was shown again. This patch: - Adds forgive_hold_fees to the hold_cancellation body schema. The controller already handled it, including the updatecharges.writeoff permission check. - Makes the check-in store report a failed hold, transfer or recall action in the page error box, so a rejected action is no longer silently retried. - Documents the 403 no_permission_for_forgive_hold_fees error of hold_cancellation, which carries the current module policy in the `policy` attribute. The store applies it, so the option is no longer offered, and reports the refusal. Test plan: 1. Set ExpireReservesMaxPickUpDelayCharge to 5 2. Place a hold and check the item in to set it waiting 3. Set the hold's expiration date in the past: $ ktd --dbshell k> UPDATE reserves SET expirationdate = '2026-01-01' WHERE reserve_id = X; 4. On the check-in page, open the settings and check 'Forgive fees for manually expired holds' 5. Check the item in, click 'Cancel hold', then 'Cancel hold' in the cancellation pop-up => FAIL: The 'Hold found (item is already waiting)' modal comes back and the hold is not cancelled 6. Apply this patch, rebuild the API bundle and the JS and restart: $ ktd --shell k$ yarn api:bundle k$ yarn build k$ restart_all 7. Repeat steps 4 and 5 => SUCCESS: The hold is cancelled, the modal closes and the patron is not charged the expired hold fee 8. Run: k$ prove t/db_dependent/api/v1/checkins.t xt/api.t => SUCCESS: Tests pass! 9. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #108 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209768 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209768&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 <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #109 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209769 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209769&action=edit Bug 42383: (QA follow-up) Clear the suggested transfer when closing 'Transfer now?' With AutomaticItemReturn disabled, the check-in only suggests a transfer (needs_transfer message) and the 'Transfer now?' modal asks whether to create it. Closing that modal with Escape or by clicking outside it created no transfer, as expected, but the row kept showing the suggested destination and reason in the 'Transfer to' and 'Transfer reason' columns. 'No, don't transfer' cleared them. This patch makes closing the modal without a transfer behave like 'No, don't transfer'. Closing a modal for an existing transfer is unchanged: it is confirmed when AutomaticConfirmTransfer is set, and left pending otherwise. Test plan: 1. Set TransfersBlockCirc and AutomaticItemReturn to "Don't" 2. Check in an item whose home library is not the current library => SUCCESS: The 'Transfer now?' modal is displayed 3. Press Escape => FAIL: No transfer is created, but the row still shows the home library and 'Return to home library' in the transfer columns 4. Apply this patch and rebuild the JS: $ ktd --shell k$ yarn build 5. Repeat steps 2 and 3, then once more clicking outside the modal instead of pressing Escape => SUCCESS: No transfer is created and the transfer columns are empty 6. Repeat step 5 with AutomaticConfirmTransfer set to "Do" => SUCCESS: Same result, no transfer is created 7. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #110 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209770 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209770&action=edit Bug 42383: (QA follow-up) Map the check-in page to the manual This patch renames the 'circ/returns' key in Koha::Manual's mapping to 'circ/checkin', as circ/returns.pl has been replaced by circ/checkin.pl. Without it, the 'Help' link on the new check-in page points to the manual's main page instead of the check-in section. It addresses point 14 of the QA comment. Test plan: 1. Go to Circulation > Check in 2. Click the 'Help' link on the top right => FAIL: The manual's front page opens 3. Apply this patch and restart plack: $ ktd --shell k$ koha-plack --restart kohadev 4. Repeat 2 => SUCCESS: The manual opens on the 'Check in (returning)' section 5. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #111 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209771 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209771&action=edit Bug 42383: (QA follow-up) Apply barcode filters on check-in by barcode This patch makes POST /checkins run the passed external_id through C4::Circulation::barcodedecode before looking up the item. This applies the itemBarcodeInputFilter system preference and the item_barcode_transform plugin hook, as the legacy circ/returns.pl did. Before this patch, a barcode needing transformation (e.g. one scanned with spaces when itemBarcodeInputFilter is 'whitespace') could not be checked in, and returned a 404. It addresses point 4 of the QA comment. Test plan: 1. Set the itemBarcodeInputFilter system preference to 'Remove spaces from' 2. Check out an item to a patron 3. Go to Circulation > Check in 4. Check in the item, typing its barcode with a space in the middle => FAIL: 'No item with barcode' is displayed 5. Apply this patch and restart plack: $ ktd --shell k$ koha-plack --restart kohadev 6. Repeat 4 => SUCCESS: The item is checked in 7. Run: k$ prove t/db_dependent/api/v1/checkins.t => SUCCESS: Tests pass! 8. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #112 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209772 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209772&action=edit Bug 42383: (QA follow-up) Update the holds queue on check-in This patch makes POST /checkins enqueue a BatchUpdateBiblioHoldsQueue background job for the item's record when RealTimeHoldsQueue is enabled, as the legacy circ/returns.pl did. AddReturn passes skip_holds_queue internally, so without this the real-time holds queue was never refreshed after a check-in from the new page. The job is enqueued when: - the item was returned (legacy did it after AddReturn), or - a hold was found for the item. The legacy page enqueued the job when the staff chose 'Ignore' on the hold modal. The new page dismisses the hold modal client-side without calling the API, so the update is done at check-in time instead. Cancelling the hold found already updates the queue, as Koha::Hold->cancel enqueues the job itself. Confirming it did not update the queue in legacy either. It addresses point 5 of the QA comment. Test plan: 1. Enable RealTimeHoldsQueue 2. Check out an item and go to Administration > Jobs, note the number of 'Update holds queue for biblios' jobs 3. Check the item in on the check-in page 4. Reload the jobs page => FAIL: No new 'Update holds queue for biblios' job 5. Apply this patch and restart plack: $ ktd --shell k$ koha-plack --restart kohadev 6. Repeat 2 to 4 => SUCCESS: A new job is listed for the item's record 7. Run: k$ prove t/db_dependent/api/v1/checkins.t => SUCCESS: Tests pass! 8. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #113 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209773 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209773&action=edit Bug 42383: (QA follow-up) Set confirmed holds waiting at the check-in desk This patch makes Koha::Checkin->confirm_hold pass the checkin's desk_id to ModReserveAffect, so a hold confirmed (or auto-filled through HoldsAutoFill) on the check-in page is set waiting at the desk the staff member is using, as the legacy circ/returns.pl did. The checkin row already records the desk from the user environment. It addresses point 10 of the QA comment. Test plan: 1. Enable UseCirculationDesks and create a desk for your library 2. Set the desk for your session (Set library and desk) 3. Place an item level hold for a patron, pickup at your library 4. Check the item in on the check-in page and confirm the hold 5. Look at the hold on the record's holds page => FAIL: The waiting hold has no desk 6. Apply this patch and restart plack: $ ktd --shell k$ koha-plack --restart kohadev 7. Repeat 3 to 5 => SUCCESS: The hold is waiting at your desk 8. Run: k$ prove t/db_dependent/Koha/Checkin.t => SUCCESS: Tests pass! 9. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #114 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209774 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209774&action=edit Bug 42383: (QA follow-up) Tell 'hold not found' from 'item on loan' This patch makes Koha::Checkin->confirm_hold handle the three possible ModReserveAffect return values explicitly: - 1: the hold was set aside (success) - 0: the item is on loan and the hold is not waiting. A Koha::Exceptions::Checkin::ItemCheckedOut exception is thrown, as before - undef: the hold was not found. A new Koha::Exceptions::Checkin::HoldNotFound exception is thrown Before, an undef return was reported as 'item checked out', which was misleading. The hold not being found means it was cancelled or filled between the check-in and the confirmation (e.g. from another workstation): this is a conflict with the current state rather than a no-op, as the staff member asked for something that did not happen, so it is reported. confirm_hold now also throws HoldNotFound when the checkin's hold is gone before calling ModReserveAffect, instead of dying on an undefined value. POST /checkins/{checkin_id}/hold_confirmation maps HoldNotFound to a 409 response with the 'hold_not_found' error_code. It addresses point 12 of the QA comment. Test plan: 1. Apply this patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Checkin.t \ t/db_dependent/api/v1/checkins.t => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #115 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209775 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209775&action=edit Bug 42383: (QA follow-up) Use the returning patron for check-in notices This patch makes AddReturn pass the patron the item was checked out to down to _attach_messages_to_checkin, which uses it for the patron_has_fines (FineNotifyAtCheckin) and patron_has_waiting_holds (WaitingNotifyAtCheckin) messages. Before, those messages were built from $checkin->checkout->patron. The checkin's checkout is the old_issues row, which MarkIssueReturned has already anonymised for patrons with privacy set to 'Never' (when AnonymousPatron is set). The messages were then computed for, and pointed to, the anonymous patron instead of the patron who returned the item. It addresses point 11 of the QA comment. Test plan: 1. Set AnonymousPatron to an existing patron, and enable FineNotifyAtCheckin and WaitingNotifyAtCheckin 2. Pick a patron with no fines, set their privacy to 'Never'. Give them a manual fee and a waiting hold at your library 3. Check out an item to them, then check it in on the check-in page => FAIL: No fines or waiting holds message is displayed 4. Apply this patch and restart plack: $ ktd --shell k$ koha-plack --restart kohadev 5. Repeat 3 => SUCCESS: The fines and waiting holds messages are displayed and link to the right patron 6. Run: k$ prove t/db_dependent/Circulation.t => SUCCESS: Tests pass! 7. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #116 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209776 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209776&action=edit Bug 42383: (QA follow-up) Add API tests for recall_confirmation This patch adds tests for POST /checkins/{checkin_id}/recall_confirmation in line with the existing hold and transfer sub-resource tests. They cover: - 404 when the checkin does not exist - 403 when the user lacks the circulate permission - 400 when the checkin has no recall - 201 setting the recall waiting at the checkin library - 201 setting the recall in transit when the pickup library differs It addresses point 21 of the QA comment. Test plan: 1. Apply this patch 2. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/checkins.t => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #117 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209777 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209777&action=edit Bug 42383: (QA follow-up) Reject follow-up actions on stale checkins This patch makes the checkin follow-up endpoints refuse to act on a checkin that is not the latest checkin of its item: - POST /checkins/{checkin_id}/hold_confirmation - POST /checkins/{checkin_id}/hold_cancellation - POST /checkins/{checkin_id}/transfer_confirmation - POST /checkins/{checkin_id}/transfer_cancellation - POST /checkins/{checkin_id}/recall_confirmation Before, they only checked the permission and that the checkin existed, so an old checkin_id could be used to alter holds, transfers or recalls long after the item had circulated again. A new Koha::Checkin->is_latest method tells whether a later checkin exists for the item. The endpoints now return a 409 with the 'stale_checkin' error_code when it is not the latest. The shared lookup is done in a new _get_actionable_checkin controller helper. It addresses point 13 (a) of the QA comment. Test plan: 1. Apply this patch 2. Run: $ ktd --shell k$ yarn api:bundle k$ prove t/db_dependent/Koha/Checkin.t \ t/db_dependent/api/v1/checkins.t \ xt/api.t => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #118 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209778 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209778&action=edit Bug 42383: (QA follow-up) Require a token for checkin follow-up actions This patch makes the checkin follow-up endpoints require a short-lived signed token, issued when checking in, tied to the checkin, the staff member and the action: - POST /checkins/{checkin_id}/hold_confirmation - POST /checkins/{checkin_id}/hold_cancellation - POST /checkins/{checkin_id}/transfer_confirmation - POST /checkins/{checkin_id}/transfer_cancellation - POST /checkins/{checkin_id}/recall_confirmation It reuses the bug 24401 mechanism (Koha::Token generate_jwt/check_jwt, as for the checkin and checkout confirmation tokens). Changes: - Koha::Checkin->pending_actions returns the follow-up actions offered for the checkin (hold found, transfer triggered or needed, recall found) - Koha::Checkin->action_tokens returns a token for each of them, valid for 15 minutes (ACTION_TOKEN_EXPIRY_SECONDS) - Koha::Checkin->check_action_token validates a token - POST /checkins returns the tokens in a new 'action_tokens' attribute, an object keyed by action name - The endpoints above take a required 'action_token' query parameter, and return a 403 with the 'invalid_action_token' error_code when it is not valid for the checkin, user and action, or has expired - The check-in page passes the token of the action it performs Together with the stale checkin check, a checkin_id can no longer be used to alter holds, transfers or recalls outside of the check-in it was returned from. It addresses point 13 (b) of the QA comment. Test plan: 1. Apply this patch, rebuild the API bundle and the Vue files, and restart plack: $ ktd --shell k$ yarn api:bundle k$ yarn js:build k$ koha-plack --restart kohadev 2. Place a hold on an item, check it out to another patron 3. Check the item in on the check-in page and confirm the hold => SUCCESS: The hold is set waiting 4. Repeat 2 and 3, cancelling the hold instead => SUCCESS: The hold is cancelled 5. Repeat with a transfer and a recall => SUCCESS: They are confirmed/cancelled as expected 6. Run: k$ prove t/db_dependent/Koha/Checkin.t \ t/db_dependent/api/v1/checkins.t \ xt/api.t => SUCCESS: Tests pass! 7. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #119 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209779 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209779&action=edit Bug 42383: (QA follow-up) Do not check in items from the barcode URL param The check-in page kept the legacy ?barcode= deep link working by submitting a check-in for it on page load. That turns a GET request into a state change: any link or embedded resource pointing at circ/checkin.pl?barcode=XXX checks the item in for the logged in staff user. The legacy page required a CSRF protected POST (op=cud-checkin). This patch (QA comment point 3) makes the page only prefill the barcode input with the parameter value and focus it. Staff need to press 'Check in' (or Enter) to actually check the item in. A setBarcode() method is added to the BarcodeInput component for this. Test plan: 1. Check out an item to a patron 2. Visit /cgi-bin/koha/circ/checkin.pl?barcode=<the item barcode> => FAIL: The item is checked in on page load 3. Check the item out again 4. Apply this patch and rebuild: $ ktd --shell k$ yarn js:build k$ restart_all 5. Repeat step 2 => SUCCESS: The barcode input contains the barcode and has the focus => SUCCESS: Nothing is checked in, the item is still checked out 6. Press Enter => SUCCESS: The item is checked in 7. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #120 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209780 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209780&action=edit Bug 42383: (QA follow-up) Escape the item type check-in message The check-in page renders its alert boxes with v-html. Every value interpolated into them is escaped, except the item type check-in message (itemtypes.checkinmsg) used for the item_type_checkinmsg message, which was rendered as raw HTML. The legacy page displayed it with the html_line_break filter, which escapes the text and turns line breaks into <br>. This patch (QA comment point 2) escapes the message and converts its line breaks into <br>, matching the legacy rendering. The other alert boxes already escape the API provided data they interpolate. Test plan: 1. Go to Administration > Item types and edit the type of an item. Set 'Checkin message' to: <b>Bold</b><img src=x onerror=alert('XSS')> Second line 2. Check the item out, then check it in on the check-in page => FAIL: 'Bold' is rendered bold and a JS alert pops up 3. Apply this patch and rebuild: $ ktd --shell k$ yarn js:build k$ restart_all 4. Repeat step 2 => SUCCESS: The message is displayed literally, with the HTML tags visible, no alert pops up and 'Second line' is on its own line 5. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #121 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209781 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209781&action=edit Bug 42383: (QA follow-up) Make returning error responses opt-in in HttpClient The check-in page needs the raw response of POST /checkins for error statuses too (412 confirmation, 403 blocked, 404 not found), so an earlier patch made HttpClient::_fetchJSON return the response object for non-2xx responses whenever return_response was set. But delete() and count() default return_response to true, so every DELETE and count request in the Vue apps stopped going through the error handling: errors were no longer thrown nor reported with setError(), and callers treated failures as successes. This patch (QA comment point 1) restores the previous behaviour for return_response and adds a separate return_error_response parameter, false by default. It is only passed by post(), and only the check-in client sets it (checkins.create, and checkins.cancelHold whose refusals carry the module policy). Test plan: 1. Apply this patch and rebuild: $ ktd --shell k$ yarn js:build k$ restart_all 2. Check in items on the check-in page, including: - an item that is not checked out - a barcode that does not exist - an item that requires a confirmation (e.g. a lost item with BlockReturnOfLostItems set) => SUCCESS: The page behaves as before: the right messages, modals and confirmation prompts are displayed 3. In the ERM module, try deleting an agreement that cannot be deleted (e.g. edit it in another tab and delete it there first, then delete it again from the first tab) => SUCCESS: The error is displayed at the top of the page, as it was before the check-in patches 4. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #122 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209782 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209782&action=edit Bug 42383: (QA follow-up) Play audio alerts after each check-in The check-in page marks the latest row with the audio-alert-warning or audio-alert-success classes, and the confirmation modal with audio-alert-action, so the default AudioAlerts selectors match them. But js_includes.inc only looks for the configured selectors and calls playSound() once, on document ready. The legacy page was reloaded after every check-in so it played a sound each time; the Vue page never did. This patch (QA comment point 6) adds a playAudioAlert() helper to the check-in page, which repeats the js_includes.inc logic: it walks window.AUDIO_ALERTS in precedence order and plays the sound of the first selector found in the page. It is called once the result of each check-in has been rendered, and when the next pending modal is opened after resolving one. The error box displayed for unknown barcodes and failed requests also gets the audio-alert-warning class, so these produce the warning sound like on the legacy page. Test plan: 1. Enable the AudioAlerts system preference 2. On the check-in page, check in: - an item that is checked out - a barcode that does not exist - an item with a hold on it => FAIL: No sound is played 3. Apply this patch and rebuild: $ ktd --shell k$ yarn js:build k$ restart_all 4. Repeat step 2 (check items out and place the hold again) => SUCCESS: The 'beep' sound plays for the normal check-in => SUCCESS: The 'critical' sound plays for the unknown barcode => SUCCESS: The 'opening' sound plays when the hold modal opens 5. Disable AudioAlerts and repeat step 2 => SUCCESS: No sound is played 6. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #123 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209783 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209783&action=edit Bug 42383: (QA follow-up) Print the recall pickup slip for recalls The 'Print slip and confirm (P)' button of the recall modal used recallInfo.reserve_id (falling back to the checkin hold_id) to load the hold transfer slip. The recall_found message payload only contains recall_id and needs_transfer, so no slip was ever printed, or the wrong one was. The legacy page opened recalls/recall_pickup_slip.pl?recall_id=X. This patch (QA comment point 7) adds a recallSlipUrl() helper to slip-printer.js and makes the button load the recall pickup slip for the payload recall_id, once the recall has been confirmed (same as the hold slip). Test plan: 1. Enable UseRecalls and set up circulation rules allowing recalls 2. Check an item out to patron A, then place a recall on it for patron B from the OPAC 3. Check the item in on the check-in page => SUCCESS: The recall modal is displayed 4. Click 'Print slip and confirm (P)' => FAIL: No slip, or an empty / wrong slip, is displayed 5. Apply this patch and rebuild: $ ktd --shell k$ yarn js:build k$ restart_all 6. Repeat steps 2 to 4 with a new item => SUCCESS: The recall is confirmed and the recall pickup slip for patron B is displayed in a popup 7. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #124 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209784 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209784&action=edit Bug 42383: (QA follow-up) Use the API client to resolve return claims The 'Resolve return claim' modal of the check-in page called PUT /api/v1/return_claims/{claim_id}/resolve with a raw fetch() and emitted 'resolved' whatever the response was. Failures (e.g. a missing permission or a claim deleted in the meantime) were silently reported as success and the modal closed. This patch (QA comment point 15) adds a return_claims.resolve() method to ClaimAPIClient, built on HttpClient.put() like the other API clients, and uses it from the modal through APIClient. 'resolved' is only emitted when the request succeeds; otherwise the error is displayed in the modal, which stays open. Test plan: 1. Set ClaimReturnedLostValue to a lost value 2. Check an item out to a patron and, from the patron's checkouts table, mark it as 'Claim returned' 3. Check the item in on the check-in page 4. Click 'Resolve' on the row, pick a resolution and click 'Resolve claim' => SUCCESS: The claim is resolved 5. Repeat steps 2 to 3, open the resolve modal and, before submitting it, delete the claim from the patron's 'Claims' tab in another browser tab. Submit the modal => FAIL: The modal closes as if the claim had been resolved 6. Apply this patch and rebuild: $ ktd --shell k$ yarn js:build k$ restart_all 7. Repeat steps 2 to 4 => SUCCESS: The claim is resolved and the modal closes 8. Repeat step 5 => SUCCESS: The modal stays open and displays the error returned by the API 9. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #125 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209785 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209785&action=edit Bug 42383: (QA follow-up) Fix xt/tt_script_tidy.t for circ/checkin.tt xt/tt_script_tidy.t checks that inline <script> blocks of templates do not contain Template::Toolkit tags, unless they are explicitly allowed. circ/checkin.tt passes the module policy, the library and the table settings to the Vue app through a <script> block with TT tags, which made the test fail. This patch (QA comment point 8) marks that block with data-tt-allowed="true", like other templates (e.g. recalls/request.tt) do for script blocks that only expose server side values to JS. Test plan: 1. Run: $ ktd --shell k$ prove xt/tt_script_tidy.t => FAIL: The test fails for koha-tmpl/intranet-tmpl/prog/en/modules/circ/checkin.tt 2. Apply this patch and repeat step 1 => SUCCESS: Tests pass 3. Restart and load the check-in page: $ ktd --shell k$ restart_all => SUCCESS: The page loads and items can be checked in 4. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #126 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209786 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209786&action=edit Bug 42383: (QA follow-up) Show the configured date format for the return date The check-in settings panel labelled the return date input 'Specify return date (MM/DD/YYYY):' whatever the dateformat system preference was. The input is a flatpickr date picker that uses the configured format, so the hint was wrong for every format but 'us'. The legacy page used date-format.inc to display the configured format. This patch (QA comment point 16) builds the hint from flatpickr_dateformat_string, set by calendar.inc from the dateformat system preference, so it reads e.g. DD/MM/YYYY, DD.MM.YYYY or YYYY-MM-DD as date-format.inc does. If it is not available, the label is displayed without a format. Test plan: 1. Enable SpecifyReturnDate and set dateformat to 'dd/mm/yyyy' 2. On the check-in page, open the check-in settings (sliders icon) => FAIL: The label reads 'Specify return date (MM/DD/YYYY):' 3. Apply this patch and rebuild: $ ktd --shell k$ yarn js:build k$ restart_all 4. Reload the page and open the settings => SUCCESS: The label reads 'Specify return date (DD/MM/YYYY):' 5. Try the other dateformat values => SUCCESS: The label matches the format used by the date picker 6. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #127 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209787 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209787&action=edit Bug 42383: (QA follow-up) Use APIClient for libraries and translate store strings The check-in Pinia store fetched the libraries list with a raw fetch('/api/v1/libraries?_per_page=-1') while APIClient, which has a library client, is already imported and used for authorised values. It also set some user visible error messages as plain, untranslatable strings. This patch (QA comment point 17) loads the libraries through APIClient.library.libraries.getAll() and wraps the remaining English strings of the store with $__(). Test plan: 1. Apply this patch and rebuild: $ ktd --shell k$ yarn js:build k$ restart_all 2. Check an item whose home library is not the logged in library in on the check-in page, with AutomaticItemReturn enabled => SUCCESS: The 'Transfer to' column and the transfer modal show the home library name (not its code) 3. Check the store strings are picked up for translation: $ ktd --shell k$ cd misc/translator k$ perl translate update fr-FR k$ grep -A1 'Network error. Please try again.' po/fr-FR-messages-js.po => SUCCESS: The string is listed 4. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #128 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209788 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209788&action=edit Bug 42383: (QA follow-up) Format patron names with $patron_to_html The check-in page built patron names by hand from surname and firstname in several places: the 'Returned by' column of the check-in table, the hold and recall patron in the confirmation modal, and the 'Hold filled for' and waiting holds alert boxes. This ignores the preferred name, middle name, other name and the 'A patron from X' fallback that the rest of the staff interface displays, and prints 'undefined' for patrons without a first name. The 'Patron #X' fallback was also not translatable. This patch (QA comment points 18 and 20) uses the global $patron_to_html helper, as other Vue components do, with invert_name (Surname, Firstname) and the card number where it was shown before. The 'Returned by' column uses its url option for the link to the patron's details page. 'Patron #%s' is wrapped with $__(). $patron_to_html escapes the patron data, so the names are rendered with v-html and no longer go through escapeHtml in the alert boxes. Test plan: 1. Create a patron with a first name, a middle name and a preferred name, and another one with only a surname 2. Check out items to both patrons, check them in on the check-in page => FAIL: The 'Returned by' column shows 'Surname, Firstname (card)', ignoring the preferred and middle names, and 'Surname, undefined' for the patron without a first name 3. Place a hold on an item for the first patron and check it in => FAIL: The hold modal shows the patron name built by hand too 4. Apply this patch and rebuild: $ ktd --shell k$ yarn js:build k$ restart_all 5. Repeat steps 2 and 3 => SUCCESS: Names are displayed as in the rest of the staff interface (e.g. 'Surname, Preferredname Middlename (cardnumber)'), linking to the same pages as before => SUCCESS: The patron without a first name shows only the surname 6. Repeat step 3 with HoldsAutoFill enabled => SUCCESS: The 'Hold filled for:' box shows the formatted name 7. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #129 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209789 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209789&action=edit Bug 42383: (QA follow-up) Restore hold group handling in the hold modal When DisplayAddHoldGroups is enabled and the hold found on check-in is part of a hold group, the legacy check-in page: - displayed 'Part of a hold group:' with a 'View patron's holds' link to the patron's holds, in the hold found modals - offered, for waiting holds, a 'Cancel all holds in hold group (X)' button calling POST /api/v1/patrons/{patron_id}/hold_groups/ {hold_group_id}/cancel with the selected cancellation reason, and labelled the single hold cancellation button 'Cancel this hold (X)' instead of 'Cancel hold (X)' The Vue page only had a TODO for it. This patch (QA comment point 19) ports that behaviour: - The hold group id comes from the embedded hold (hold.hold_group_id), already requested by the check-in client, and the display_hold_groups module policy flag (DisplayAddHoldGroups). No back-end change is needed. - A hold_groups.cancel() method is added to PatronAPIClient. - 'Cancel all holds in hold group' opens the existing cancellation pop-up, which asks for confirmation and the cancellation reason, and calls the new cancelHoldGroup() store action. On success the row is marked as checked in; on failure the error is displayed and the hold modal stays pending. Test plan: 1. Enable DisplayAddHoldGroups 2. Place a hold group for a patron on two records (staff interface, Place hold, search the patron, select 2 records and check 'Treat as hold group') 3. Check in an item of the first record => SUCCESS: The 'Hold found' modal is displayed => FAIL: There is no mention of the hold group 4. Confirm the hold, then check the item in again => FAIL: The 'Hold found (item is already waiting)' modal only offers 'Cancel hold (X)' 5. Apply this patch and rebuild: $ ktd --shell k$ yarn js:build k$ restart_all 6. Repeat step 4 => SUCCESS: The modal shows 'Part of a hold group:' and a 'View patron's holds' link opening the patron's holds in a new tab => SUCCESS: The buttons read 'Cancel all holds in hold group (X)' and 'Cancel this hold (X)' 7. Click 'Cancel all holds in hold group (X)', pick a reason and confirm => SUCCESS: The row is marked as checked in, and the patron's holds page shows both holds of the group as cancelled 8. Repeat steps 2 to 4 with DisplayAddHoldGroups disabled => SUCCESS: No hold group information is shown, and the button reads 'Cancel hold (X)' 9. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #130 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209790 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209790&action=edit Bug 42383: (QA follow-up) Do not return $__ from the check-in components The check-in components returned the $__ translation function from setup(). Vue reserves the '$' prefix for its internals and logs a warning on each mount in development builds: [Vue warn]: setup() return property "$__" should not start with "$" or "_" which are reserved prefixes for Vue internals. The function is already available to the templates as a global property, registered by the @koha-vue/i18n plugin the check-in app uses. This patch removes it from the setup() return values of the Circ/Checkin components. The Cypress support file fails the tests on any console warning, so this was making the check-in page Cypress tests fail. Test plan: 1. Run: $ ktd --shell k$ yarn js:build 2. Open the browser console and go to Circulation > Check in => FAIL: The Vue warning about "$__" is logged 3. Apply this patch, repeat 1 and 2 => SUCCESS: No warning 4. Check in some items, open the settings panel => SUCCESS: All the strings are displayed as before 5. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #131 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209791 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209791&action=edit Bug 42383: (QA follow-up) Add Cypress tests for the check-in page This patch adds end-to-end Cypress tests for the Vue check-in page (circ/checkin.pl), addressing point 9 of the QA comment. The data is created in the database using the Cypress tasks, the page is driven like staff would do it, and the outcome is verified in the database. The tests cover: - Checking in a checked out item: the row is displayed with the barcode and title, and the checkout is moved to old_issues - An unknown barcode displays an error - The barcode URL parameter prefills the input but does not check the item in - The item type check-in message is displayed as text, not HTML - A withdrawn item is not checked in with BlockReturnOfWithdrawnItems - Holds: confirming a hold for the logged in library sets it waiting, confirming a hold for another library puts it in transit with a transfer, and a waiting hold can be cancelled from the hold modal - Transfers: confirming the return to the home library sends the transfer, and TransfersBlockCirc blocks the barcode input meanwhile - Recalls: confirming a recall sets it waiting - Module policy: when the server refuses a return date because SpecifyReturnDate was disabled after the page was loaded, the page applies the policy returned in the error, tells why and no longer offers the return date The system preferences used are set by each test, and restored to their original values afterwards. All the created data is removed. Test plan: 1. Apply this patch 2. Run: $ ktd --shell k$ yarn cypress run --spec t/cypress/integration/Circulation/Checkin_spec.ts => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #132 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209792 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209792&action=edit Bug 42383: (QA follow-up) Make basic_workflow.t check in for real The check-in step of basic_workflow.t loaded circ/checkin.pl with the barcode URL parameter and checked the page title. The new page does not check in items from the URL anymore, and the title is rendered before the Vue app is even mounted, so this proved nothing. This patch addresses point 9 of the QA comment by making the test drive the Vue page like staff would: it waits for the app to be mounted, types each barcode, submits the form and waits for the item to be listed in the checked in items table, along with its title. It then checks in the database that the patron has no checkouts left. Test plan: 1. Apply this patch 2. Run: $ ktd --selenium up -d $ ktd --shell k$ prove -v t/db_dependent/selenium/basic_workflow.t => SUCCESS: Tests pass! The check-in tests now list the barcodes 3. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off --- Comment #133 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Thanks Matt! One follow-up per point: 1) Handle HoldsAutoFill errors on check-in - the item is already returned, so a HoldNotFound/ItemCheckedOut from confirm_hold now becomes a 'hold_auto_fill_failed' warning message on the checkin (with the error_code) instead of a 500. The holds queue and bundle logic still run. 2) Make checkin follow-up actions atomic - confirm_hold, cancel_hold, confirm_transfer, cancel_transfer, confirm_recall and replace_wrong_transfer run inside a transaction. Tests make the transfer step die and check the hold is untouched. 3) Mark the row of the resolved return claim - the modal emits the claim_id and the matching row is updated (Cypress test with two claimed items). 4) Restore the time and past-only return date - the picker takes a time and blocks future dates as the legacy page did. The API now takes a date-time and rejects future dates with 400 'return_date_in_future'. 5) The X-Koha-Module-Policy header is gone: the series was re-uploaded with the policy returned as an optional, well-defined 'policy' attribute of the error object instead (see the previous comment). 6) Fix the Location header of checkin actions - it is now the action path (e.g. /api/v1/checkins/1/hold_confirmation), without the action token query string. Back to Signed Off for your review. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #134 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209812 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209812&action=edit Bug 42383: (QA follow-up) Handle HoldsAutoFill errors on check-in When HoldsAutoFill is enabled, POST /checkins calls confirm_hold on the new checkin without catching its exceptions. If the hold was cancelled or filled in the meantime (Koha::Exceptions::Checkin::HoldNotFound), or the item was checked out again (ItemCheckedOut), the request fails with a 500 and no explanation, even though the item has already been returned. The holds queue update and the bundle verification that come after it are skipped too. This patch addresses point 1 of comment #77. As the return has already happened, failing the whole request would be misleading: the check-in is kept and the outcome is reported as a 'hold_auto_fill_failed' warning message on it, with the same error_code values the hold_confirmation endpoint uses (hold_not_found, item_checked_out) and the reserve_id. The rest of the post-return processing runs as usual. Unexpected exceptions are still rethrown and rendered as a 500. The check-in page displays the warning, and does not open the hold modal for that check-in as there is no hold left to confirm. The new message is documented in the checkin definition. Test plan: 1. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/checkins.t => FAIL: The 'add - HoldsAutoFill failure' tests fail, the check-in returns 500 2. Apply this patch 3. Run: k$ yarn api:bundle k$ restart_all k$ prove t/db_dependent/api/v1/checkins.t => SUCCESS: Tests pass! 4. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #135 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209813 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209813&action=edit Bug 42383: (QA follow-up) Make checkin follow-up actions atomic Koha::Checkin->confirm_hold makes several writes: ModReserveAffect sets the hold aside, then a transfer is requested and sent, and the checkin is linked to it. They are not done in a transaction, so an error while creating or sending the transfer leaves the hold in transit with no transfer. This patch addresses point 2 of comment #77 by wrapping the writes of confirm_hold in a transaction. The other checkin actions writing more than once are wrapped the same way: - cancel_hold: cancels the hold and unlinks it from the checkin - confirm_transfer: requests the transfer, links it and sends it - cancel_transfer: cancels the transfer, reverts an in transit recall and unlinks the transfer from the checkin - confirm_recall: Koha::Recall->start_transfer updates the recall and creates the transfer, set_waiting updates the recall and the item - replace_wrong_transfer: replaces the transfer and links the new one confirm_transfer now checks its parameters before starting the transaction. The behaviour is unchanged. Test plan: 1. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Checkin.t => FAIL: When sending the transfer fails, the hold is left in transit and a transfer is created 2. Apply this patch 3. Run: k$ prove t/db_dependent/Koha/Checkin.t \ t/db_dependent/api/v1/checkins.t => SUCCESS: Tests pass! 4. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #136 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209814 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209814&action=edit Bug 42383: (QA follow-up) Mark the row of the resolved return claim When a return claim is resolved from the check-in page, onClaimResolved marks the first row of the table with a pending claim as resolved, not the row of the claim that was resolved. With several claimed items checked in, the wrong row loses its 'Resolve claim' button and the right one keeps it. This patch addresses point 3 of comment #77: ResolveClaimModal now passes the id of the resolved claim along with the 'resolved' event, and onClaimResolved marks the row whose return_claim message carries that claim id. A Cypress test is added: two items claimed returned are checked in, the claim of the older one (second row) is resolved, and only its row is marked as resolved. Test plan: 1. Set ClaimReturnedLostValue to any lost value, and leave AutoClaimReturnStatusOnCheckin empty 2. Check out two items to a patron, and mark both as claims returned from the patron's checkouts table 3. Check in both items on the check-in page 4. Click 'Resolve claim' on the row of the first item checked in (the second row), pick a resolution and resolve => FAIL: The first row loses its 'Resolve claim' button, the resolved item keeps it 5. Apply this patch 6. Run: $ ktd --shell k$ yarn js:build 7. Repeat 2 to 4 => SUCCESS: The row of the resolved claim is marked as resolved, the other one still offers 'Resolve claim' 8. Run: k$ yarn cypress run --spec t/cypress/integration/Circulation/Checkin_spec.ts => SUCCESS: Tests pass! 9. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #137 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209815 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209815&action=edit Bug 42383: (QA follow-up) Restore the time and past-only return date On the legacy returns page, the return date override took a time (data-flatpickr-enable-time) and future dates could not be picked (data-flatpickr-pastinclusive). The check-in page only offers a date, which is sent as midnight, and allows dates in the future. The API accepts any string as return_date, a future one included. This patch addresses point 4 of comment #77: - FlatPickrWrapper takes a 'config' prop, merged into the Koha flatpickr defaults - The return date picker takes a time, displayed according to TimeFormat, and its maximum date is now (refreshed when it is opened). The data attributes read by the flatpickr defaults are set too, so the date and time input mask is used, 'Today' sets the current time, and 'Tomorrow' is disabled like on the legacy page - The value sent to the API is a date-time without offset (e.g. 2026-10-29T10:30:00), so it is in the Koha time zone, like the legacy page posted it. The 'Return date' badge displays the time - POST /checkins declares return_date as a date-time, parses it as ISO (honouring the offset if any) and rejects a date in the future with a 400 and the 'return_date_in_future' error code, documented in the spec. The page displays a translatable message for it Test plan: 1. Apply this patch 2. Run: $ ktd --shell k$ yarn api:bundle k$ yarn js:build k$ restart_all 3. Enable SpecifyReturnDate 4. Check out an item, go to Circulation > Check in and open the check-in settings 5. Open the return date picker => SUCCESS: Dates after today are disabled, and so is 'Tomorrow' => SUCCESS: A time can be picked, in the TimeFormat format 6. Pick yesterday at 10:30 and check the item in => SUCCESS: The 'Return date' badge shows the date and time => SUCCESS: The item is checked in, and the return date on the item's checkout history shows yesterday at 10:30 7. Run: k$ prove t/db_dependent/api/v1/checkins.t xt/api.t => SUCCESS: Tests pass! k$ yarn cypress run --spec t/cypress/integration/Circulation/Checkin_spec.ts => SUCCESS: Tests pass! 8. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #138 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209816 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209816&action=edit Bug 42383: (QA follow-up) Fix the Location header of checkin actions The /checkins/{checkin_id}/* action endpoints set the Location header of their 201 responses to the request URL with the checkin id appended, e.g. /api/v1/checkins/1/hold_confirmation?action_token=...1. That URI does not exist, and it carries the action token. This patch addresses point 6 of comment #77. Like the other action endpoints in Koha (e.g. POST /holds/{hold_id}/suspension), the Location header is the URI of the action performed, i.e. the request path, e.g. /api/v1/checkins/1/hold_confirmation. The query string is left out so the action token is not echoed. The header description in the spec is updated accordingly. The tests now check the header for all the action endpoints. Test plan: 1. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/checkins.t => FAIL: The Location header is wrong 2. Apply this patch 3. Run: k$ yarn api:bundle k$ restart_all k$ prove t/db_dependent/api/v1/checkins.t xt/api.t => SUCCESS: Tests pass! 4. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #139 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- All the points above are addressed, thanks Tomas. I'm getting a small merge conflict when applying to a fresh main so that will need rebasing Two final points from the follow-up patches: 1) Checkins.pm line 131 - I think we need the same guard here as in Checkouts.pm. The eval with render_invalid_parameter_value pattern prevents a 500 error if there is a difference in timezone or fractions of a second that passes the swagger checks 2) Main.vue line 707 onResolveClaimFromRow doesn't clear the activeModalItem before showing the modal - the modal would stay open until _advanceModal is called. The logic here is also nearly identical to onResolveClaimFromModal - could these be combined? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #209739|0 |1 is obsolete| | Attachment #209740|0 |1 is obsolete| | Attachment #209741|0 |1 is obsolete| | Attachment #209742|0 |1 is obsolete| | Attachment #209743|0 |1 is obsolete| | Attachment #209744|0 |1 is obsolete| | Attachment #209745|0 |1 is obsolete| | Attachment #209746|0 |1 is obsolete| | Attachment #209747|0 |1 is obsolete| | Attachment #209748|0 |1 is obsolete| | Attachment #209749|0 |1 is obsolete| | Attachment #209750|0 |1 is obsolete| | Attachment #209751|0 |1 is obsolete| | Attachment #209752|0 |1 is obsolete| | Attachment #209753|0 |1 is obsolete| | Attachment #209754|0 |1 is obsolete| | Attachment #209755|0 |1 is obsolete| | Attachment #209756|0 |1 is obsolete| | Attachment #209757|0 |1 is obsolete| | Attachment #209758|0 |1 is obsolete| | Attachment #209759|0 |1 is obsolete| | Attachment #209760|0 |1 is obsolete| | Attachment #209761|0 |1 is obsolete| | Attachment #209762|0 |1 is obsolete| | Attachment #209763|0 |1 is obsolete| | Attachment #209764|0 |1 is obsolete| | Attachment #209765|0 |1 is obsolete| | Attachment #209766|0 |1 is obsolete| | Attachment #209767|0 |1 is obsolete| | Attachment #209768|0 |1 is obsolete| | Attachment #209769|0 |1 is obsolete| | Attachment #209770|0 |1 is obsolete| | Attachment #209771|0 |1 is obsolete| | Attachment #209772|0 |1 is obsolete| | Attachment #209773|0 |1 is obsolete| | Attachment #209774|0 |1 is obsolete| | Attachment #209775|0 |1 is obsolete| | Attachment #209776|0 |1 is obsolete| | Attachment #209777|0 |1 is obsolete| | Attachment #209778|0 |1 is obsolete| | Attachment #209779|0 |1 is obsolete| | Attachment #209780|0 |1 is obsolete| | Attachment #209781|0 |1 is obsolete| | Attachment #209782|0 |1 is obsolete| | Attachment #209783|0 |1 is obsolete| | Attachment #209784|0 |1 is obsolete| | Attachment #209785|0 |1 is obsolete| | Attachment #209786|0 |1 is obsolete| | Attachment #209787|0 |1 is obsolete| | Attachment #209788|0 |1 is obsolete| | Attachment #209789|0 |1 is obsolete| | Attachment #209790|0 |1 is obsolete| | Attachment #209791|0 |1 is obsolete| | Attachment #209792|0 |1 is obsolete| | Attachment #209812|0 |1 is obsolete| | Attachment #209813|0 |1 is obsolete| | Attachment #209814|0 |1 is obsolete| | Attachment #209815|0 |1 is obsolete| | Attachment #209816|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #140 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- (In reply to Matt Blenkinsop from comment #139)
All the points above are addressed, thanks Tomas.
I'm getting a small merge conflict when applying to a fresh main so that will need rebasing
Two final points from the follow-up patches:
1) Checkins.pm line 131 - I think we need the same guard here as in Checkouts.pm. The eval with render_invalid_parameter_value pattern prevents a 500 error if there is a difference in timezone or fractions of a second that passes the swagger checks
2) Main.vue line 707 onResolveClaimFromRow doesn't clear the activeModalItem before showing the modal - the modal would stay open until _advanceModal is called. The logic here is also nearly identical to onResolveClaimFromModal - could these be combined?
Please check. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #141 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210450 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210450&action=edit Bug 42383: Add Koha::Module::Policy framework This patch adds a module policy framework that exposes per-module capabilities to the UI. This replaces the pattern of dedicated GET /config endpoints (like GET /erm/config) with a reactive, session-scoped mechanism. A module policy is the intersection of: - System preferences (feature toggles) - User permissions (what this staff member can do) - Library context (branch-specific configuration) The policy is a plain JSON structure: an envelope with the `module` name, a `global` block with the keys common to all modules, and the module-specific keys under the module name: { module => 'checkin', global => { audio_alerts => true, ... }, checkin => { exempt_fine => false, ... }, } Flags are JSON booleans. Modules cannot override the global keys, as they live in their own namespace. The page is bootstrapped with the policy, and the API returns it in the error object when it refuses a request because of it, so the client can refresh the UI. The server remains authoritative - the policy is informational, not an access token. Components: - Koha::Module::Policy - Base class with new(), module(), to_hashref() and scope() - Koha::Module::Policy::Checkin - Checkin module policy covering fines, holds, recalls, transfers, display, and blockers Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Module/Policy.t \ t/db_dependent/Koha/Module/Policy/Checkin.t => SUCCESS: Tests pass 3. Tests cover: - Base class constructor validation - Abstract method enforcement - scope() derivation from class name - The policy envelope, and globals not being overridable by modules - Permission-gated capabilities (exempt_fine, forgive_hold_fees) - Superlibrarian vs limited user - Flags being JSON booleans 4. Sign off :-D Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #142 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210451 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210451&action=edit Bug 42383: Add Koha::REST::Plugin::Policy This patch adds a Mojolicious plugin that provides the module_policy helper to any API controller. Usage: return $c->render( status => 403, openapi => { error => 'Return date override is not enabled', error_code => 'return_date_not_allowed', policy => $c->module_policy( 'Checkin', { library => $library_id } ), } ); The helper dynamically loads the appropriate Koha::Module::Policy subclass and returns the policy envelope for the authenticated user, so controllers can include it in the `policy` attribute of the error object when refusing a request because of it. This avoids duplicating the policy building logic across controllers. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/REST/Plugin/Policy.t => SUCCESS: Tests pass 3. Sign off :-D Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #143 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210452 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210452&action=edit Bug 42383: Add Koha::Checkin->confirm_hold This patch adds a confirm_hold() domain method to Koha::Checkin that sets the trapped hold to waiting. If the pickup library differs from the checkin library, it also creates a transfer and sets it in transit. This moves the logic out of the controller into the domain object, making it testable independently and reusable (e.g. for HoldsAutoFill). Throws Koha::Exceptions::MissingParameter if the checkin has no hold_id. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Checkin.t => SUCCESS: Tests pass 3. Tests cover: - confirm_hold at same library (hold set to waiting, no transfer) - confirm_hold at different library (hold in transit, transfer created) - confirm_hold without hold_id (throws MissingParameter) 4. Sign off :-D Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #144 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210453 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210453&action=edit Bug 42383: Add Koha::Checkin->cancel_hold This patch adds a cancel_hold() domain method to Koha::Checkin that cancels the trapped hold and clears the hold_id on the checkin record. Accepts an optional hashref with a 'reason' key for the cancellation reason (authorised value from HOLD_CANCELLATION). Throws Koha::Exceptions::MissingParameter if the checkin has no hold_id. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Checkin.t => SUCCESS: Tests pass 3. Tests cover: - cancel_hold without reason (no notification) - cancel_hold with reason (letter warning expected, reason stored) - cancel_hold without hold_id (throws MissingParameter) 4. Sign off :-D Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #145 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210454 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210454&action=edit Bug 42383: Add Koha::Checkin->confirm_transfer This patch adds a confirm_transfer() domain method to Koha::Checkin that sets the associated transfer in transit (populates datesent). The method is idempotent — calling it on an already-sent transfer is a no-op. Throws Koha::Exceptions::MissingParameter if the checkin has no transfer_id. No fuzzy fallbacks to item->get_transfer. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Checkin.t => SUCCESS: Tests pass 3. Tests cover: - confirm_transfer sets transfer in transit - confirm_transfer is idempotent on already-sent transfer - confirm_transfer without transfer_id (throws MissingParameter) - Returns $self for chaining 4. Sign off :-D Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #146 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210455 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210455&action=edit Bug 42383: Add Koha::Checkin->cancel_transfer This patch adds a cancel_transfer() domain method to Koha::Checkin that cancels the associated transfer and clears the transfer_id. If UseRecalls is enabled and the item has a recall in transit, the recall transfer is also reverted. Throws Koha::Exceptions::MissingParameter if the checkin has no transfer_id. No fuzzy fallbacks. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Checkin.t => SUCCESS: Tests pass 3. Tests cover: - cancel_transfer cancels the transfer (datecancelled set) - transfer_id cleared on the checkin - cancel_transfer without transfer_id (throws MissingParameter) 4. Sign off :-D Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #147 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210456 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210456&action=edit Bug 42383: Add Koha::Checkin->confirm_recall This patch adds a confirm_recall() domain method to Koha::Checkin that resolves the recall associated with the checkin: - If the recall's pickup library matches the checkin library, sets the recall to waiting with a calculated expiration date. - If the pickup library differs, starts a transfer (sets status to in_transit). The method is idempotent — calling it on an already-resolved recall is a no-op. Throws Koha::Exceptions::MissingParameter if the checkin has no recall_id. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Checkin.t => SUCCESS: Tests pass 3. Tests cover: - confirm_recall at same library (set to waiting + expiration date) - confirm_recall at different library (set to in_transit) - Idempotent on already in-transit recall - confirm_recall without recall_id (throws MissingParameter) 4. Sign off :-D Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #148 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210457 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210457&action=edit Bug 42383: Add checkin sub-resource confirmation/cancellation endpoints Adds the hold/transfer/recall confirmation and cancellation sub-resource endpoints on top of the checkin REST API: * POST /checkins/{checkin_id}/hold_confirmation * POST /checkins/{checkin_id}/hold_cancellation * POST /checkins/{checkin_id}/transfer_confirmation * POST /checkins/{checkin_id}/transfer_cancellation * POST /checkins/{checkin_id}/recall_confirmation Each delegates to the matching Koha::Checkin method and renders a shared 201 response via _render_checkin_response (Location header included). The module policy is returned, in the `policy` attribute of the error object, only on the permission error paths (exempt_fine, forgive_hold_fees, return_date), not on success responses: the Vue app is hydrated with the policy at template load time, so recomputing it on every successful checkin would waste CPU. The client refreshes its view of the policy exactly when it is stale: when the server refuses a request because of it. The checkin definition gains the full `messages` documentation and the availability definition its confirms/item_parts additions. The error definition gains the optional `policy` attribute, described by the new module_policy, module_policy_global and checkin_policy definitions. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove xt/api.t t/db_dependent/api/v1/checkins.t => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #149 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210458 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210458&action=edit Bug 42383: Add checkin messages and item-parts/bundle confirmations Extends the checkin flow with net-new behavior on top of the checkin audit record: * _attach_messages_to_checkin gains three independent messages: - item_type_checkinmsg: the item type's checkin message - patron_has_fines: when FineNotifyAtCheckin is on and the patron who had the item has an outstanding balance - patron_has_waiting_holds: when WaitingNotifyAtCheckin is on and the patron has holds waiting for pickup at the current branch * Koha::Item::Availability::Checkin gains two confirmations: - item_parts: multi-part item (CircConfirmItemParts) needs staff acknowledgement of the accompanying materials - items_bundle: bundle items need content verification The existing blocker/confirmation key names (NotIssued, BlockedWithdrawn, Wrongbranch, BlockedLost) are intentionally left unchanged; renaming them is out of scope here and would ripple into SIP, AddReturn and existing tests. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Circulation.t t/db_dependent/Koha/Item/Availability/Checkin.t t/db_dependent/Koha/Checkin.t => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #150 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210459 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210459&action=edit Bug 42383: Add Vue.js checkin page Adds the Vue-based checkin (returns) page that consumes the checkin REST API and its sub-resource confirmation/cancellation endpoints: * circ/checkin.pl + checkin.tt entry point * Vue module, store and components (BarcodeInput, CheckedInItems, CheckinOptions, ConfirmationModal, ResolveClaimModal, BundleVerificationModal, Main) under vue/components/Circ/Checkin/ * checkin-api-client fetch client, registered in the Vue api-client * rspack: new `checkin` entry building to js/vue/dist/checkin.js * http-client: honour return_response on non-ok responses so callers can inspect the error body/headers * Koha::Checkin->verify_bundle for the bundle verification modal * docs/checkin-vue-usecases.md The Vue app reads its module policy from the page hydration at load time (it is not fetched per request). When the API refuses a request because of the policy (e.g. a permission was revoked since the page was loaded), the error object carries the current policy: the store applies it, so the revoked options are no longer offered, and tells the user why the request was refused. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ yarn build => SUCCESS: rspack compiles, js/vue/dist/checkin.js is produced 3. Enable the page, go to Circulation -> Check in (checkin.pl), scan a barcode => SUCCESS: item is checked in, confirmations/messages render 4. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #151 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210460 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210460&action=edit Bug 42383: Remove legacy returns.pl, wire checkin.pl Retires the legacy circ/returns.pl checkin page in favour of the new Vue circ/checkin.pl, and repoints every entry point to it: * circ-nav.inc, checkin-search-box.inc, circulation-home.tt, staff-global.js: 'Check in' links/search now target checkin.pl * ILL SupplyingResource.vue: checkin action targets checkin.pl * circ/returns.pl and circ/returns.tt are removed * Main.vue honours a ?barcode= deep-link query param so links carried over from returns.pl keep working (auto-submits the checkin) * basic_workflow.t selenium flow updated to the new page The transfers-to-receive page keeps its bug 42443 AJAX DataTable implementation (it already cancels transfers through the REST API and never linked to returns.pl), so its 42383-era changes are not needed. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ yarn build => SUCCESS: rspack compiles 3. From the circ home, nav sidebar, and header search 'Check in', confirm they all open circ/checkin.pl 4. Visit /cgi-bin/koha/circ/checkin.pl?barcode=<known barcode> => SUCCESS: the item is checked in automatically 5. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #152 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210461 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210461&action=edit Bug 42383: Add tests for checkin sub-resource endpoints and messages Adds API test coverage for the Bug 42383 additions: * sub-resource confirmation endpoints (hold/transfer confirmation and cancellation): not-found, no-associated-resource (400), and the happy paths (201 + Location, hold set waiting, transfer set in transit / cancelled) * add - post-checkin messages: was_lost message serialization; the not-issued case keeps the 24401 confirmation flow (412 confirmation_required) * add - return_date and dropbox_mode coverage * module policy on error paths: the exempt_fine and return_date permission errors (403) carry the module policy in the `policy` attribute of the error object, other errors do not (the Vue app is hydrated with the policy at template load) Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/checkins.t => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #153 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210462 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210462&action=edit Bug 42383: Use snake_case for checkin availability keys The checkin availability object (Koha::Item::Availability::Checkin) is surfaced directly to the API through GET /checkins/availability and the 412 confirmation response, so its blocker/confirmation/warning keys are API-facing values and should be standard, meaningful snake_case: NotIssued -> not_issued (confirmation) BlockedWithdrawn -> blocked_withdrawn (blocker) BlockedLost -> blocked_lost (blocker) Wrongbranch -> wrong_branch (blocker) { Wrongbranch, Rightbranch } -> { wrong_branch, right_branch } The keys are now documented in the checkin_availability definition. AddReturn keeps consuming the availability object internally, and still exposes its own legacy $messages hashref (Wrongbranch => { Wrongbranch, Rightbranch }, NotIssued, ...) unchanged, so C4::SIP and existing AddReturn callers/tests are unaffected: the snake_case values are mapped back to the legacy structure where AddReturn builds $messages. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Item/Availability/Checkin.t \ t/Koha/Result/Availability.t \ t/db_dependent/api/v1/checkins.t \ t/db_dependent/Circulation.t \ t/db_dependent/SIP/Transaction.t \ xt/api.t => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #154 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210463 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210463&action=edit Bug 42383: (follow-up) Match the legacy hold/transfer checkin modals Bring the Vue checkin confirmation modal in line with the legacy returns page for the hold and transfer cases: - Show the item as a "Title (barcode)" heading, linked to moredetail.pl - Show the patron note recorded on the checkout - Show library names and the "Hold at" / "Checked in at" headings - Match the legacy hold modal title and "Hold for" layout - Match the legacy transfer modal behaviour - Offer hold cancellation from the hold modal via a secondary (nested) modal rather than an inline action Test plan: 1. Exercise hold-found and transfer checkins on the Vue checkin page => SUCCESS: the confirmation modal matches the legacy returns page 2. From a hold-found checkin, cancel the hold => SUCCESS: cancellation is confirmed through a secondary modal 3. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #155 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210464 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210464&action=edit Bug 42383: (follow-up) Show item type checkin message text The check in message area rendered the item_type_checkinmsg message as the raw "item type checkinmsg" key. Render its payload text instead (the item type's configured checkin message), matching what the legacy returns.pl dialog shows in its dedicated box. Test plan: 1. Apply patch, yarn build 2. Set a checkin message on an item type; check in such an item => SUCCESS: the modal shows the actual checkin message text 3. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #156 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210465 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210465&action=edit Bug 42383: (follow-up) Flesh out the recall found checkin modal The recall modal was a stub (title + an empty "Recall found" line). Bring it in line with the legacy returns.pl recall dialog: * "Recall placed by:" bulleted patron block (name link, address, phone, email) from the embedded recall.patron. * Recall notes, when present. * "Transfer required for recall" hint when the recall needs a transfer. * "Recall at <library name>" heading from the recall pickup library. * Add the "Ignore (I)" button alongside Confirm / Print and confirm. Test plan: 1. Apply patch, yarn build 2. Recall an item (UseRecalls) checked out to another patron, then check it in => SUCCESS: the modal shows who placed the recall, the pickup library, and Confirm / Print and confirm / Ignore 3. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #157 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210466 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210466&action=edit Bug 42383: (follow-up) Show patron notification info in hold and recall modals The legacy returns page shows how the patron will be notified in the hold and recall confirmation dialogs. Consume the notification_summary embed (Bug 43486) to render the same detail: - "Patron notification: Email, SMS." (or "Patron is not notified.") - "Main contact method: ..." The hold modal uses the Hold_Filled transports; the recall modal uses the Recall_Waiting transports (the notice that fires when a recall is set waiting on checkin). The boxes are styled like the legacy page. This wires hold.patron.notification_summary and recall.patron.notification_summary into the checkin embed (client and swagger enum) and renders the lines in ConfirmationModal. Test plan: 1. Have a patron with a Hold_Filled and/or Recall_Waiting messaging preference set, and place a hold/recall 2. Check the item in, yarn build => SUCCESS: the confirmation modal shows the patron notification line and the main contact method, matching the legacy returns page 3. Try a patron with no messaging preference => SUCCESS: the modal shows "Patron is not notified." in a grey box 4. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #158 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210467 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210467&action=edit Bug 42383: (follow-up) Match legacy behaviour for blocked, bundle, waiting-hold, claim and local-use checkins Round out the Vue checkin page so the remaining returns.pl use cases match the legacy behaviour: - Blocked check-ins (e.g. wrong branch) open a "Cannot check in" modal with the destination library and accompanying-materials note - The bundle verification status column is consistent (Verified / Not verified / Lost) - The waiting-holds alert names the patron (via the checkout.patron embed) and is shown first - The return-claim modal shows the lost/fee check-in messages inline and uses the standard button palette and "Ignore" idiom - Not-issued items are checked in directly via x-koha-override, recording local use when RecordLocalUseOnReturn is set - "Print slip and confirm" for holds and recalls ports bug 42505: an empty popup is opened during the click (so it is not blocked) and the hold slip is only loaded into it after the confirm_hold/confirm_recall call succeeds, so waitingdate/expirationdate are current on the first print. The popup is closed if the confirmation fails. Test plan: 1. Exercise each of the above checkin scenarios on the Vue checkin page => SUCCESS: behaviour and layout match the legacy returns page 2. Set HoldsAutoFill to "Don't", add Waiting since: [% hold.waitingdate | $KohaDates %] to the HOLD_SLIP notice, check in an item with a hold for the check-in library and click "Print slip and confirm" => SUCCESS: The popup is not blocked and the slip shows today's waiting date on the first print 3. prove t/db_dependent/api/v1/checkins.t => SUCCESS 4. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #159 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210468 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210468&action=edit Bug 42383: (QA follow-up) Restore legacy post-return processing in the checkin API QA testing (comments 9 and 10) found several things returns.pl did after AddReturn that POST /checkins did not. This patch adds them: - HoldsAutoFill: when a hold is found (and not already waiting) the hold is now filled on checkin, as returns.pl did, using Koha::Checkin->confirm_hold. A 'hold_auto_filled' message is added so the client can skip the hold modal. - Wrong transfers: a new Koha::Checkin->replace_wrong_transfer replaces the transfer with one from the checkin library (replace => 'WrongTransfer', ignore_limits => 1) and links it to the checkin, so transfer_confirmation/transfer_cancellation work on it. - Bundles: verified_bundle_barcodes is now processed. verify_bundle also sets datelastborrowed, records a return claim and charges the replacement fee (WhenLostChargeReplacementFee) for missing items, like returns.pl. 'bundle_missing_items' and 'bundle_unexpected_items' messages report the outcome. The patron is the one returned by AddReturn, as the stored checkout may already be anonymized. - Koha::Checkin->cancel_hold honours forgive_hold_fees (it was accepted by the endpoint but ignored), charging the cancellation fee otherwise. - The in_bundle message payload now carries the host biblio id and barcode, so the client can link to the host record. - checkout.patron.checkouts+count can be embedded. - The checkin module policy exposes dropbox_date and anonymous_patron_id, and recalls_enabled is now false when UseRecalls is 'off' (it was always true). Koha::Checkin->cancel_transfer had the same UseRecalls check. Test plan: 1. Apply this patch 2. Run: $ ktd --shell k$ yarn api:bundle k$ restart_all k$ prove t/db_dependent/Koha/Checkin.t \ t/db_dependent/api/v1/checkins.t \ t/db_dependent/Koha/Module/Policy/Checkin.t \ t/db_dependent/Circulation.t \ xt/api.t => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #160 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210469 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210469&action=edit Bug 42383: (QA follow-up) Address check-in page QA findings This patch addresses the check-in page findings from QA (comments 9 and 10), using the API changes from the previous patch: - Sidebar: checkin.tt used the CircSidebar preference, removed by bug 42344, so the circulation sidebar never showed. - Notes column: read the API keys (staff_notes, public_notes, internal_notes) so patron and item notes are displayed. - Patron column: link the patron and show the checkouts count (checkout.patron.checkouts+count). Anonymized checkouts (privacy "Never") no longer show the AnonymousPatron or a checkin slip button. - Print checkin slip opens members/printslip.pl?print=checkinslip. - Book drop mode shows the effective checkin date. - HoldsAutoFill: auto-filled holds don't open the hold modal; a "Hold filled for" box with a Print button is shown, and the slip is printed when HoldsAutoFillPrintSlip is set. - AutomaticConfirmTransfer: the transfer modal no longer confirms itself after a second. As on the legacy page, a non-blocking transfer is confirmed when staff move on (scan the next item). - Hold cancellation: the reason is now sent (wrong authorised value key) together with "Forgive fees for manually expired holds". - "Ignore" on hold, recall and claim modals keeps the row as checked in instead of marking it "Not checked in". - "No, don't transfer" clears the transfer from the row. - Hold modal: "Transfer to" / "Confirm hold and transfer" for holds at another library, and "Hold found (item is already waiting)". - Bundles: the verification table shows title and author, all scanned barcodes are sent (unexpected items are removed from their bundle), missing and unexpected items are reported, "Remove from bundle" works and links to the host record. - Messages: no "Already returned" badge on every return, a single lost item fee outcome (as the legacy IF/ELSIF), not for loan and shelving location changes show old and new values, the checkout note is shown on every return with a formatted date, and an unknown barcode shows "No item with barcode: X". - Values interpolated into the message boxes are HTML-escaped. Test plan: 1. Apply this patch and rebuild: $ ktd --shell k$ yarn js:build k$ restart_all 2. Go to Circulation -> Check in and repeat the scenarios from the QA comments 9 and 10, comparing with the legacy page on main => SUCCESS: Behaviour matches the legacy page 3. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #161 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210470 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210470&action=edit Bug 42383: (QA follow-up) Fix check-in page findings from browser testing This patch fixes differences with the legacy returns.pl page found by testing both pages side by side in the browser. Changes: - Main.vue: a transfer modal disables the barcode input when TransfersBlockCirc is set, so a scanner cannot check in the next item behind it. The input is focused again once the transfer is resolved. - ConfirmationModal.vue: "Cancel hold" is only offered for holds that are already waiting, as on the legacy page. On an unconfirmed record-level hold it failed with a 500 (Koha::Hold->cancel needs an item to calculate the cancellation fee). - stores/checkin.js: confirming a hold that needs a transfer shows the transfer (destination and reason) on the row. - CheckedInItems.vue: due and acquisition dates are formatted with $date() (dateformat syspref) instead of the browser locale. - POST /checkins accepts the item+strings, hold.patron+strings and recall.patron+strings embeds. The table shows shelving location, item type and collection descriptions, and the hold/recall modals show the patron category description, instead of the codes. - The transfer modal no longer shows "Already returned": was_returned is set on every return and the legacy page never displayed it. - Patron card numbers are shown next to the patron names. - The item type check-in message gets a label in the status column. - The print button reads "Print slip, transfer, and confirm (P)" when the hold needs a transfer, as on the legacy page. Test plan: 1. Apply patch and rebuild: $ ktd --shell k$ yarn api:bundle && yarn js:build && restart_all 2. Set TransfersBlockCirc to "Block", AutomaticItemReturn to "Do", HoldsAutoFill to "Don't", and set your browser language to one that uses day/month dates (e.g. Spanish) 3. Check out to a patron: an item from another library (A), an item with a shelving location (B), an item with a record-level hold for pickup at another library (C) 4. Go to Circulation > Check in, check in A => SUCCESS: The transfer modal shows, the barcode input is disabled => SUCCESS: No "Already returned" message in the modal 5. Scan B with the modal open => SUCCESS: Nothing is checked in 6. Click "Yes, transfer" => SUCCESS: The barcode input is enabled and focused 7. Check in B => SUCCESS: Dates follow the dateformat syspref => SUCCESS: Shelving location and item type show their descriptions => SUCCESS: The patron card number is shown 8. Check in C => SUCCESS: The patron category description and card number show => SUCCESS: There is no "Cancel hold" button => SUCCESS: The print button reads "Print slip, transfer, and confirm" 9. Click "Confirm hold and transfer" => SUCCESS: The row shows the destination library and "Hold" reason 10. Check in an item with a waiting hold, click "Cancel hold", pick a reason and confirm => SUCCESS: The hold is cancelled with the chosen reason 11. Run: k$ prove t/db_dependent/api/v1/checkins.t xt/api.t => SUCCESS: Tests pass! 12. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #162 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210471 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210471&action=edit Bug 42383: (QA follow-up) Ask to transfer when AutomaticItemReturn is disabled When an item checked in needs to go back to another library and AutomaticItemReturn is disabled, AddReturn does not create a transfer and only reports NeedsTransfer. The legacy page asked "Transfer now?" and created the transfer on "Yes". The new page showed no modal at all, so there was no way to start the transfer from the check-in page. This patch: - Makes Koha::Checkin->confirm_transfer accept to_library_id and reason. If the checkin has no transfer yet, it requests one to that library (reason defaults to Manual) and sets it in transit. - Makes POST /checkins/{checkin_id}/transfer_confirmation accept an optional body with to_library_id and reason. It returns 400 if there is no transfer and no valid library, and 409 if the transfer is not allowed by the branch transfer limits or one is already pending. - Makes the check-in page show the transfer modal for needs_transfer, with "Transfer now?" and a "No, don't transfer" button. "Yes" requests the transfer using the destination and reason the checkin reported. Test plan: 1. Set AutomaticItemReturn to "Don't automatically transfer" 2. Check out an item whose home library is not your logged in library 3. Go to Circulation > Check in and check the item in => FAIL: No modal is shown, the transfer cannot be started 4. Apply this patch, rebuild and restart: $ ktd --shell k$ yarn api:bundle && yarn js:build && restart_all 5. Repeat steps 2 and 3 => SUCCESS: The modal asks "Transfer now?" 6. Click "Yes, transfer" => SUCCESS: The row shows the transfer, the item is in transit to its home library (check the item details page) 7. Repeat steps 2 and 3, click "No, don't transfer" => SUCCESS: No transfer is created, the row shows no transfer 8. Run: k$ prove t/db_dependent/Koha/Checkin.t \ t/db_dependent/api/v1/checkins.t \ xt/api.t => SUCCESS: Tests pass! 9. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #163 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210472 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210472&action=edit Bug 42383: (QA follow-up) Format restriction and return dates on the check-in page This patch fixes the remaining dates on the check-in page that did not follow the dateformat syspref: - The "Patron is now restricted" and "Patron was earlier restricted" messages now include the restriction end date, formatted with $date() as the legacy page did with $KohaDates. They used to omit the date. - The "Return date" badge shown while the options panel is collapsed displayed the raw ISO date (2026-10-10). It is now formatted. Test plan: 1. Apply patch and rebuild: $ ktd --shell k$ yarn js:build && restart_all 2. Set the 'Suspension in days' circulation rule to 1 and check out an overdue item to a patron (e.g. backdate the checkout) 3. Go to Circulation > Check in and check the item in => SUCCESS: "Patron is now restricted until <date>." uses the dateformat syspref 4. Check in another overdue item of the same patron => SUCCESS: "Reminder: Patron was earlier restricted until <date>." uses the dateformat syspref 5. Enable SpecifyReturnDate, open the check-in settings, pick a return date and collapse the settings => SUCCESS: The "Return date" badge uses the dateformat syspref 6. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #164 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210473 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210473&action=edit Bug 42383: Do not set a hold aside for an item checked out in the meantime Bug 43803 made ModReserveAffect return 0 and leave the hold untouched when the item has been checked out again while the hold confirmation was pending (e.g. from another workstation). The legacy returns.pl displayed a warning and skipped the transfer in that case, but Koha::Checkin->confirm_hold ignored the return value: it created and sent a transfer to the pickup library for an item that is on loan, and the hold_confirmation endpoint reported success. This patch makes Koha::Checkin->confirm_hold throw the new Koha::Exceptions::Checkin::ItemCheckedOut exception (before any transfer is created) when ModReserveAffect refuses the hold, and makes POST /checkins/{checkin_id}/hold_confirmation return 409 with the 'item_checked_out' error code. The check-in page shows the error and keeps the hold pending. Test plan: 1. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Checkin.t \ t/db_dependent/api/v1/checkins.t => SUCCESS: Tests pass! 2. Make sure HoldsAutoFill is disabled 3. Place an item-level hold on an item checked out to patron A (hold for patron B, pickup at a different library) 4. Go to Circulation > Check in, check in the item => SUCCESS: The "Hold found" modal appears. Leave it open 5. From another tab, check out the item to patron C, confirming the checkout without cancelling the hold 6. Back on the first tab, click "Confirm hold" => SUCCESS: An error is displayed: "The item has been checked out in the meantime: the hold has not been set aside and remains pending" => SUCCESS: The hold is still pending and no transfer was created 7. Check the item in again and confirm the hold => SUCCESS: The hold is set in transit to the pickup library 8. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #165 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210474 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210474&action=edit Bug 42383: (QA follow-up) Close non-blocking transfer modals on click outside or Escape With TransfersBlockCirc disabled, the legacy returns.pl transfer modals had no static backdrop: clicking outside of them or pressing Escape closed them, and with AutomaticConfirmTransfer enabled closing them confirmed the transfer. On the Vue check-in page the only way out of a non-blocking transfer modal was one of its buttons, or scanning the next item. This patch makes ConfirmationModal emit 'close' when a non-blocking transfer modal gets a click outside of the dialog or an Escape key press. Main.vue then confirms the transfer if the checkin has one and AutomaticConfirmTransfer is enabled, and otherwise moves on leaving the transfer as it is. Blocking transfer modals (TransfersBlockCirc enabled) and the other modals are unchanged. Test plan: 1. Apply this patch and rebuild the JS: $ ktd --shell k$ yarn build 2. Set TransfersBlockCirc to "Don't block" and AutomaticConfirmTransfer to "Do" 3. Put an item in transit to library A, and check it in at library B (wrong transfer) => SUCCESS: The "Please return item to A" modal shows 4. Click anywhere outside of the modal => SUCCESS: The modal closes => SUCCESS: The item shows as in transit to A on its details page 5. Repeat 3, press Escape instead of clicking outside => SUCCESS: Same as step 4 6. Set AutomaticConfirmTransfer to "Don't" and repeat 3 and 4 => SUCCESS: The modal closes and the transfer is not sent 7. Click inside the modal (e.g. on its text) => SUCCESS: The modal stays open 8. Set TransfersBlockCirc to "Block" and repeat 3 and 4 => SUCCESS: The modal stays open until one of its buttons is used 9. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #166 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210475 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210475&action=edit Bug 42383: (QA follow-up) Show 'Available for loan' for a not for loan value of 0 When UpdateNotForLoanStatusOnCheckin sets an item's not for loan status to 0, the check-in page displayed the raw '0' as the new value. The avDescription helper only treated undef and the empty string as 'Available for loan', while the legacy returns.tt treated any false value (including 0) that way. This patch adds notForLoanDescription, which shows 'Available for loan' for any value that is not a non-zero number, and locationDescription for the UpdateItemLocationOnCheckin message. The latter also fixes an empty shelving location being displayed as 'Available for loan': it now shows 'Blank', as the legacy page did. Test plan: 1. Set UpdateNotForLoanStatusOnCheckin to: BK: 1: 0 2. Check out a BK item, then set its not for loan status to 1 3. Check the item in on the check-in page => FAIL: The message reads 'Not for loan status updated. Old value: ... New value: 0.' 4. Apply this patch and rebuild the JS: $ ktd --shell k$ yarn build 5. Repeat steps 2 and 3 => SUCCESS: The new value reads 'Available for loan' 6. Set UpdateItemLocationOnCheckin to: _BLANK_: CART and check in an item with no shelving location => SUCCESS: The old value reads 'Blank' 7. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #167 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210476 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210476&action=edit Bug 42383: (QA follow-up) Show the new overdue charge message on lost returns With the lost item refund policy 'Refund lost item charge and charge new overdue fine', AddReturn reports both lost_item_fee_refunded and lost_item_fee_charged. The check-in page shows a single lost fee outcome, picking the first one found in a list that started with lost_item_fee_refunded, so the new overdue charge was never mentioned. This patch makes lost_item_fee_charged and lost_item_fee_restored take precedence over lost_item_fee_refunded. Their texts already state that the lost item charge was refunded. Test plan: 1. Set a circulation rule with an overdue fine and finesMode to 'Calculate and charge' 2. Set the lost item refund policy (Default lost item fee refund on return policy) to 'Refund lost item charge and charge new overdue fine' 3. Check out an item with a replacement cost and a due date in the past, then mark it lost 4. Check the item in on the check-in page => FAIL: Only 'A refund for the lost item charge has been applied to the borrowing patron's account.' is displayed 5. Apply this patch and rebuild the JS: $ ktd --shell k$ yarn build 6. Repeat steps 3 and 4 => SUCCESS: The message also says 'and new overdue charge has been calculated and applied', and it is displayed only once 7. Check the patron's account => SUCCESS: The lost fee was refunded and a new overdue fine created 8. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #168 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210477 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210477&action=edit Bug 42383: (QA follow-up) Add tests for forgive_hold_fees on hold_cancellation This patch adds tests for POST /checkins/{checkin_id}/hold_cancellation with forgive_hold_fees. They highlight that the endpoint rejects the parameter: the request body schema does not allow it, so the request fails with a 400 and the hold is never cancelled. The tests cover: - 403 (no_permission_for_forgive_hold_fees) without updatecharges.writeoff - No ExpireReservesMaxPickUpDelayCharge fee when the fees are forgiven - The fee being charged when they are not Test plan: 1. Apply this patch 2. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/checkins.t => FAIL: Tests fail! The forgive_hold_fees requests return 400 3. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #169 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210478 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210478&action=edit Bug 42383: (QA follow-up) Allow forgiving fees when cancelling a hold on check-in With 'Forgive fees for manually expired holds' checked, cancelling a waiting hold from the check-in page did nothing and the hold modal kept coming back. The page sends forgive_hold_fees to POST /checkins/{checkin_id}/hold_cancellation, but the request body schema did not include it and has additionalProperties: false, so the request was rejected with a 400. The error was swallowed by the store, the check-in stayed pending and its modal was shown again. This patch: - Adds forgive_hold_fees to the hold_cancellation body schema. The controller already handled it, including the updatecharges.writeoff permission check. - Makes the check-in store report a failed hold, transfer or recall action in the page error box, so a rejected action is no longer silently retried. - Documents the 403 no_permission_for_forgive_hold_fees error of hold_cancellation, which carries the current module policy in the `policy` attribute. The store applies it, so the option is no longer offered, and reports the refusal. Test plan: 1. Set ExpireReservesMaxPickUpDelayCharge to 5 2. Place a hold and check the item in to set it waiting 3. Set the hold's expiration date in the past: $ ktd --dbshell k> UPDATE reserves SET expirationdate = '2026-01-01' WHERE reserve_id = X; 4. On the check-in page, open the settings and check 'Forgive fees for manually expired holds' 5. Check the item in, click 'Cancel hold', then 'Cancel hold' in the cancellation pop-up => FAIL: The 'Hold found (item is already waiting)' modal comes back and the hold is not cancelled 6. Apply this patch, rebuild the API bundle and the JS and restart: $ ktd --shell k$ yarn api:bundle k$ yarn build k$ restart_all 7. Repeat steps 4 and 5 => SUCCESS: The hold is cancelled, the modal closes and the patron is not charged the expired hold fee 8. Run: k$ prove t/db_dependent/api/v1/checkins.t xt/api.t => SUCCESS: Tests pass! 9. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #170 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210479 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210479&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 <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #171 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210480 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210480&action=edit Bug 42383: (QA follow-up) Clear the suggested transfer when closing 'Transfer now?' With AutomaticItemReturn disabled, the check-in only suggests a transfer (needs_transfer message) and the 'Transfer now?' modal asks whether to create it. Closing that modal with Escape or by clicking outside it created no transfer, as expected, but the row kept showing the suggested destination and reason in the 'Transfer to' and 'Transfer reason' columns. 'No, don't transfer' cleared them. This patch makes closing the modal without a transfer behave like 'No, don't transfer'. Closing a modal for an existing transfer is unchanged: it is confirmed when AutomaticConfirmTransfer is set, and left pending otherwise. Test plan: 1. Set TransfersBlockCirc and AutomaticItemReturn to "Don't" 2. Check in an item whose home library is not the current library => SUCCESS: The 'Transfer now?' modal is displayed 3. Press Escape => FAIL: No transfer is created, but the row still shows the home library and 'Return to home library' in the transfer columns 4. Apply this patch and rebuild the JS: $ ktd --shell k$ yarn build 5. Repeat steps 2 and 3, then once more clicking outside the modal instead of pressing Escape => SUCCESS: No transfer is created and the transfer columns are empty 6. Repeat step 5 with AutomaticConfirmTransfer set to "Do" => SUCCESS: Same result, no transfer is created 7. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #172 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210481 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210481&action=edit Bug 42383: (QA follow-up) Map the check-in page to the manual This patch renames the 'circ/returns' key in Koha::Manual's mapping to 'circ/checkin', as circ/returns.pl has been replaced by circ/checkin.pl. Without it, the 'Help' link on the new check-in page points to the manual's main page instead of the check-in section. It addresses point 14 of the QA comment. Test plan: 1. Go to Circulation > Check in 2. Click the 'Help' link on the top right => FAIL: The manual's front page opens 3. Apply this patch and restart plack: $ ktd --shell k$ koha-plack --restart kohadev 4. Repeat 2 => SUCCESS: The manual opens on the 'Check in (returning)' section 5. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #173 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210482 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210482&action=edit Bug 42383: (QA follow-up) Apply barcode filters on check-in by barcode This patch makes POST /checkins run the passed external_id through C4::Circulation::barcodedecode before looking up the item. This applies the itemBarcodeInputFilter system preference and the item_barcode_transform plugin hook, as the legacy circ/returns.pl did. Before this patch, a barcode needing transformation (e.g. one scanned with spaces when itemBarcodeInputFilter is 'whitespace') could not be checked in, and returned a 404. It addresses point 4 of the QA comment. Test plan: 1. Set the itemBarcodeInputFilter system preference to 'Remove spaces from' 2. Check out an item to a patron 3. Go to Circulation > Check in 4. Check in the item, typing its barcode with a space in the middle => FAIL: 'No item with barcode' is displayed 5. Apply this patch and restart plack: $ ktd --shell k$ koha-plack --restart kohadev 6. Repeat 4 => SUCCESS: The item is checked in 7. Run: k$ prove t/db_dependent/api/v1/checkins.t => SUCCESS: Tests pass! 8. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #174 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210483 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210483&action=edit Bug 42383: (QA follow-up) Update the holds queue on check-in This patch makes POST /checkins enqueue a BatchUpdateBiblioHoldsQueue background job for the item's record when RealTimeHoldsQueue is enabled, as the legacy circ/returns.pl did. AddReturn passes skip_holds_queue internally, so without this the real-time holds queue was never refreshed after a check-in from the new page. The job is enqueued when: - the item was returned (legacy did it after AddReturn), or - a hold was found for the item. The legacy page enqueued the job when the staff chose 'Ignore' on the hold modal. The new page dismisses the hold modal client-side without calling the API, so the update is done at check-in time instead. Cancelling the hold found already updates the queue, as Koha::Hold->cancel enqueues the job itself. Confirming it did not update the queue in legacy either. It addresses point 5 of the QA comment. Test plan: 1. Enable RealTimeHoldsQueue 2. Check out an item and go to Administration > Jobs, note the number of 'Update holds queue for biblios' jobs 3. Check the item in on the check-in page 4. Reload the jobs page => FAIL: No new 'Update holds queue for biblios' job 5. Apply this patch and restart plack: $ ktd --shell k$ koha-plack --restart kohadev 6. Repeat 2 to 4 => SUCCESS: A new job is listed for the item's record 7. Run: k$ prove t/db_dependent/api/v1/checkins.t => SUCCESS: Tests pass! 8. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #175 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210484 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210484&action=edit Bug 42383: (QA follow-up) Set confirmed holds waiting at the check-in desk This patch makes Koha::Checkin->confirm_hold pass the checkin's desk_id to ModReserveAffect, so a hold confirmed (or auto-filled through HoldsAutoFill) on the check-in page is set waiting at the desk the staff member is using, as the legacy circ/returns.pl did. The checkin row already records the desk from the user environment. It addresses point 10 of the QA comment. Test plan: 1. Enable UseCirculationDesks and create a desk for your library 2. Set the desk for your session (Set library and desk) 3. Place an item level hold for a patron, pickup at your library 4. Check the item in on the check-in page and confirm the hold 5. Look at the hold on the record's holds page => FAIL: The waiting hold has no desk 6. Apply this patch and restart plack: $ ktd --shell k$ koha-plack --restart kohadev 7. Repeat 3 to 5 => SUCCESS: The hold is waiting at your desk 8. Run: k$ prove t/db_dependent/Koha/Checkin.t => SUCCESS: Tests pass! 9. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #176 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210485 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210485&action=edit Bug 42383: (QA follow-up) Tell 'hold not found' from 'item on loan' This patch makes Koha::Checkin->confirm_hold handle the three possible ModReserveAffect return values explicitly: - 1: the hold was set aside (success) - 0: the item is on loan and the hold is not waiting. A Koha::Exceptions::Checkin::ItemCheckedOut exception is thrown, as before - undef: the hold was not found. A new Koha::Exceptions::Checkin::HoldNotFound exception is thrown Before, an undef return was reported as 'item checked out', which was misleading. The hold not being found means it was cancelled or filled between the check-in and the confirmation (e.g. from another workstation): this is a conflict with the current state rather than a no-op, as the staff member asked for something that did not happen, so it is reported. confirm_hold now also throws HoldNotFound when the checkin's hold is gone before calling ModReserveAffect, instead of dying on an undefined value. POST /checkins/{checkin_id}/hold_confirmation maps HoldNotFound to a 409 response with the 'hold_not_found' error_code. It addresses point 12 of the QA comment. Test plan: 1. Apply this patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Checkin.t \ t/db_dependent/api/v1/checkins.t => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #177 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210486 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210486&action=edit Bug 42383: (QA follow-up) Use the returning patron for check-in notices This patch makes AddReturn pass the patron the item was checked out to down to _attach_messages_to_checkin, which uses it for the patron_has_fines (FineNotifyAtCheckin) and patron_has_waiting_holds (WaitingNotifyAtCheckin) messages. Before, those messages were built from $checkin->checkout->patron. The checkin's checkout is the old_issues row, which MarkIssueReturned has already anonymised for patrons with privacy set to 'Never' (when AnonymousPatron is set). The messages were then computed for, and pointed to, the anonymous patron instead of the patron who returned the item. It addresses point 11 of the QA comment. Test plan: 1. Set AnonymousPatron to an existing patron, and enable FineNotifyAtCheckin and WaitingNotifyAtCheckin 2. Pick a patron with no fines, set their privacy to 'Never'. Give them a manual fee and a waiting hold at your library 3. Check out an item to them, then check it in on the check-in page => FAIL: No fines or waiting holds message is displayed 4. Apply this patch and restart plack: $ ktd --shell k$ koha-plack --restart kohadev 5. Repeat 3 => SUCCESS: The fines and waiting holds messages are displayed and link to the right patron 6. Run: k$ prove t/db_dependent/Circulation.t => SUCCESS: Tests pass! 7. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #178 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210487 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210487&action=edit Bug 42383: (QA follow-up) Add API tests for recall_confirmation This patch adds tests for POST /checkins/{checkin_id}/recall_confirmation in line with the existing hold and transfer sub-resource tests. They cover: - 404 when the checkin does not exist - 403 when the user lacks the circulate permission - 400 when the checkin has no recall - 201 setting the recall waiting at the checkin library - 201 setting the recall in transit when the pickup library differs It addresses point 21 of the QA comment. Test plan: 1. Apply this patch 2. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/checkins.t => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #179 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210488 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210488&action=edit Bug 42383: (QA follow-up) Reject follow-up actions on stale checkins This patch makes the checkin follow-up endpoints refuse to act on a checkin that is not the latest checkin of its item: - POST /checkins/{checkin_id}/hold_confirmation - POST /checkins/{checkin_id}/hold_cancellation - POST /checkins/{checkin_id}/transfer_confirmation - POST /checkins/{checkin_id}/transfer_cancellation - POST /checkins/{checkin_id}/recall_confirmation Before, they only checked the permission and that the checkin existed, so an old checkin_id could be used to alter holds, transfers or recalls long after the item had circulated again. A new Koha::Checkin->is_latest method tells whether a later checkin exists for the item. The endpoints now return a 409 with the 'stale_checkin' error_code when it is not the latest. The shared lookup is done in a new _get_actionable_checkin controller helper. It addresses point 13 (a) of the QA comment. Test plan: 1. Apply this patch 2. Run: $ ktd --shell k$ yarn api:bundle k$ prove t/db_dependent/Koha/Checkin.t \ t/db_dependent/api/v1/checkins.t \ xt/api.t => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #180 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210489 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210489&action=edit Bug 42383: (QA follow-up) Require a token for checkin follow-up actions This patch makes the checkin follow-up endpoints require a short-lived signed token, issued when checking in, tied to the checkin, the staff member and the action: - POST /checkins/{checkin_id}/hold_confirmation - POST /checkins/{checkin_id}/hold_cancellation - POST /checkins/{checkin_id}/transfer_confirmation - POST /checkins/{checkin_id}/transfer_cancellation - POST /checkins/{checkin_id}/recall_confirmation It reuses the bug 24401 mechanism (Koha::Token generate_jwt/check_jwt, as for the checkin and checkout confirmation tokens). Changes: - Koha::Checkin->pending_actions returns the follow-up actions offered for the checkin (hold found, transfer triggered or needed, recall found) - Koha::Checkin->action_tokens returns a token for each of them, valid for 15 minutes (ACTION_TOKEN_EXPIRY_SECONDS) - Koha::Checkin->check_action_token validates a token - POST /checkins returns the tokens in a new 'action_tokens' attribute, an object keyed by action name - The endpoints above take a required 'action_token' query parameter, and return a 403 with the 'invalid_action_token' error_code when it is not valid for the checkin, user and action, or has expired - The check-in page passes the token of the action it performs Together with the stale checkin check, a checkin_id can no longer be used to alter holds, transfers or recalls outside of the check-in it was returned from. It addresses point 13 (b) of the QA comment. Test plan: 1. Apply this patch, rebuild the API bundle and the Vue files, and restart plack: $ ktd --shell k$ yarn api:bundle k$ yarn js:build k$ koha-plack --restart kohadev 2. Place a hold on an item, check it out to another patron 3. Check the item in on the check-in page and confirm the hold => SUCCESS: The hold is set waiting 4. Repeat 2 and 3, cancelling the hold instead => SUCCESS: The hold is cancelled 5. Repeat with a transfer and a recall => SUCCESS: They are confirmed/cancelled as expected 6. Run: k$ prove t/db_dependent/Koha/Checkin.t \ t/db_dependent/api/v1/checkins.t \ xt/api.t => SUCCESS: Tests pass! 7. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #181 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210490 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210490&action=edit Bug 42383: (QA follow-up) Do not check in items from the barcode URL param The check-in page kept the legacy ?barcode= deep link working by submitting a check-in for it on page load. That turns a GET request into a state change: any link or embedded resource pointing at circ/checkin.pl?barcode=XXX checks the item in for the logged in staff user. The legacy page required a CSRF protected POST (op=cud-checkin). This patch (QA comment point 3) makes the page only prefill the barcode input with the parameter value and focus it. Staff need to press 'Check in' (or Enter) to actually check the item in. A setBarcode() method is added to the BarcodeInput component for this. Test plan: 1. Check out an item to a patron 2. Visit /cgi-bin/koha/circ/checkin.pl?barcode=<the item barcode> => FAIL: The item is checked in on page load 3. Check the item out again 4. Apply this patch and rebuild: $ ktd --shell k$ yarn js:build k$ restart_all 5. Repeat step 2 => SUCCESS: The barcode input contains the barcode and has the focus => SUCCESS: Nothing is checked in, the item is still checked out 6. Press Enter => SUCCESS: The item is checked in 7. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #182 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210491 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210491&action=edit Bug 42383: (QA follow-up) Escape the item type check-in message The check-in page renders its alert boxes with v-html. Every value interpolated into them is escaped, except the item type check-in message (itemtypes.checkinmsg) used for the item_type_checkinmsg message, which was rendered as raw HTML. The legacy page displayed it with the html_line_break filter, which escapes the text and turns line breaks into <br>. This patch (QA comment point 2) escapes the message and converts its line breaks into <br>, matching the legacy rendering. The other alert boxes already escape the API provided data they interpolate. Test plan: 1. Go to Administration > Item types and edit the type of an item. Set 'Checkin message' to: <b>Bold</b><img src=x onerror=alert('XSS')> Second line 2. Check the item out, then check it in on the check-in page => FAIL: 'Bold' is rendered bold and a JS alert pops up 3. Apply this patch and rebuild: $ ktd --shell k$ yarn js:build k$ restart_all 4. Repeat step 2 => SUCCESS: The message is displayed literally, with the HTML tags visible, no alert pops up and 'Second line' is on its own line 5. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #183 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210492 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210492&action=edit Bug 42383: (QA follow-up) Make returning error responses opt-in in HttpClient The check-in page needs the raw response of POST /checkins for error statuses too (412 confirmation, 403 blocked, 404 not found), so an earlier patch made HttpClient::_fetchJSON return the response object for non-2xx responses whenever return_response was set. But delete() and count() default return_response to true, so every DELETE and count request in the Vue apps stopped going through the error handling: errors were no longer thrown nor reported with setError(), and callers treated failures as successes. This patch (QA comment point 1) restores the previous behaviour for return_response and adds a separate return_error_response parameter, false by default. It is only passed by post(), and only the check-in client sets it (checkins.create, and checkins.cancelHold whose refusals carry the module policy). Test plan: 1. Apply this patch and rebuild: $ ktd --shell k$ yarn js:build k$ restart_all 2. Check in items on the check-in page, including: - an item that is not checked out - a barcode that does not exist - an item that requires a confirmation (e.g. a lost item with BlockReturnOfLostItems set) => SUCCESS: The page behaves as before: the right messages, modals and confirmation prompts are displayed 3. In the ERM module, try deleting an agreement that cannot be deleted (e.g. edit it in another tab and delete it there first, then delete it again from the first tab) => SUCCESS: The error is displayed at the top of the page, as it was before the check-in patches 4. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #184 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210493 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210493&action=edit Bug 42383: (QA follow-up) Play audio alerts after each check-in The check-in page marks the latest row with the audio-alert-warning or audio-alert-success classes, and the confirmation modal with audio-alert-action, so the default AudioAlerts selectors match them. But js_includes.inc only looks for the configured selectors and calls playSound() once, on document ready. The legacy page was reloaded after every check-in so it played a sound each time; the Vue page never did. This patch (QA comment point 6) adds a playAudioAlert() helper to the check-in page, which repeats the js_includes.inc logic: it walks window.AUDIO_ALERTS in precedence order and plays the sound of the first selector found in the page. It is called once the result of each check-in has been rendered, and when the next pending modal is opened after resolving one. The error box displayed for unknown barcodes and failed requests also gets the audio-alert-warning class, so these produce the warning sound like on the legacy page. Test plan: 1. Enable the AudioAlerts system preference 2. On the check-in page, check in: - an item that is checked out - a barcode that does not exist - an item with a hold on it => FAIL: No sound is played 3. Apply this patch and rebuild: $ ktd --shell k$ yarn js:build k$ restart_all 4. Repeat step 2 (check items out and place the hold again) => SUCCESS: The 'beep' sound plays for the normal check-in => SUCCESS: The 'critical' sound plays for the unknown barcode => SUCCESS: The 'opening' sound plays when the hold modal opens 5. Disable AudioAlerts and repeat step 2 => SUCCESS: No sound is played 6. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #185 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210494 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210494&action=edit Bug 42383: (QA follow-up) Print the recall pickup slip for recalls The 'Print slip and confirm (P)' button of the recall modal used recallInfo.reserve_id (falling back to the checkin hold_id) to load the hold transfer slip. The recall_found message payload only contains recall_id and needs_transfer, so no slip was ever printed, or the wrong one was. The legacy page opened recalls/recall_pickup_slip.pl?recall_id=X. This patch (QA comment point 7) adds a recallSlipUrl() helper to slip-printer.js and makes the button load the recall pickup slip for the payload recall_id, once the recall has been confirmed (same as the hold slip). Test plan: 1. Enable UseRecalls and set up circulation rules allowing recalls 2. Check an item out to patron A, then place a recall on it for patron B from the OPAC 3. Check the item in on the check-in page => SUCCESS: The recall modal is displayed 4. Click 'Print slip and confirm (P)' => FAIL: No slip, or an empty / wrong slip, is displayed 5. Apply this patch and rebuild: $ ktd --shell k$ yarn js:build k$ restart_all 6. Repeat steps 2 to 4 with a new item => SUCCESS: The recall is confirmed and the recall pickup slip for patron B is displayed in a popup 7. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #186 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210495 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210495&action=edit Bug 42383: (QA follow-up) Use the API client to resolve return claims The 'Resolve return claim' modal of the check-in page called PUT /api/v1/return_claims/{claim_id}/resolve with a raw fetch() and emitted 'resolved' whatever the response was. Failures (e.g. a missing permission or a claim deleted in the meantime) were silently reported as success and the modal closed. This patch (QA comment point 15) adds a return_claims.resolve() method to ClaimAPIClient, built on HttpClient.put() like the other API clients, and uses it from the modal through APIClient. 'resolved' is only emitted when the request succeeds; otherwise the error is displayed in the modal, which stays open. Test plan: 1. Set ClaimReturnedLostValue to a lost value 2. Check an item out to a patron and, from the patron's checkouts table, mark it as 'Claim returned' 3. Check the item in on the check-in page 4. Click 'Resolve' on the row, pick a resolution and click 'Resolve claim' => SUCCESS: The claim is resolved 5. Repeat steps 2 to 3, open the resolve modal and, before submitting it, delete the claim from the patron's 'Claims' tab in another browser tab. Submit the modal => FAIL: The modal closes as if the claim had been resolved 6. Apply this patch and rebuild: $ ktd --shell k$ yarn js:build k$ restart_all 7. Repeat steps 2 to 4 => SUCCESS: The claim is resolved and the modal closes 8. Repeat step 5 => SUCCESS: The modal stays open and displays the error returned by the API 9. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #187 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210496 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210496&action=edit Bug 42383: (QA follow-up) Fix xt/tt_script_tidy.t for circ/checkin.tt xt/tt_script_tidy.t checks that inline <script> blocks of templates do not contain Template::Toolkit tags, unless they are explicitly allowed. circ/checkin.tt passes the module policy, the library and the table settings to the Vue app through a <script> block with TT tags, which made the test fail. This patch (QA comment point 8) marks that block with data-tt-allowed="true", like other templates (e.g. recalls/request.tt) do for script blocks that only expose server side values to JS. Test plan: 1. Run: $ ktd --shell k$ prove xt/tt_script_tidy.t => FAIL: The test fails for koha-tmpl/intranet-tmpl/prog/en/modules/circ/checkin.tt 2. Apply this patch and repeat step 1 => SUCCESS: Tests pass 3. Restart and load the check-in page: $ ktd --shell k$ restart_all => SUCCESS: The page loads and items can be checked in 4. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #188 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210497 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210497&action=edit Bug 42383: (QA follow-up) Show the configured date format for the return date The check-in settings panel labelled the return date input 'Specify return date (MM/DD/YYYY):' whatever the dateformat system preference was. The input is a flatpickr date picker that uses the configured format, so the hint was wrong for every format but 'us'. The legacy page used date-format.inc to display the configured format. This patch (QA comment point 16) builds the hint from flatpickr_dateformat_string, set by calendar.inc from the dateformat system preference, so it reads e.g. DD/MM/YYYY, DD.MM.YYYY or YYYY-MM-DD as date-format.inc does. If it is not available, the label is displayed without a format. Test plan: 1. Enable SpecifyReturnDate and set dateformat to 'dd/mm/yyyy' 2. On the check-in page, open the check-in settings (sliders icon) => FAIL: The label reads 'Specify return date (MM/DD/YYYY):' 3. Apply this patch and rebuild: $ ktd --shell k$ yarn js:build k$ restart_all 4. Reload the page and open the settings => SUCCESS: The label reads 'Specify return date (DD/MM/YYYY):' 5. Try the other dateformat values => SUCCESS: The label matches the format used by the date picker 6. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #189 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210498 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210498&action=edit Bug 42383: (QA follow-up) Use APIClient for libraries and translate store strings The check-in Pinia store fetched the libraries list with a raw fetch('/api/v1/libraries?_per_page=-1') while APIClient, which has a library client, is already imported and used for authorised values. It also set some user visible error messages as plain, untranslatable strings. This patch (QA comment point 17) loads the libraries through APIClient.library.libraries.getAll() and wraps the remaining English strings of the store with $__(). Test plan: 1. Apply this patch and rebuild: $ ktd --shell k$ yarn js:build k$ restart_all 2. Check an item whose home library is not the logged in library in on the check-in page, with AutomaticItemReturn enabled => SUCCESS: The 'Transfer to' column and the transfer modal show the home library name (not its code) 3. Check the store strings are picked up for translation: $ ktd --shell k$ cd misc/translator k$ perl translate update fr-FR k$ grep -A1 'Network error. Please try again.' po/fr-FR-messages-js.po => SUCCESS: The string is listed 4. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #190 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210499 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210499&action=edit Bug 42383: (QA follow-up) Format patron names with $patron_to_html The check-in page built patron names by hand from surname and firstname in several places: the 'Returned by' column of the check-in table, the hold and recall patron in the confirmation modal, and the 'Hold filled for' and waiting holds alert boxes. This ignores the preferred name, middle name, other name and the 'A patron from X' fallback that the rest of the staff interface displays, and prints 'undefined' for patrons without a first name. The 'Patron #X' fallback was also not translatable. This patch (QA comment points 18 and 20) uses the global $patron_to_html helper, as other Vue components do, with invert_name (Surname, Firstname) and the card number where it was shown before. The 'Returned by' column uses its url option for the link to the patron's details page. 'Patron #%s' is wrapped with $__(). $patron_to_html escapes the patron data, so the names are rendered with v-html and no longer go through escapeHtml in the alert boxes. Test plan: 1. Create a patron with a first name, a middle name and a preferred name, and another one with only a surname 2. Check out items to both patrons, check them in on the check-in page => FAIL: The 'Returned by' column shows 'Surname, Firstname (card)', ignoring the preferred and middle names, and 'Surname, undefined' for the patron without a first name 3. Place a hold on an item for the first patron and check it in => FAIL: The hold modal shows the patron name built by hand too 4. Apply this patch and rebuild: $ ktd --shell k$ yarn js:build k$ restart_all 5. Repeat steps 2 and 3 => SUCCESS: Names are displayed as in the rest of the staff interface (e.g. 'Surname, Preferredname Middlename (cardnumber)'), linking to the same pages as before => SUCCESS: The patron without a first name shows only the surname 6. Repeat step 3 with HoldsAutoFill enabled => SUCCESS: The 'Hold filled for:' box shows the formatted name 7. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #191 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210500 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210500&action=edit Bug 42383: (QA follow-up) Restore hold group handling in the hold modal When DisplayAddHoldGroups is enabled and the hold found on check-in is part of a hold group, the legacy check-in page: - displayed 'Part of a hold group:' with a 'View patron's holds' link to the patron's holds, in the hold found modals - offered, for waiting holds, a 'Cancel all holds in hold group (X)' button calling POST /api/v1/patrons/{patron_id}/hold_groups/ {hold_group_id}/cancel with the selected cancellation reason, and labelled the single hold cancellation button 'Cancel this hold (X)' instead of 'Cancel hold (X)' The Vue page only had a TODO for it. This patch (QA comment point 19) ports that behaviour: - The hold group id comes from the embedded hold (hold.hold_group_id), already requested by the check-in client, and the display_hold_groups module policy flag (DisplayAddHoldGroups). No back-end change is needed. - A hold_groups.cancel() method is added to PatronAPIClient. - 'Cancel all holds in hold group' opens the existing cancellation pop-up, which asks for confirmation and the cancellation reason, and calls the new cancelHoldGroup() store action. On success the row is marked as checked in; on failure the error is displayed and the hold modal stays pending. Test plan: 1. Enable DisplayAddHoldGroups 2. Place a hold group for a patron on two records (staff interface, Place hold, search the patron, select 2 records and check 'Treat as hold group') 3. Check in an item of the first record => SUCCESS: The 'Hold found' modal is displayed => FAIL: There is no mention of the hold group 4. Confirm the hold, then check the item in again => FAIL: The 'Hold found (item is already waiting)' modal only offers 'Cancel hold (X)' 5. Apply this patch and rebuild: $ ktd --shell k$ yarn js:build k$ restart_all 6. Repeat step 4 => SUCCESS: The modal shows 'Part of a hold group:' and a 'View patron's holds' link opening the patron's holds in a new tab => SUCCESS: The buttons read 'Cancel all holds in hold group (X)' and 'Cancel this hold (X)' 7. Click 'Cancel all holds in hold group (X)', pick a reason and confirm => SUCCESS: The row is marked as checked in, and the patron's holds page shows both holds of the group as cancelled 8. Repeat steps 2 to 4 with DisplayAddHoldGroups disabled => SUCCESS: No hold group information is shown, and the button reads 'Cancel hold (X)' 9. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #192 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210501 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210501&action=edit Bug 42383: (QA follow-up) Do not return $__ from the check-in components The check-in components returned the $__ translation function from setup(). Vue reserves the '$' prefix for its internals and logs a warning on each mount in development builds: [Vue warn]: setup() return property "$__" should not start with "$" or "_" which are reserved prefixes for Vue internals. The function is already available to the templates as a global property, registered by the @koha-vue/i18n plugin the check-in app uses. This patch removes it from the setup() return values of the Circ/Checkin components. The Cypress support file fails the tests on any console warning, so this was making the check-in page Cypress tests fail. Test plan: 1. Run: $ ktd --shell k$ yarn js:build 2. Open the browser console and go to Circulation > Check in => FAIL: The Vue warning about "$__" is logged 3. Apply this patch, repeat 1 and 2 => SUCCESS: No warning 4. Check in some items, open the settings panel => SUCCESS: All the strings are displayed as before 5. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #193 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210502 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210502&action=edit Bug 42383: (QA follow-up) Add Cypress tests for the check-in page This patch adds end-to-end Cypress tests for the Vue check-in page (circ/checkin.pl), addressing point 9 of the QA comment. The data is created in the database using the Cypress tasks, the page is driven like staff would do it, and the outcome is verified in the database. The tests cover: - Checking in a checked out item: the row is displayed with the barcode and title, and the checkout is moved to old_issues - An unknown barcode displays an error - The barcode URL parameter prefills the input but does not check the item in - The item type check-in message is displayed as text, not HTML - A withdrawn item is not checked in with BlockReturnOfWithdrawnItems - Holds: confirming a hold for the logged in library sets it waiting, confirming a hold for another library puts it in transit with a transfer, and a waiting hold can be cancelled from the hold modal - Transfers: confirming the return to the home library sends the transfer, and TransfersBlockCirc blocks the barcode input meanwhile - Recalls: confirming a recall sets it waiting - Module policy: when the server refuses a return date because SpecifyReturnDate was disabled after the page was loaded, the page applies the policy returned in the error, tells why and no longer offers the return date The system preferences used are set by each test, and restored to their original values afterwards. All the created data is removed. Test plan: 1. Apply this patch 2. Run: $ ktd --shell k$ yarn cypress run --spec t/cypress/integration/Circulation/Checkin_spec.ts => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #194 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210503 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210503&action=edit Bug 42383: (QA follow-up) Make basic_workflow.t check in for real The check-in step of basic_workflow.t loaded circ/checkin.pl with the barcode URL parameter and checked the page title. The new page does not check in items from the URL anymore, and the title is rendered before the Vue app is even mounted, so this proved nothing. This patch addresses point 9 of the QA comment by making the test drive the Vue page like staff would: it waits for the app to be mounted, types each barcode, submits the form and waits for the item to be listed in the checked in items table, along with its title. It then checks in the database that the patron has no checkouts left. Test plan: 1. Apply this patch 2. Run: $ ktd --selenium up -d $ ktd --shell k$ prove -v t/db_dependent/selenium/basic_workflow.t => SUCCESS: Tests pass! The check-in tests now list the barcodes 3. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #195 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210504 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210504&action=edit Bug 42383: (QA follow-up) Handle HoldsAutoFill errors on check-in When HoldsAutoFill is enabled, POST /checkins calls confirm_hold on the new checkin without catching its exceptions. If the hold was cancelled or filled in the meantime (Koha::Exceptions::Checkin::HoldNotFound), or the item was checked out again (ItemCheckedOut), the request fails with a 500 and no explanation, even though the item has already been returned. The holds queue update and the bundle verification that come after it are skipped too. This patch addresses point 1 of comment #77. As the return has already happened, failing the whole request would be misleading: the check-in is kept and the outcome is reported as a 'hold_auto_fill_failed' warning message on it, with the same error_code values the hold_confirmation endpoint uses (hold_not_found, item_checked_out) and the reserve_id. The rest of the post-return processing runs as usual. Unexpected exceptions are still rethrown and rendered as a 500. The check-in page displays the warning, and does not open the hold modal for that check-in as there is no hold left to confirm. The new message is documented in the checkin definition. Test plan: 1. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/checkins.t => FAIL: The 'add - HoldsAutoFill failure' tests fail, the check-in returns 500 2. Apply this patch 3. Run: k$ yarn api:bundle k$ restart_all k$ prove t/db_dependent/api/v1/checkins.t => SUCCESS: Tests pass! 4. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #196 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210505 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210505&action=edit Bug 42383: (QA follow-up) Make checkin follow-up actions atomic Koha::Checkin->confirm_hold makes several writes: ModReserveAffect sets the hold aside, then a transfer is requested and sent, and the checkin is linked to it. They are not done in a transaction, so an error while creating or sending the transfer leaves the hold in transit with no transfer. This patch addresses point 2 of comment #77 by wrapping the writes of confirm_hold in a transaction. The other checkin actions writing more than once are wrapped the same way: - cancel_hold: cancels the hold and unlinks it from the checkin - confirm_transfer: requests the transfer, links it and sends it - cancel_transfer: cancels the transfer, reverts an in transit recall and unlinks the transfer from the checkin - confirm_recall: Koha::Recall->start_transfer updates the recall and creates the transfer, set_waiting updates the recall and the item - replace_wrong_transfer: replaces the transfer and links the new one confirm_transfer now checks its parameters before starting the transaction. The behaviour is unchanged. Test plan: 1. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Checkin.t => FAIL: When sending the transfer fails, the hold is left in transit and a transfer is created 2. Apply this patch 3. Run: k$ prove t/db_dependent/Koha/Checkin.t \ t/db_dependent/api/v1/checkins.t => SUCCESS: Tests pass! 4. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #197 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210506 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210506&action=edit Bug 42383: (QA follow-up) Mark the row of the resolved return claim When a return claim is resolved from the check-in page, onClaimResolved marks the first row of the table with a pending claim as resolved, not the row of the claim that was resolved. With several claimed items checked in, the wrong row loses its 'Resolve claim' button and the right one keeps it. This patch addresses point 3 of comment #77: ResolveClaimModal now passes the id of the resolved claim along with the 'resolved' event, and onClaimResolved marks the row whose return_claim message carries that claim id. A Cypress test is added: two items claimed returned are checked in, the claim of the older one (second row) is resolved, and only its row is marked as resolved. Test plan: 1. Set ClaimReturnedLostValue to any lost value, and leave AutoClaimReturnStatusOnCheckin empty 2. Check out two items to a patron, and mark both as claims returned from the patron's checkouts table 3. Check in both items on the check-in page 4. Click 'Resolve claim' on the row of the first item checked in (the second row), pick a resolution and resolve => FAIL: The first row loses its 'Resolve claim' button, the resolved item keeps it 5. Apply this patch 6. Run: $ ktd --shell k$ yarn js:build 7. Repeat 2 to 4 => SUCCESS: The row of the resolved claim is marked as resolved, the other one still offers 'Resolve claim' 8. Run: k$ yarn cypress run --spec t/cypress/integration/Circulation/Checkin_spec.ts => SUCCESS: Tests pass! 9. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #198 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210507 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210507&action=edit Bug 42383: (QA follow-up) Restore the time and past-only return date On the legacy returns page, the return date override took a time (data-flatpickr-enable-time) and future dates could not be picked (data-flatpickr-pastinclusive). The check-in page only offers a date, which is sent as midnight, and allows dates in the future. The API accepts any string as return_date, a future one included. This patch addresses point 4 of comment #77: - FlatPickrWrapper takes a 'config' prop, merged into the Koha flatpickr defaults - The return date picker takes a time, displayed according to TimeFormat, and its maximum date is now (refreshed when it is opened). The data attributes read by the flatpickr defaults are set too, so the date and time input mask is used, 'Today' sets the current time, and 'Tomorrow' is disabled like on the legacy page - The value sent to the API is a date-time without offset (e.g. 2026-10-29T10:30:00), so it is in the Koha time zone, like the legacy page posted it. The 'Return date' badge displays the time - POST /checkins declares return_date as a date-time, parses it as ISO (honouring the offset if any) and rejects a date in the future with a 400 and the 'return_date_in_future' error code, documented in the spec. The page displays a translatable message for it Test plan: 1. Apply this patch 2. Run: $ ktd --shell k$ yarn api:bundle k$ yarn js:build k$ restart_all 3. Enable SpecifyReturnDate 4. Check out an item, go to Circulation > Check in and open the check-in settings 5. Open the return date picker => SUCCESS: Dates after today are disabled, and so is 'Tomorrow' => SUCCESS: A time can be picked, in the TimeFormat format 6. Pick yesterday at 10:30 and check the item in => SUCCESS: The 'Return date' badge shows the date and time => SUCCESS: The item is checked in, and the return date on the item's checkout history shows yesterday at 10:30 7. Run: k$ prove t/db_dependent/api/v1/checkins.t xt/api.t => SUCCESS: Tests pass! k$ yarn cypress run --spec t/cypress/integration/Circulation/Checkin_spec.ts => SUCCESS: Tests pass! 8. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #199 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210508 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210508&action=edit Bug 42383: (QA follow-up) Fix the Location header of checkin actions The /checkins/{checkin_id}/* action endpoints set the Location header of their 201 responses to the request URL with the checkin id appended, e.g. /api/v1/checkins/1/hold_confirmation?action_token=...1. That URI does not exist, and it carries the action token. This patch addresses point 6 of comment #77. Like the other action endpoints in Koha (e.g. POST /holds/{hold_id}/suspension), the Location header is the URI of the action performed, i.e. the request path, e.g. /api/v1/checkins/1/hold_confirmation. The query string is left out so the action token is not echoed. The header description in the spec is updated accordingly. The tests now check the header for all the action endpoints. Test plan: 1. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/checkins.t => FAIL: The Location header is wrong 2. Apply this patch 3. Run: k$ yarn api:bundle k$ restart_all k$ prove t/db_dependent/api/v1/checkins.t xt/api.t => SUCCESS: Tests pass! 4. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #200 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210509 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210509&action=edit Bug 42383: (QA follow-up) Reject a return date that cannot be parsed POST /checkins validates return_date as a date-time, then parses it with dt_from_string( ..., 'iso' ). Some valid date-times are not parsed, e.g. with fractions of a second (2025-01-15T10:00:00.123Z), and dt_from_string dies, so the request fails with a 500. This patch addresses point 1 of comment #139. Like the due_date of POST /checkouts/{checkout_id}/renewal, the parsing is guarded, and a return date that cannot be parsed is rejected with the standard invalid_parameter_value 400 response, pointing at /body/return_date. The error code is documented in the spec. Test plan: 1. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/checkins.t => FAIL: A return date with fractions of a second returns 500 2. Apply this patch 3. Run: k$ yarn api:bundle k$ restart_all k$ prove t/db_dependent/api/v1/checkins.t xt/api.t => SUCCESS: Tests pass! 4. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #201 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 210510 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210510&action=edit Bug 42383: (QA follow-up) Hide the confirmation modal while resolving a claim The 'Resolve claim' button of a row in the checkins table opens the resolve claim modal without hiding the confirmation modal, so both are displayed until the next one is shown. The 'Resolve claim (Y)' button of the confirmation modal did hide it, in a near copy of the same handler, but it did not come back when the resolve claim modal was closed. This patch addresses point 2 of comment #139. Both buttons, and the 'Resolve claim' link of the check-in messages, use the same handler: - The confirmation modal is hidden while the resolve claim modal is open, and a new check-in does not bring it up meanwhile - When the resolve claim modal is closed or the claim resolved, the next pending item is shown, as after any other modal action The Cypress test checks the confirmation modal is hidden while resolving, and is shown again for the claim still pending. Test plan: 1. Set ClaimReturnedLostValue to any lost value, and leave AutoClaimReturnStatusOnCheckin empty 2. Check out two items to a patron, and mark both as claims returned from the patron's checkouts table 3. Check in both items on the check-in page => SUCCESS: The 'Item was claimed returned' modal is shown 4. Click 'Resolve claim' on the row of the first item checked in => FAIL: The 'Item was claimed returned' modal is still displayed 5. Apply this patch 6. Run: $ ktd --shell k$ yarn js:build 7. Repeat 2 to 4 => SUCCESS: Only the 'Resolve return claim' modal is displayed 8. Resolve the claim => SUCCESS: The 'Item was claimed returned' modal is shown for the other item 9. Run: k$ yarn cypress run --spec t/cypress/integration/Circulation/Checkin_spec.ts => SUCCESS: Tests pass! 10. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=43965 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |33711 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33711 [Bug 33711] Refine the token passing mechanisms introduced in bug 23336 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Failed QA --- Comment #202 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- QA re-review of the whole chain (43486, 42425, 24401, 43077 and this bug: 79 patches) applied on current main, with the Perl tests run in KTD. Review was done with Claude assistance; items I reproduced or confirmed against legacy code are marked, the rest are from reading the code and tests. I don't think Passed QA holds yet, so I am moving this back to Failed QA. Findings on the dependencies are on their own bugs. REBASE (the series was built on main of 2026-11-02; main has moved 232 commits) - Patch "Make returning error responses opt-in in HttpClient" conflicts with Bug 43516 (pushed 2026-11-03), which added a config argument (suppressDefaultErrorDialog, signal) to HttpClient. The two mechanisms now overlap: 43516 throws with the status and code attached, return_error_response hands back the raw Response, and _fetchJSON has seven positional parameters. Suggest extending the 43516 path to attach the parsed body to the error, use suppressDefaultErrorDialog in checkin-api-client.js, catch on err.status (412, 403), and drop return_error_response. - 42425 needs rebasing over Bug 43504, see there. BACKEND (legacy parity against circ/returns.pl and AddReturn) 1. (confirmed) The step that cancels a waiting hold which has a cancellation request, before the return (returns.pl line 366, filter_by_has_cancellation_requests), is not ported. Nothing in Koha::Checkin, the controller or C4::Circulation calls it, so such a hold stays waiting. 2. Blocked check-ins (withdrawn, lost, wrong branch) return 403 before AddReturn, so no checkins row is written and no local use is recorded (RecordLocalUseOnReturn); the BlockedLost side effects are skipped as well. Not-issued items return 412 before anything is recorded. 3. Cancelling a hold no longer re-runs CheckReserves, so staff are not told that the next hold is at another branch (returns.pl lines 133 to 146). 4. confirm_recall ignores whether transferbook actually started a transfer and returns 201 (legacy had the same flaw, but the API now reports success). 5. Follow-up actions (transfer, recall) only check is_latest. If the item is checked out again without a new check-in they still pass, and cancel_transfer can set datecancelled on a transfer that has already arrived. 6. POST /checkins returns 200 even when AddReturn did not return the item (the DataCorrupted path), still runs the follow-ups, and the data_corrupted payload carries the raw exception text. 7. The multi-step controller sequence (AddReturn, then replace_wrong_transfer, confirm_hold, verify_bundle) is not atomic; a failure in a later step leaves the return committed and a retry records a second check-in. 8. Library scope: library_id comes from the request body without validation, see 24401. 9. Minor: Koha::Module::Policy::Checkin documents a library context it never reads; the waiting-holds notice uses the staff branch rather than the check-in library; reason on hold_cancellation is not validated against the authorised value list. 10. Not part of this bug, but worth its own bug: ReturnClaims resolve (Bug 28271) trusts a client-supplied resolved_by. FRONT END 11. Stale index in the checkin store: confirmPending, resolveAction and cancelHoldGroup capture idx = checkins.value.indexOf(entry) before an await and write checkins.value[idx] afterwards, while _addEntry uses unshift. Only the same barcode is guarded, so a different scan during a confirmation shifts every index and the confirmation overwrites another row (read in stores/checkin.js; not reproduced in a browser). 12. _addEntry trims the list to numReturnedItemsToShow (default 8) without regard to pending or action-needed rows, so a row awaiting confirmation can be evicted and its confirmation then fails with "Entry not found". 13. The non-blocking transfer prompt resolves on any document click, since there is no backdrop, and Main.vue then cancels the transfer or confirms it when AutomaticConfirmTransfer is on. Legacy used a backdrop. 14. "Remove from bundle" uses a raw fetch DELETE with no CSRF-TOKEN header. The CSRF plugin guards unsafe methods for session-cookie requests, so this will very likely get a 403. It should go through APIClient and HttpClient. 15. (confirmed against main) The ILL "Check-in" action used to POST a form that checked the item in; it now only navigates to checkin.pl?barcode=, which prefills the page, so staff must check in again. 16. Follow-up actions have no in-flight guard (double-click or repeated shortcut sends two POSTs with the same token), and error handling is inconsistent: a 5xx or non-JSON response shows "Network error", network failures show two messages, 409 bodies show raw English, and a 401 has no login path. 17. Other parity or UX gaps: no CSV, copy or print buttons on the session table; a cancelled bundle verification leaves the item stranded; a duplicate scan is dropped without feedback; the return date is cleared before the outcome is known; scanning is no longer blocked while hold or recall modals are open (intended?). 18. Accessibility and translation: placeholder-only inputs, icon-only controls, no focus management or aria-labelledby on the modals, results not announced; HTML inside translatable strings combined with String.replace (which mangles $-sequences), a hard-coded English "Remove from bundle" inside a translatable string, and patron_has_fines and patron_has_waiting_holds have no label. TESTS 19. The Cypress spec has 13 tests but no coverage of the 412 confirmation flow, bundle verification or removal, error responses, concurrent scans or double submits. basic_workflow.t needs a Selenium server, so I could not run it in KTD. HISTORY 20. 61 commits including many QA follow-ups that revise earlier patches (the HttpClient one is an example). Please squash before this goes in. Verified in KTD: t/db_dependent/api/v1/checkins.t, Checkin.t, Item/Availability/Checkin.t, Module/Policy*.t, Patrons.t and koha-qa.pl file checks pass; Circulation.t fails only on the 42425 forgive-path assertion. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |44075 Blocks| |44076 Blocks| |44077 Blocks| |44078 Blocks| |44079 Blocks| |44084 Attachment #210450|0 |1 is obsolete| | Attachment #210451|0 |1 is obsolete| | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44075 [Bug 44075] Check-in page: add export buttons and column visibility to the checked-in items table https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44076 [Bug 44076] Check-in page: announce check-in results and manage focus in the modals https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44077 [Bug 44077] Check-in page: do not build translatable messages with HTML and String.replace https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44078 [Bug 44078] Check-in page: add Cypress tests for bundles, API errors and concurrent scans https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44079 [Bug 44079] Make the check-in and its post-return processing atomic https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44084 [Bug 44084] Check-in API: validate the hold cancellation reason, clarify the module policy library context -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #203 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 211511 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211511&action=edit Bug 42383: Add Koha::Module::Policy framework This patch adds a module policy framework that exposes per-module capabilities to the UI. It replaces the pattern of dedicated GET /config endpoints (like GET /erm/config) with a session-scoped mechanism. A module policy is the intersection of system preferences (feature toggles), user permissions and library context. It is a plain JSON structure: an envelope with the module name, a 'global' block with the keys common to all modules, and the module specific keys under the module name: { module => 'checkin', global => { audio_alerts => true, ... }, checkin => { exempt_fine => false, ... }, } The page is bootstrapped with the policy, and the API returns it in the error object when it refuses a request because of it, so the client can refresh the UI. The server remains authoritative: the policy is informational, not an access token. Components: - Koha::Module::Policy: base class with new(), module(), to_hashref() and scope() - Koha::Module::Policy::Checkin: check-in module policy covering fines, holds, recalls, transfers, display and blockers Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Module/Policy.t \ t/db_dependent/Koha/Module/Policy/Checkin.t => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #204 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 211512 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211512&action=edit Bug 42383: Add Koha::REST::Plugin::Policy This patch adds a Mojolicious plugin that provides the module_policy helper to API controllers: return $c->render( status => 403, openapi => { error => 'Return date override is not enabled', error_code => 'return_date_not_allowed', policy => $c->module_policy( 'Checkin', { library => $library_id } ), } ); The helper loads the matching Koha::Module::Policy subclass and returns the policy envelope for the authenticated user, so controllers can include it in the 'policy' attribute of the error object when refusing a request because of it. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/REST/Plugin/Policy.t => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #205 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 211513 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211513&action=edit Bug 42383: Add check-in follow-up actions and messages to Koha::Checkin This patch moves the post check-in logic of circ/returns.pl into the domain layer, so the check-in API and the new check-in page can use it. Koha::Checkin gains: - confirm_hold / cancel_hold: set the trapped hold waiting (or in transit to its pickup library), or cancel it, optionally forgiving the hold fees - confirm_transfer / cancel_transfer / replace_wrong_transfer. A transfer that has already arrived or has been cancelled is not touched - confirm_recall. If the transfer to the pickup library cannot be started, the recall is left unchanged - verify_bundle: bundle content verification, in a single transaction - is_latest, pending_actions, action_tokens and check_action_token: the follow-up actions are only allowed on the latest check-in of the item, and require a short-lived token issued with the check-in C4::Circulation::AddReturn records the check-in messages on the check-in (item type check-in message, patron fines, patron waiting holds, overdue charges on lost returns, ...) and restores the legacy post-return processing (holds queue update, HoldsAutoFill, notices for the returning patron). The waiting holds message counts the holds waiting at the check-in library, so it does not depend on a logged in user (e.g. automatic check-ins from cron jobs). Koha::Item::Availability::Checkin gains the item_parts and items_bundle confirmations, and uses snake_case keys for its blockers and confirmations (bad_barcode, not_issued). New exceptions: Koha::Exceptions::Checkin::HoldNotFound, Koha::Exceptions::Checkin::ItemCheckedOut, Koha::Exceptions::Checkin::TransferFinished and Koha::Exceptions::Checkin::TransferNotStarted. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Checkin.t \ t/db_dependent/Circulation.t \ t/db_dependent/Circulation/issue.t \ t/db_dependent/Koha/Item/Availability/Checkin.t \ t/Koha/Result/Availability.t => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #206 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 211514 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211514&action=edit Bug 42383: Add check-in follow-up action endpoints This patch adds the follow-up action sub-resources to the check-in API: - POST /checkins/{checkin_id}/hold_confirmation - POST /checkins/{checkin_id}/hold_cancellation - POST /checkins/{checkin_id}/transfer_confirmation - POST /checkins/{checkin_id}/transfer_cancellation - POST /checkins/{checkin_id}/recall_confirmation Each one delegates to the matching Koha::Checkin method, requires the action token returned with the check-in, and returns the updated check-in. They are rejected (409) when the item has been checked in again (stale_checkin) or checked out again (item_checked_out) since. POST /checkins and GET /checkins/availability are adjusted to the needs of the check-in page: messages, pending actions and action tokens in the response, barcode filters applied, item parts and bundle confirmations. As the legacy returns page did, POST /checkins cancels the waiting holds of the item for which cancellation has been requested before the return. A blocked check-in (withdrawn, lost, wrong library) is answered with 403 (checkin_blocked), but AddReturn is still called, as the legacy returns page did: the check-in, the local use, the date last seen and the location and not for loan updates are recorded. If AddReturn cannot return the item (e.g. because of a data problem), POST /checkins answers 500 (checkin_failed) and skips the post-return processing. The internal error is logged, not returned. All the check-in endpoints are marked EXPERIMENTAL in the spec: they serve the new check-in page, and may still change. The error definition gains an optional 'policy' attribute (module_policy, module_policy_global and checkin_policy definitions), returned when a request is refused because of the module policy. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ yarn api:bundle k$ prove xt/api.t t/db_dependent/api/v1/checkins.t => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #207 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 211515 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211515&action=edit Bug 42383: Add the Vue check-in page This patch adds a Vue based check-in page, circ/checkin.pl, built on top of the check-in REST API and its follow-up action endpoints. - circ/checkin.pl and circ/checkin.tt: entry point, bootstrapped with the check-in module policy - A check-in can be requested from other pages with a POST request (op=cud-checkin, with a CSRF token): the page checks the item in once it is loaded. A GET request with a barcode only prefills it. - Vue module, Pinia store and components under js/vue/components/Circ/Checkin/: barcode input, check-in options, checked-in items table, confirmation, hold cancellation, return claim and bundle verification modals, slip printing - checkin-api-client.js, plus the claim, item (bundled items) and patron API client additions it needs - HttpClient: the error thrown for a failed request carries the parsed response body (`body`), so callers that present errors themselves (suppressDefaultErrorDialog) can use it - rspack: new 'checkin' entry The page reproduces the behaviour of circ/returns.pl: confirmations, blockers, hold/transfer/recall dialogs, messages, audio alerts and slip printing. When the API refuses a request because of the module policy, the store applies the policy returned in the error object and tells the user why. The store identifies the rows by key, not by position, as the list changes while requests are in flight. Rows that need attention are never trimmed from the list, and a follow-up action cannot be sent twice. The errors returned by the API are shown translated, in the page. Test plan: 1. Apply patch 2. Build and restart: $ ktd --shell k$ yarn build k$ restart_all 3. Go to /cgi-bin/koha/circ/checkin.pl and check in: - an item that is checked out - an item that is not checked out - an item with a hold - an item that needs a transfer - a bundle => SUCCESS: The item is checked in, and the messages and dialogs match what returns.pl showed 4. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #208 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 211516 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211516&action=edit Bug 42383: Replace circ/returns.pl with circ/checkin.pl This patch removes the legacy check-in page and points every entry point to the new one: - circ/returns.pl and circ/returns.tt are removed - circ-nav.inc, circulation-home.tt and the Alt+r shortcut in staff-global.js open circ/checkin.pl - the header search box (checkin-search-box.inc) and the ILL 'Check-in' action post the barcode to circ/checkin.pl, which checks the item in, as they did with circ/returns.pl - Koha::Manual maps the new page - basic_workflow.t checks items in on the new page Test plan: 1. Apply patch 2. Build and restart: $ ktd --shell k$ yarn build k$ restart_all 3. Open 'Check in' from the circulation home page, the circulation sidebar and with Alt+r => SUCCESS: circ/checkin.pl opens 4. Scan the barcode of a checked out item in the header 'Check in' box => SUCCESS: circ/checkin.pl opens and the item is checked in 5. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #209 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 211517 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211517&action=edit Bug 42383: Add Cypress tests for the check-in page This patch adds end-to-end tests for circ/checkin.pl: simple check-ins (including from the header search box), confirmations (accepted and declined), blocked check-ins, the module policy, holds, transfers, recalls, return claims and the return date. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ yarn cypress run --spec t/cypress/integration/Circulation/Checkin_spec.ts => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210452|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210453|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210454|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210455|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210456|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210457|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210458|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210459|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210460|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210461|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210462|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210463|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210464|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210465|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210466|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210467|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210468|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210469|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210470|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210471|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210472|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210473|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210474|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210475|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210476|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210477|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210478|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210479|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210480|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210481|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210482|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210483|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210484|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210485|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210486|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210487|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210488|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210489|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210490|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210491|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210492|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210493|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210494|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210495|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210496|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210497|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210498|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210499|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210500|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210501|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210502|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210503|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210504|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210505|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210506|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210507|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210508|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210509|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210510|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off --- Comment #210 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Thanks Martin, Matt and everyone who tested. Here is where this stands, so it can make the QA cut without hiding anything. HISTORY AND REBASE (points 20 and the rebase notes) - Rebased on current main (bugs 43504 and 43516 included), and squashed from 61 patches into 7, grouped by area: each file belongs to a single patch. Brendan's sign-off is kept on all of them, and Matt's added, as he QA'd the series. - HttpClient: return_error_response is gone. As suggested, the error thrown by HttpClient now carries the parsed response body, the check-in client uses suppressDefaultErrorDialog, and the store works on err.status and err.body. THE ENDPOINTS ARE EXPERIMENTAL All the check-in endpoints (POST /checkins, GET /checkins/availability and the five follow-up action sub-resources) are marked "EXPERIMENTAL - DO NOT RELY on this, it is subject to change!" in the spec, as we did for the ERM, ILL and Preservation Vue app endpoints. They serve the new check-in page for now, and their shape may still change during the next cycle. FIXED IN THIS ROUND Backend: 1. Waiting holds with a cancellation request are cancelled before the return, as returns.pl did (after the 412 gate). 2. Blocked check-ins (withdrawn, lost, wrong branch) still answer 403, but AddReturn is called, as returns.pl did: the check-in, the local use, the date last seen and the location and not for loan updates are recorded. The 403 carries the checkin_id. 3. After cancelling a hold, legacy computed the next hold but its template never displayed it (diffbranch is only used with hold_auto_filled), so nothing was lost there. 4. confirm_recall checks the transferbook result: when the transfer cannot be started the recall is left unchanged, and the API answers 409 transfer_not_started with the reasons. 5. Follow-up actions are rejected with 409 item_checked_out when the item has been checked out again, and transfers that already arrived or were cancelled are not touched (409 transfer_finished). 6. When AddReturn cannot return the item (DataCorrupted), POST /checkins answers 500 checkin_failed, skips the post-return processing, and logs the internal error instead of returning it. 8. Library scope: see bug 24401. 9. The waiting holds notice counts the holds at the check-in library (this also fixes a crash without a logged in user, e.g. automatic check-ins). verify_bundle runs in a transaction. All the 400s of the sub-resources have an error_code, and the tests assert them. Front end: 11. The store identifies rows by key, not by position, so a scan during a confirmation cannot overwrite another row. 12. Rows that need attention are never trimmed from the table. 13. The transfer prompt no longer closes on clicks elsewhere on the page: a stray click cannot cancel or confirm the transfer. It closes with its buttons or Escape. (A backdrop is not used, as the page is designed to keep scanning while a prompt is open.) 14. "Remove from bundle" goes through the API client, with the CSRF token. 15. The header "Check in" box and the ILL "Check-in" action post the barcode to checkin.pl again (op=cud-checkin, with the CSRF token), and the page checks the item in, as with returns.pl. A GET with a barcode still only prefills it. 16. Follow-up actions and confirmations cannot be sent twice. API errors are shown in the page, translated, instead of "Network error" or raw English; a 401 asks to log in again. 17. A duplicate scan is reported. Cancelling the bundle verification works as "No, don't check in" and the next pending item is shown. 18. Labels on the barcode and return date inputs and the settings toggle, aria-labelledby on the modals, the duplicate access key, "n of m verified" as a single string, and the bundle message no longer mixes HTML into the translatable string. 19. Cypress: tests for the 412 confirmation flow (accepted and declined) and for the header search box check-in. The spec now passes on current main (16/16). FOLLOW-UPS I am committed to working on these next cycle. They are filed and linked here, and none of them loses data or opens a permission gap: - Bug 44075: export buttons and column visibility for the checked-in items table (a regression from returns.pl) - Bug 44076: announce the check-in results and manage focus in the modals (accessibility) - Bug 44077: remaining translatable strings built with HTML and String.replace - Bug 44078: Cypress coverage for bundles, API errors and concurrent scans - Bug 44079: make the check-in and its post-return processing atomic (point 7; legacy was not atomic either) - Bug 44080: purpose binding (typ/aud) for Koha::Token JWTs - Bug 44081: notification_summary embed follow-ups (bug 43486) - Bug 44082: backfill accountlines.checkin_id (bug 42425) - Bug 44083: PUT /return_claims/{claim_id}/resolve trusts resolved_by (point 10, not part of this bug) - Bug 44084: validate the hold cancellation reason, Koha::Module::Policy::Checkin library context (point 9) Release notes: the check-in page is now circ/checkin.pl, with body id circ_checkin instead of circ_returns. IntranetUserCSS/IntranetUserJS customizations and custom AudioAlerts selectors that target the legacy page need updating (the default AudioAlerts selectors keep working). Staff can keep scanning while a hold, transfer or recall prompt is open: the item waits as a highlighted row. Testing done on current main: the Perl tests of the chain (Circulation.t, Koha/Checkin.t, Koha/Account.t, api/v1/checkins.t and the others in the test plans), xt/api.t and the template xt tests, koha-qa.pl, and the Cypress spec. Back to Signed Off. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #211 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Thanks Martin, Matt and everyone who tested. Here is where this stands, so it can make the QA cut without hiding anything. HISTORY AND REBASE (points 20 and the rebase notes) - Rebased on current main (bugs 43504 and 43516 included), and squashed from 61 patches into 7, grouped by area: each file belongs to a single patch. Brendan's sign-off is kept on all of them, and Matt's added, as he QA'd the series. - HttpClient: return_error_response is gone. As suggested, the error thrown by HttpClient now carries the parsed response body, the check-in client uses suppressDefaultErrorDialog, and the store works on err.status and err.body. THE ENDPOINTS ARE EXPERIMENTAL All the check-in endpoints (POST /checkins, GET /checkins/availability and the five follow-up action sub-resources) are marked "EXPERIMENTAL - DO NOT RELY on this, it is subject to change!" in the spec, as we did for the ERM, ILL and Preservation Vue app endpoints. They serve the new check-in page for now, and their shape may still change during the next cycle. FIXED IN THIS ROUND Backend: 1. Waiting holds with a cancellation request are cancelled before the return, as returns.pl did (after the 412 gate). 2. Blocked check-ins (withdrawn, lost, wrong branch) still answer 403, but AddReturn is called, as returns.pl did: the check-in, the local use, the date last seen and the location and not for loan updates are recorded. The 403 carries the checkin_id. 3. After cancelling a hold, legacy computed the next hold but its template never displayed it (diffbranch is only used with hold_auto_filled), so nothing was lost there. 4. confirm_recall checks the transferbook result: when the transfer cannot be started the recall is left unchanged, and the API answers 409 transfer_not_started with the reasons. 5. Follow-up actions are rejected with 409 item_checked_out when the item has been checked out again, and transfers that already arrived or were cancelled are not touched (409 transfer_finished). 6. When AddReturn cannot return the item (DataCorrupted), POST /checkins answers 500 checkin_failed, skips the post-return processing, and logs the internal error instead of returning it. 8. Library scope: see bug 24401. 9. The waiting holds notice counts the holds at the check-in library (this also fixes a crash without a logged in user, e.g. automatic check-ins). verify_bundle runs in a transaction. All the 400s of the sub-resources have an error_code, and the tests assert them. Front end: 11. The store identifies rows by key, not by position, so a scan during a confirmation cannot overwrite another row. 12. Rows that need attention are never trimmed from the table. 13. The transfer prompt no longer closes on clicks elsewhere on the page: a stray click cannot cancel or confirm the transfer. It closes with its buttons or Escape. (A backdrop is not used, as the page is designed to keep scanning while a prompt is open.) 14. "Remove from bundle" goes through the API client, with the CSRF token. 15. The header "Check in" box and the ILL "Check-in" action post the barcode to checkin.pl again (op=cud-checkin, with the CSRF token), and the page checks the item in, as with returns.pl. A GET with a barcode still only prefills it. 16. Follow-up actions and confirmations cannot be sent twice. API errors are shown in the page, translated, instead of "Network error" or raw English; a 401 asks to log in again. 17. A duplicate scan is reported. Cancelling the bundle verification works as "No, don't check in" and the next pending item is shown. 18. Labels on the barcode and return date inputs and the settings toggle, aria-labelledby on the modals, the duplicate access key, "n of m verified" as a single string, and the bundle message no longer mixes HTML into the translatable string. 19. Cypress: tests for the 412 confirmation flow (accepted and declined) and for the header search box check-in. The spec now passes on current main (16/16). FOLLOW-UPS I am committed to working on these next cycle. They are filed and linked here, and none of them loses data or opens a permission gap: - Bug 44075: export buttons and column visibility for the checked-in items table (a regression from returns.pl) - Bug 44076: announce the check-in results and manage focus in the modals (accessibility) - Bug 44077: remaining translatable strings built with HTML and String.replace - Bug 44078: Cypress coverage for bundles, API errors and concurrent scans - Bug 44079: make the check-in and its post-return processing atomic (point 7; legacy was not atomic either) - Bug 44080: purpose binding (typ/aud) for Koha::Token JWTs - Bug 44081: notification_summary embed follow-ups (bug 43486) - Bug 44082: backfill accountlines.checkin_id (bug 42425) - Bug 44083: PUT /return_claims/{claim_id}/resolve trusts resolved_by (point 10, not part of this bug) - Bug 44084: validate the hold cancellation reason, Koha::Module::Policy::Checkin library context (point 9) Release notes: the check-in page is now circ/checkin.pl, with body id circ_checkin instead of circ_returns. IntranetUserCSS/IntranetUserJS customizations and custom AudioAlerts selectors that target the legacy page need updating (the default AudioAlerts selectors keep working). Staff can keep scanning while a hold, transfer or recall prompt is open: the item waits as a highlighted row. Testing done on current main: the Perl tests of the chain (Circulation.t, Koha/Checkin.t, Koha/Account.t, api/v1/checkins.t and the others in the test plans), xt/api.t and the template xt tests, koha-qa.pl, and the Cypress spec. Back to Signed Off. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |BLOCKED --- Comment #212 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Setting to blocked whilst I finish a final full and thorough review for Pedro -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|43077, 43486 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43077 [Bug 43077] Add encode_claims/decode_claims to Koha::Token https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43486 [Bug 43486] Add permission-gated patron notification info to the checkin hold.patron embed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |43077, 43486, 44112 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43077 [Bug 43077] Add encode_claims/decode_claims to Koha::Token https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43486 [Bug 43486] Add permission-gated patron notification info to the checkin hold.patron embed https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44112 [Bug 44112] Add a clear control to the Vue date picker and move its icon inside right -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |44116 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44116 [Bug 44116] Item parts check-in confirmation: allow a note about missing parts, and clarify what No does -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #211511|0 |1 is obsolete| | Attachment #211512|0 |1 is obsolete| | Attachment #211513|0 |1 is obsolete| | Attachment #211514|0 |1 is obsolete| | Attachment #211515|0 |1 is obsolete| | Attachment #211516|0 |1 is obsolete| | Attachment #211517|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #213 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211705 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211705&action=edit Bug 42383: Add Koha::Module::Policy framework This patch adds a module policy framework that exposes per-module capabilities to the UI. It replaces the pattern of dedicated GET /config endpoints (like GET /erm/config) with a session-scoped mechanism. A module policy is the intersection of system preferences (feature toggles), user permissions and library context. It is a plain JSON structure: an envelope with the module name, a 'global' block with the keys common to all modules, and the module specific keys under the module name: { module => 'checkin', global => { audio_alerts => true, ... }, checkin => { exempt_fine => false, ... }, } The page is bootstrapped with the policy, and the API returns it in the error object when it refuses a request because of it, so the client can refresh the UI. The server remains authoritative: the policy is informational, not an access token. Components: - Koha::Module::Policy: base class with new(), module(), to_hashref() and scope() - Koha::Module::Policy::Checkin: check-in module policy covering fines, holds, recalls, transfers, display and blockers Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Module/Policy.t \ t/db_dependent/Koha/Module/Policy/Checkin.t => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #214 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211706 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211706&action=edit Bug 42383: Add Koha::REST::Plugin::Policy This patch adds a Mojolicious plugin that provides the module_policy helper to API controllers: return $c->render( status => 403, openapi => { error => 'Return date override is not enabled', error_code => 'return_date_not_allowed', policy => $c->module_policy( 'Checkin', { library => $library_id } ), } ); The helper loads the matching Koha::Module::Policy subclass and returns the policy envelope for the authenticated user, so controllers can include it in the 'policy' attribute of the error object when refusing a request because of it. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/REST/Plugin/Policy.t => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #215 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211707 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211707&action=edit Bug 42383: Add check-in follow-up actions and messages to Koha::Checkin This patch moves the post check-in logic of circ/returns.pl into the domain layer, so the check-in API and the new check-in page can use it. Koha::Checkin gains: - confirm_hold / cancel_hold: set the trapped hold waiting (or in transit to its pickup library), or cancel it, optionally forgiving the hold fees - confirm_transfer / cancel_transfer / replace_wrong_transfer. A transfer that has already arrived or has been cancelled is not touched - confirm_recall. If the transfer to the pickup library cannot be started, the recall is left unchanged - verify_bundle: bundle content verification, in a single transaction - is_latest, pending_actions, action_tokens and check_action_token: the follow-up actions are only allowed on the latest check-in of the item, and require a short-lived token issued with the check-in C4::Circulation::AddReturn records the check-in messages on the check-in (item type check-in message, patron fines, patron waiting holds, overdue charges on lost returns, ...) and restores the legacy post-return processing (holds queue update, HoldsAutoFill, notices for the returning patron). The waiting holds message counts the holds waiting at the check-in library, so it does not depend on a logged in user (e.g. automatic check-ins from cron jobs). Koha::Item::Availability::Checkin gains the item_parts and items_bundle confirmations, and uses snake_case keys for its blockers and confirmations (bad_barcode, not_issued). New exceptions: Koha::Exceptions::Checkin::HoldNotFound, Koha::Exceptions::Checkin::ItemCheckedOut, Koha::Exceptions::Checkin::TransferFinished and Koha::Exceptions::Checkin::TransferNotStarted. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Checkin.t \ t/db_dependent/Circulation.t \ t/db_dependent/Circulation/issue.t \ t/db_dependent/Koha/Item/Availability/Checkin.t \ t/Koha/Result/Availability.t => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #216 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211708 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211708&action=edit Bug 42383: Add check-in follow-up action endpoints This patch adds the follow-up action sub-resources to the check-in API: - POST /checkins/{checkin_id}/hold_confirmation - POST /checkins/{checkin_id}/hold_cancellation - POST /checkins/{checkin_id}/transfer_confirmation - POST /checkins/{checkin_id}/transfer_cancellation - POST /checkins/{checkin_id}/recall_confirmation Each one delegates to the matching Koha::Checkin method, requires the action token returned with the check-in, and returns the updated check-in. They are rejected (409) when the item has been checked in again (stale_checkin) or checked out again (item_checked_out) since. POST /checkins and GET /checkins/availability are adjusted to the needs of the check-in page: messages, pending actions and action tokens in the response, barcode filters applied, item parts and bundle confirmations. As the legacy returns page did, POST /checkins cancels the waiting holds of the item for which cancellation has been requested before the return. A blocked check-in (withdrawn, lost, wrong library) is answered with 403 (checkin_blocked), but AddReturn is still called, as the legacy returns page did: the check-in, the local use, the date last seen and the location and not for loan updates are recorded. If AddReturn cannot return the item (e.g. because of a data problem), POST /checkins answers 500 (checkin_failed) and skips the post-return processing. The internal error is logged, not returned. All the check-in endpoints are marked EXPERIMENTAL in the spec: they serve the new check-in page, and may still change. The error definition gains an optional 'policy' attribute (module_policy, module_policy_global and checkin_policy definitions), returned when a request is refused because of the module policy. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ yarn api:bundle k$ prove xt/api.t t/db_dependent/api/v1/checkins.t => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #217 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211709 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211709&action=edit Bug 42383: Add the Vue check-in page This patch adds a Vue based check-in page, circ/checkin.pl, built on top of the check-in REST API and its follow-up action endpoints. - circ/checkin.pl and circ/checkin.tt: entry point, bootstrapped with the check-in module policy - A check-in can be requested from other pages with a POST request (op=cud-checkin, with a CSRF token): the page checks the item in once it is loaded. A GET request with a barcode only prefills it. - Vue module, Pinia store and components under js/vue/components/Circ/Checkin/: barcode input, check-in options, checked-in items table, confirmation, hold cancellation, return claim and bundle verification modals, slip printing - checkin-api-client.js, plus the claim, item (bundled items) and patron API client additions it needs - HttpClient: the error thrown for a failed request carries the parsed response body (`body`), so callers that present errors themselves (suppressDefaultErrorDialog) can use it - rspack: new 'checkin' entry The page reproduces the behaviour of circ/returns.pl: confirmations, blockers, hold/transfer/recall dialogs, messages, audio alerts and slip printing. When the API refuses a request because of the module policy, the store applies the policy returned in the error object and tells the user why. The store identifies the rows by key, not by position, as the list changes while requests are in flight. Rows that need attention are never trimmed from the list, and a follow-up action cannot be sent twice. The errors returned by the API are shown translated, in the page. Test plan: 1. Apply patch 2. Build and restart: $ ktd --shell k$ yarn build k$ restart_all 3. Go to /cgi-bin/koha/circ/checkin.pl and check in: - an item that is checked out - an item that is not checked out - an item with a hold - an item that needs a transfer - a bundle => SUCCESS: The item is checked in, and the messages and dialogs match what returns.pl showed 4. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #218 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211710 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211710&action=edit Bug 42383: Replace circ/returns.pl with circ/checkin.pl This patch removes the legacy check-in page and points every entry point to the new one: - circ/returns.pl and circ/returns.tt are removed - circ-nav.inc, circulation-home.tt and the Alt+r shortcut in staff-global.js open circ/checkin.pl - the header search box (checkin-search-box.inc) and the ILL 'Check-in' action post the barcode to circ/checkin.pl, which checks the item in, as they did with circ/returns.pl - Koha::Manual maps the new page - basic_workflow.t checks items in on the new page Test plan: 1. Apply patch 2. Build and restart: $ ktd --shell k$ yarn build k$ restart_all 3. Open 'Check in' from the circulation home page, the circulation sidebar and with Alt+r => SUCCESS: circ/checkin.pl opens 4. Scan the barcode of a checked out item in the header 'Check in' box => SUCCESS: circ/checkin.pl opens and the item is checked in 5. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #219 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211711 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211711&action=edit Bug 42383: Add Cypress tests for the check-in page This patch adds end-to-end tests for circ/checkin.pl: simple check-ins (including from the header search box), confirmations (accepted and declined), blocked check-ins, the module policy, holds, transfers, recalls, return claims and the return date. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ yarn cypress run --spec t/cypress/integration/Circulation/Checkin_spec.ts => SUCCESS: Tests pass! 3. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #220 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211712 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211712&action=edit Bug 42383: (QA follow-up) Make "Cancel transfer" explicit when the transfer already exists When AutomaticItemReturn is enabled (or a wrong transfer is replaced) Koha creates the transfer, and sets it in transit, before the check-in dialog is shown. The Vue dialog nevertheless asked "Yes, transfer (Y)" and "No, don't transfer (N)", as if nothing had been done yet. Choosing "No" in fact cancels the transfer after the fact: it is kept in the transfers table with a cancellation date and the reason "Manual". The wording hid that, and it could not be reached with a cancel-specific shortcut. The legacy wrong-transfer dialog already uses "Cancel transfer (X)", so the same wording and access key are used here. When the check-in already has a transfer the dialog now reads: OK (Y) / Print slip (P) / Cancel transfer (X) with a note explaining that cancelling records the cancellation in the item's transfer history. When there is no transfer yet (the item "needs a transfer", AutomaticItemReturn disabled) the dialog asks "Transfer now?" with "Yes, transfer (Y)", "Yes, print slip and transfer (P)" and "No, don't transfer (N)", where "No" simply creates nothing. The print button used to read "Print slip and transfer"; it keeps the "Yes," of the legacy "Yes, print slip" so that it reads as the answer to the question. Test plan: 1. Apply the patch and rebuild the JS (yarn js:build) 2. Item belongs to library B, check it in at library A with AutomaticItemReturn on => The dialog says OK (Y) / Print slip (P) / Cancel transfer (X) 3. Press X => The item is Available, and the transfer is listed as cancelled (reason Manual) in the item's transfer history 4. Set AutomaticItemReturn to Don't automatically transfer, repeat => "Transfer now?" with Yes/No, "No" creates no transfer 5. Run: $ yarn cypress run --spec t/cypress/integration/Circulation/Checkin_spec.ts => SUCCESS: Tests pass! Assisted-by: Sonnet 5.5 (Anthropic) Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #221 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211713 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211713&action=edit Bug 42383: (QA follow-up) Dim the page and block clicks outside the dialog with TransfersBlockCirc TransfersBlockCirc ("Block staff from continuing to check in items when a transfer is triggered") only disabled the barcode box on the Vue check-in page. Every dialog carries the non-blocking class (no backdrop, pointer-events: none), so the page behind the transfer prompt stayed fully usable. Following a menu or sidebar link while the prompt was open navigated away and abandoned it: the item stayed "Available" and the transfer was never made or recorded. The legacy returns.pl page prevents this with a static backdrop that dims the page and swallows every click. When the transfer prompt blocks (TransfersBlockCirc on) the dialog now: - uses a "blocking" state with a dimmed backdrop and pointer-events on, so clicks outside the dialog hit the backdrop and do nothing - sets aria-modal="true" - keeps keyboard focus inside the dialog (Tab cannot reach the page) Escape was already ignored in this state and still is. Without TransfersBlockCirc nothing changes: the dialog stays non-blocking so staff can keep scanning. Test plan: 1. Apply the patch and rebuild the JS (yarn js:build) 2. Set TransfersBlockCirc to Block and AutomaticItemReturn to Don't automatically transfer 3. Check in an item that belongs to another library => "Transfer now?" is shown and the page behind is dimmed 4. Click a sidebar link, empty space, the barcode box; press Escape => Nothing happens, you stay on the page with the dialog open 5. Choose an option => The dialog closes and the check-in completes 6. Set TransfersBlockCirc to Don't block and repeat 3 => No dimming, the dialog can be dismissed with Escape 7. Run: $ yarn cypress run --spec t/cypress/integration/Circulation/Checkin_spec.ts => SUCCESS: Tests pass! Assisted-by: Sonnet 5.5 (Anthropic) Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #222 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211714 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211714&action=edit Bug 42383: (QA follow-up) Add an explicit "Ignore" to the transfer dialog for an existing transfer The transfer dialog is shown whenever the check-in has a transfer attached: a return to home created by AutomaticItemReturn, a transfer for a hold at another library, a pending transfer found for the item (stock rotation for example) or the replacement of a wrong transfer. For those the only choices were to confirm (OK, Print slip) or to cancel the transfer. There was no way to say "leave it as it is" other than dismissing the dialog with Escape, which also depends on AutomaticConfirmTransfer: with the preference on, dismissing confirms the transfer, with it off it is left alone. Staff could not tell what a dismissal would do. Add "Ignore (I)" next to "Cancel transfer (C)". It neither confirms nor cancels: the transfer is left exactly as it was, whatever AutomaticConfirmTransfer is set to, and the row stops asking. As for "Cancel transfer", it is only offered when the dialog does not block: with TransfersBlockCirc a decision is required, so only OK and Print slip are available. Test plan: 1. Apply the patch and rebuild the JS (yarn js:build) 2. With AutomaticItemReturn on and TransfersBlockCirc off, check in an item that belongs to another library => OK (Y) / Print slip (P) / Cancel transfer (C) / Ignore (I) 3. Press I => The dialog closes, the transfer is untouched (not cancelled) 4. Set TransfersBlockCirc to Block and repeat => No Cancel transfer and no Ignore, the page is blocked until OK 5. Run: $ yarn cypress run --spec t/cypress/integration/Circulation/Checkin_spec.ts => SUCCESS: Tests pass! Assisted-by: Sonnet 5.5 (Anthropic) Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #223 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211715 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211715&action=edit Bug 42383: (QA follow-up) Restore the card layout of the check-in page The legacy check-in page presents the form in a white block: the heading, the barcode box and the settings that expand when the sliders icon in the barcode box is clicked, separated by a rule. The checked-in items sit in a second white block (".page-section") with a "Checked-in items" heading. The Vue page lost this. Only the barcode row was white, the settings panel was rendered on the grey page background outside any block, and the checked-in items table had no block at all, so the form and the results ran into the page background. Restore it: - the heading, the barcode box, the active-settings badges and the settings panel share one white card, as before - the checked-in items are in their own card with the "Checked-in items" heading when there is something to show (the empty message stays plain) The settings keep their legacy layout: the return date with its "Remember" checkbox, then the other checkboxes, stacked. The ids and behaviour of the options are unchanged. Test plan: 1. Apply the patch and rebuild the JS (yarn js:build) 2. Go to Circulation > Check in => The heading and the barcode box are in a white card 3. Click the sliders icon in the barcode box => The settings expand inside the same card, below a rule: the return date, then the checkboxes, stacked as on the legacy page 4. Check in an item => The checked-in items are in a second white card, headed "Checked-in items" 5. Run: $ yarn cypress run --spec t/cypress/integration/Circulation/Checkin_spec.ts => SUCCESS: Tests pass! Assisted-by: Sonnet 5.5 (Anthropic) Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #224 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211716 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211716&action=edit Bug 42383: (QA follow-up) Test the clear control of the return date field The return date of the check-in settings is a Vue date field, which gets a clear control from the date picker (Bug 44112): a cross inside the field, shown once it has a value. The legacy check-in page had an equivalent link, so make sure the Vue page keeps offering it. This test picks a return date, clears it with the control, and checks that the field is empty and that no return date is active any more. Depends on Bug 44112. Test plan: 1. Apply the patch of Bug 44112 and this one, rebuild the JS (yarn js:build) 2. Run: $ yarn cypress run --spec t/cypress/integration/Circulation/Checkin_spec.ts => SUCCESS: Tests pass! Assisted-by: Sonnet 5.5 (Anthropic) Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #225 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211717 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211717&action=edit Bug 42383: (QA follow-up) Stop password managers from treating the barcode box as a fillable field Password managers (1Password, LastPass, Bitwarden, Dashlane) can decide that the barcode input is a login or autofill field and add their icon inside it. The icon sits where the check-in settings (sliders) icon is, on the right of the box, so the settings icon can no longer be clicked. The legacy form carried autocomplete="off" on the form, which the Vue form lacked. Put it back on the form and mark the input, in addition to its autocomplete="off", with the opt-out attributes the common password managers honour: data-1p-ignore, data-lpignore, data-bwignore and data-form-type="other". Test plan: 1. Apply the patch and rebuild the JS (yarn js:build) 2. With a password manager browser extension enabled, go to Circulation > Check in => The extension does not add its icon inside the barcode box, and the settings (sliders) icon can be clicked 3. Run: $ yarn cypress run --spec t/cypress/integration/Circulation/Checkin_spec.ts => SUCCESS: Tests pass! Assisted-by: Sonnet 5.5 (Anthropic) Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #226 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211718 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211718&action=edit Bug 42383: (QA follow-up) Clarify the description of AutomaticConfirmTransfer The preference reads "[Do/Don't] automatically confirm a transfer when the modal is dismissed without clicking 'Yes'". It is misleading: - there is no "Yes" button when the transfer already exists (it is "OK"), and a "Yes, transfer" button only when none exists yet - it does not say what "confirm" does: the transfer is sent (set in transit) - it does not say which transfers are concerned. Only transfers that already exist when the dialog is shown are: the replacement transfer of a wrong transfer, or a pending transfer found at check-in (stock rotation for example). Nothing is created by dismissing a "Transfer now?" prompt (AutomaticItemReturn disabled), and a transfer created by AutomaticItemReturn or for a hold is already sent, so dismissing the dialog changes nothing for those - it does not say that it only applies when TransfersBlockCirc is set to "Don't block" (the dialog cannot be dismissed otherwise), nor that choosing an option explicitly (OK, Print slip, Cancel transfer, Ignore, No) is never altered This is what the check-in pages implement (the legacy page dismisses the wrong-transfer dialog and the dialog of an existing transfer; the Vue page does the same). Only the description changes. Test plan: 1. Apply the patch 2. Go to Administration > System preferences > Circulation > Check-in policy, and read AutomaticConfirmTransfer => The description says what is confirmed, for which transfers, and when it applies 3. Run: $ prove t/db_dependent/sysprefs.t t/db_dependent/check_sysprefs.t => SUCCESS: Tests pass! Assisted-by: Sonnet 5.5 (Anthropic) Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #227 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211719 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211719&action=edit Bug 42383: (QA follow-up) Confirm a bundle in a single modal, and bring its list of missing items back Checking in a bundle needed two consecutive modals: "Please confirm check in", which only told staff that the item is a bundle, then "Please confirm bundle contents". The first one asked for nothing the second does not ask for. The legacy page had the single contents modal. Also: - the contents modal did not look like the other modals of the page: the explanation was below the table, as help text, and the bundle being checked in was only named in the title - the table of the expected items could no longer be exported (legacy had copy, CSV and print buttons) - the actions had no keyboard shortcuts, and "Confirm checkin without verifying bundle contents" did not say what it does - when parts were missing, the alert named them but the list could not be printed any more (legacy offered it in a printable modal), so staff could not take it with them to look for the parts The bundle is now confirmed in one modal: - the bundle (barcode and title, linked to the record) is at the top, then the CircConfirmItemParts note if there is one, then the explanation as an alert, above the table of expected items - the barcodes box has the focus, as before - "Export" in the heading row of the table (copy, CSV, print), which does not add vertical space and leaves out the status column - "Check in, mark missing lost (Y)", "Check in, verify later (L)" and "Cancel (X)", with the cross of Cancel like the other modals The "bundle had missing items" alert has a "Print list" button, which prints the barcodes and titles of the missing items. Test plan: 1. Apply the patch and rebuild the JS (yarn js:build) 2. Check in a checked out bundle => One modal: the bundle at the top, the explanation above the table, the focus in the barcodes box, Export in the table heading 3. Click Export => Copy, CSV and Print, without the status column in the result 4. Scan one of the two parts and press Y => The other part is lost, and the alert lists it with a "Print list" button 5. Check in the bundle again and press X (Cancel) => The bundle is not checked in 6. Run: $ yarn cypress run --spec t/cypress/integration/Circulation/Checkin_spec.ts => SUCCESS: Tests pass! Assisted-by: Sonnet 5.5 (Anthropic) Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #228 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211720 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211720&action=edit Bug 42383: (QA follow-up) Resolve a return claim in the same modal, and name "Ignore" for what it does Checking in an item with a return claim needed two consecutive modals: the "Return claim" modal, with "Resolve claim" and "Ignore", then a second "Resolve return claim" modal asking for the resolution. The first one only asked staff to open the second. The "Ignore (I)" button did not say what is being ignored: the item is already checked in, it only leaves the claim unresolved. The resolution fields are now in the return claim modal: - the resolution (required) and the optional new lost status, under the messages about the check-in. Opening the claim from the row of the checked-in items shows the same modal - "Resolve claim (Y)", disabled until a resolution is chosen, resolves the claim and closes the modal; an error is shown in the modal - "Ignore (I)" is "Resolve later (L)" The fee messages of the modal ("lost item fees will remain on the patron's account"...) are the outcome of the check-in itself, which already found the item and applied the lost item refund rules. They stay correct after the claim is resolved: resolving only records the resolution, and the new lost status only sets the status of the item, nothing is charged or refunded when it changes. The modal now says so under the lost status. The second modal is removed. Test plan: 1. Apply the patch and rebuild the JS (yarn js:build) 2. Set ClaimReturnedLostValue, and claim an item as returned by the patron it is checked out to 3. Check the item in => One "Return claim" modal, with the resolution fields, "Resolve claim (Y)" (disabled) and "Resolve later (L)" 4. Choose a resolution and press Y => The claim is resolved, the row is marked resolved, no second modal 5. Run: $ yarn cypress run --spec t/cypress/integration/Circulation/Checkin_spec.ts => SUCCESS: Tests pass! Assisted-by: Sonnet 5.5 (Anthropic) Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #229 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211721 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211721&action=edit Bug 42383: (QA follow-up) Report a refused check-in in a red alert under the form, not in a modal When the module policy refuses a check-in (BlockReturnOfWithdrawnItems, BlockReturnOfLostItems, an item that must be checked in at another library), the Vue page opened a "Cannot check in" modal with an OK button to acknowledge. The legacy page showed a red alert for withdrawn and lost items. Nothing is decided in this modal: it only informs, and it costs a click before the next item can be scanned, in a page where the other outcomes (messages, fees, bundle changes) are shown in alerts under the form. The page now follows one rule: a modal is for a choice that changes what happens next, and an alert is for an outcome. A refused check-in is an outcome, so: - a red alert ("NOT CHECKED IN", then the reason) is shown under the form, like the other alerts of the page. It has role="alert" and plays the warning sound - the note about the accompanying materials, if the item has one, is shown with it - the row of the table stays marked "Blocked", and the next item can be scanned at once - a refused check-in no longer waits in the queue of the modals Test plan: 1. Apply the patch and rebuild the JS (yarn js:build) 2. Set BlockReturnOfWithdrawnItems, withdraw a checked out item and check it in => A red "NOT CHECKED IN: This item is withdrawn and cannot be checked in." alert under the form, no modal, and the barcode box is ready 3. Set BlockReturnOfLostItems, mark an item lost and check it in => The same, for a lost item 4. Run: $ yarn cypress run --spec t/cypress/integration/Circulation/Checkin_spec.ts => SUCCESS: Tests pass! Assisted-by: Sonnet 5.5 (Anthropic) Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #230 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211722 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211722&action=edit Bug 42383: (QA follow-up) Wait for the focus of the barcode box in the check-in tests The page gives the focus to the barcode box about half a second after it is mounted (after staff-global.js has focused the header search box). A test that opened the date picker of the settings straight after loading the page could have the focus taken from it while the calendar was open, which closes it: "takes a time and does not allow a future date" failed now and then because of it. visitCheckin() now also waits until the barcode box has the focus. Test plan: 1. Run: $ yarn cypress run --spec t/cypress/integration/Circulation/Checkin_spec.ts => SUCCESS: Tests pass! Assisted-by: Sonnet 5.5 (Anthropic) Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #231 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211723 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211723&action=edit Bug 42383: (QA follow-up) Say on the row when an action was declined, and let it be reopened Answering "No" to the transfer prompt, cancelling or ignoring a transfer, a hold or a recall, or leaving a return claim for later, closed the dialog and left nothing on the row of the checked-in item: the row looked as if nothing had been asked. After a mis-click there was also no way back: the item had to be checked in again, which it cannot be. The row now remembers what was done and says so, with a button to decide again: - "Transfer declined" (No, don't transfer), "Transfer cancelled" (Cancel transfer) and "Transfer left as it is" (Ignore, or closing the dialog with an existing transfer) - "Hold ignored", "Recall ignored" and "Claim not resolved" (Resolve later) - "Reopen" brings the dialog back, as it was. For a cancelled transfer it asks "Transfer now?": a new transfer is requested, the cancelled one is kept in the transfer history Nothing changes in what the buttons do. The rows stay out of the queue of the modals, so they do not interrupt scanning. Test plan: 1. Apply the patch and rebuild the JS (yarn js:build) 2. Set AutomaticItemReturn to "Don't automatically transfer", and check in an item that belongs to another library. Press N => The row says "Transfer declined", with a Reopen button 3. Press Reopen, then Y => "Transfer now?" is asked again, and the transfer is requested 4. Repeat with a hold (Ignore), a recall (Ignore), a transfer made by AutomaticItemReturn (Cancel transfer) and a return claim (Resolve later) => Each row says what was left undone, and Reopen brings it back 5. Run: $ yarn cypress run --spec t/cypress/integration/Circulation/Checkin_spec.ts => SUCCESS: Tests pass! Assisted-by: Sonnet 5.5 (Anthropic) Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #232 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211724 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211724&action=edit Bug 42383: (QA follow-up) Restore the Columns, Export and Configure controls of the checked-in table The legacy page shows the checked-in items in a DataTable with its menu: Columns (show or hide a column), Export (CSV, Copy, Print), Copy shareable link and Configure (the table settings in the administration). The new page showed the table without any of it. The columns only followed the table settings, and there was a TODO for the rest. The table now has the same controls above it, right aligned and without outlines until hovered, as the buttons of the DataTables. They are a new shared component, TableControls, for the tables that Vue renders itself (KohaTable keeps its DataTables buttons): each control is there when the table gives what it needs, so another table can have only some of them. The helpers to print, copy and download a table move to utils/: - Columns: a menu with a checkbox for each column of the table settings, starting from their defaults (Date acquired is hidden, for example). The choice is remembered in the browser, so it is the same on the next check-in session - Export: CSV, Copy and Print of the table as shown: the visible columns and their cells, without the buttons - Configure: a link to the table settings (module circ, page returns, table checkedintable), for librarians allowed to configure the columns "Copy shareable link" is not brought back: it shares the search, sorting and page of a table that has data of its own, and this table lists what was checked in during the session. Test plan: 1. Apply the patch and rebuild the JS (yarn js:build) 2. Check in an item => Columns, Export and Configure are above the table 3. Open Columns, untick "Call number" and tick "Date acquired" => The table loses the first and gains the second, headings and cells 4. Reload the page and check in another item => The same columns are shown 5. Open Export and choose CSV, Copy and Print => The visible columns are exported 6. Press Configure => The table settings of the check-in table open 7. Run: $ yarn cypress run --spec t/cypress/integration/Circulation/Checkin_spec.ts => SUCCESS: Tests pass! Assisted-by: Sonnet 5.5 (Anthropic) Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #233 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211725 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211725&action=edit Bug 42383: (QA follow-up) Show "Not checked out" and "Local use recorded" as alerts, and say when a hold was cancelled The new check-in page only showed "Not checked out" and "Local use" as small badges in the Status column of the row, where the legacy page shows them as messages. They were also both blue. The page also cancels, like the legacy one, the waiting holds that the patron asked to cancel before returning the item, and said nothing about it: the only thing visible was "Not checked out" and "Local use", as if the item had been scanned with no hold on it. The results are now alerts under the form, like the other results: - "Not checked out." is a warning (yellow). The message is a warning in the API, so its badge is yellow as well - "Local use recorded." (RecordLocalUseOnReturn) is information (blue) - "The hold waiting for this item was cancelled: the patron asked for it to be cancelled." is information, and the row has a "Hold cancelled" badge. The API reports it as a "hold_cancelled" message with the hold and the patron The tests also cover the note a patron leaves on a checkout, which the page already shows as a "Patron note" alert and which had no test. Test plan: 1. Apply the patch, rebuild the JS (yarn js:build) and restart_all 2. Set RecordLocalUseOnReturn to "Record", and check in an item that is not checked out => A yellow alert says "Not checked out." and a blue one "Local use recorded." 3. Place a hold on an item, set it waiting (check it in and confirm the hold), then cancel it as the patron from the OPAC (Request cancellation) and check the item in again => A blue alert says that the hold was cancelled, and the row says "Hold cancelled" 4. Check out an item with a note (OPAC, AllowCheckoutNotes) and check it in => The "Patron note" alert is shown 5. Run: $ prove t/db_dependent/api/v1/checkins.t $ yarn cypress run --spec t/cypress/integration/Circulation/Checkin_spec.ts => SUCCESS: Tests pass! Assisted-by: Sonnet 5.5 (Anthropic) Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #234 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211726 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211726&action=edit Bug 42383: (QA follow-up) Say what closing the transfer dialog does Closing the dialog of a transfer without a button (Escape, or scanning the next item) does different things: it confirms an existing transfer when AutomaticConfirmTransfer is set, leaves it as it is when it is not, and does not create the transfer when AutomaticItemReturn is off. Nothing on the dialog said which, and the primary button is the same in all three cases. The dialog now has a line under the question that says what closing it will do. It is not shown when TransfersBlockCirc blocks the page, as the dialog cannot be closed then. Test plan: 1. Apply the patch and rebuild the JS (yarn js:build) 2. Set AutomaticItemReturn to "Automatically transfer", AutomaticConfirmTransfer to "Don't confirm" and TransfersBlockCirc to "Don't block". Check in an item that belongs to another library => The dialog says that closing it leaves the transfer as it is 3. Set AutomaticConfirmTransfer to "Confirm" and check in another => It says that closing it, or scanning the next item, confirms the transfer 4. Set AutomaticItemReturn to "Don't automatically transfer" and check in another => It says that closing it does not transfer the item 5. Run: $ yarn cypress run --spec t/cypress/integration/Circulation/Checkin_spec.ts => SUCCESS: Tests pass! Assisted-by: Sonnet 5.5 (Anthropic) Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #235 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211727 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211727&action=edit Bug 42383: (QA follow-up) Make the librarian read the note a patron left on the checkout A patron can leave a note on a checkout (AllowCheckoutNotes). It is freeform, and it is not a message staff come to expect, so a blue alert under the form is easy to get used to and ignore. On the legacy page it is a heading in the message area of the page. When a returned item has such a note, and there is nothing else to decide for it, the page now opens a dialog with the note, its date and an "Acknowledge (Y)" button. As the dialogs of a blocking transfer, it dims the page and disables the barcode box until the note is read. Items that need a hold, transfer, recall or claim answer show the note in that dialog, as before. It queues with the other dialogs: one is shown at a time. The note stays on the row, in the Note column, once it was read. This is the exception to the rule that a dialog is for a choice that changes what happens next: staff have to read this one. Test plan: 1. Apply the patch and rebuild the JS (yarn js:build) 2. Check out an item to a patron, and give the checkout a note (the patron can add it in the OPAC, with AllowCheckoutNotes on) 3. Check the item in => A dialog "Note from the patron" shows the note and the date; the page is dimmed and the barcode box is disabled 4. Press "Acknowledge (Y)" => The barcode box is ready again, and the row shows the note 5. Run: $ yarn cypress run --spec t/cypress/integration/Circulation/Checkin_spec.ts => SUCCESS: Tests pass! Assisted-by: Sonnet 5.5 (Anthropic) Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #236 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211728 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211728&action=edit Bug 42383: (QA follow-up) Do not take the focus from the field of an open dialog The check-in page puts the focus back in the barcode box after a scan, once a dialog is closed and when a dialog opens. When one of these ran after the dialog had focused its own field, the focus left it: the barcodes of a bundle were typed half in the dialog and half in the barcode box, and the date picker lost the focus that kept its calendar open. It depended on how fast the server answered, so the check-in tests failed from time to time. The focus is no longer taken from an input, a textarea or a select inside an open dialog. Test plan: 1. Apply the patch and rebuild the JS (yarn js:build) 2. Check in the host of a bundle and scan its parts into the barcodes box => All the barcodes land in the box, whatever the speed of the server 3. Run: $ yarn cypress run --spec t/cypress/integration/Circulation/Checkin_spec.ts => SUCCESS: Tests pass! Assisted-by: Sonnet 5.5 (Anthropic) Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #237 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211729 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211729&action=edit Bug 42383: (QA follow-up) Say the result of a dialog once, in an alert, and keep the dialogs for decisions Dialogs are for what staff have to decide or read: a transfer, a hold, a recall, a claim, the contents of a bundle, a note of the patron. The results of the check-in are alerts under the form, including the result of what was chosen in a dialog. Two things did not follow that: - The dialog of a transfer listed all the check-in messages (item type message, fees, restrictions...), and the dialog of a claim the messages about the lost item fees. They were shown again as alerts as soon as the dialog was closed. They are no longer in the dialogs, the alerts have them. The dialogs keep what is needed to decide: the reason of the transfer, the hold and its patron, the recall, the fields of the claim - Nothing said the result of the choice: after Confirm hold, Cancel transfer or Resolve claim only the badge of the row changed. An alert now says it once the dialog is closed: "Hold confirmed: the item is waiting at X" or "being sent to X", "The hold was cancelled.", "The item is being sent to X.", "The transfer was cancelled." or "The item was not transferred.", "Recall confirmed.", "The return claim was resolved." Test plan: 1. Apply the patch and rebuild the JS (yarn js:build) 2. Check in an item that belongs to another library, with an item type message (Check in message of the item type), and open the transfer dialog => The dialog has the reason of the transfer, not the message 3. Press OK (Y) => The alerts say that the item is being sent, and show the message 4. Repeat with a hold (Confirm hold), a cancelled transfer and a return claim => An alert says the result each time 5. Run: $ yarn cypress run --spec t/cypress/integration/Circulation/Checkin_spec.ts => SUCCESS: Tests pass! Assisted-by: Sonnet 5.5 (Anthropic) Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|BLOCKED |Passed QA --- Comment #238 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- I have done a final QA run of the whole tree of bugs together (24401, 43077, 43486, 44112 and 42383, applied in order on current main) as a final overall QA review. Setting to Passed QA. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |44130 --- Comment #239 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- *** Bug 44075 has been marked as a duplicate of this bug. *** Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44130 [Bug 44130] Make RecordLocalUseOnReturn granular: not every unissued check-in is local use -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |26.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #240 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Thanks everyone! Pushed to main for 26.11! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pedro.amorim@openfifth.co.u | |k --- Comment #241 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Hi all, The new check-in page doesn't do a few things the old page did. Could these be fixed in follow-up bugs? Thanks in advance. A) Hold notes are not shown when a hold is found on check-in. 1) Check out item 3999900000001 to patron '23529000591678' 2) Place a hold on its record for patron '23529001000463', pickup at Centerville, with the note 'Call before pickup' (http://localhost:8081/cgi-bin/koha/reserve/request.pl?biblionumber=1) 3) Check the item in at Circulation > Check in (http://localhost:8081/cgi-bin/koha/circ/checkin.pl) 4) Expected: the hold dialog shows 'Call before pickup', as the old page did. Actual: no note B) Checked-out items of a rotating collection are no longer flagged for transfer on check-in. 1) Check out item 3999900000002 to patron '23529000591678' 2) In Tools > Rotating collections (http://localhost:8081/cgi-bin/koha/rotating_collections/rotatingCollections....), create a collection, add item 3999900000002 to it, then transfer the collection to Midway 3) Check the item in at Circulation > Check in (http://localhost:8081/cgi-bin/koha/circ/checkin.pl) 4) Expected: "Please transfer item to: Midway", as the old page showed. Actual: nothing, the item stays at Centerville C) 'ShowAllCheckins' has no effect: items that were not checked out are always listed. 1) Set 'ShowAllCheckins' to "Don't show" (http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ShowAllCheckins) 2) Check in item 3999900000017, which is not checked out, at http://localhost:8081/cgi-bin/koha/circ/checkin.pl 3) Expected: the item is not added to the 'Checked-in items' table. Actual: it is D) A check-in refused by 'BlockReturnOfWithdrawnItems' (or 'BlockReturnOfLostItems') no longer cancels a waiting hold that has a cancellation request. 1) Set 'BlockReturnOfWithdrawnItems' to "Block" (http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=BlockReturnOfWithdrawnItems) 2) In Administration > Circulation and fines rules (http://localhost:8081/cgi-bin/koha/admin/smart-rules.pl), under 'Default waiting hold cancellation policy', set 'Cancellation allowed' to 'Yes' for all patron categories and item types 3) Place a hold on the record of item 3999900000018 for patron '42' (koha), pickup at Centerville (http://localhost:8081/cgi-bin/koha/reserve/request.pl?biblionumber=4) 4) Check in item 3999900000018 at http://localhost:8081/cgi-bin/koha/circ/checkin.pl and confirm the hold, so it is waiting 5) Log in to the OPAC as koha/koha, go to 'Holds' in your account (http://localhost:8080/cgi-bin/koha/opac-user.pl) and click 'Request to cancel' 6) On the 'Items' tab of the record (http://localhost:8081/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=4), set the 'Withdrawn status' of item 3999900000018 to 'Withdrawn' and click 'Set status' 7) Check in item 3999900000018 again 8) Expected: the check-in is refused and the waiting hold is cancelled, as the old page did. Actual: the check-in is refused and the hold is still waiting (http://localhost:8081/cgi-bin/koha/reserve/request.pl?biblionumber=4) E) The 'Fast cataloging' link is missing from the sidebar of the check-in page. 1) Go to Circulation > Renew (http://localhost:8081/cgi-bin/koha/circ/renew.pl): the sidebar has a 'Fast cataloging' link (KTD has the 'FA' framework) 2) Go to Circulation > Check in (http://localhost:8081/cgi-bin/koha/circ/checkin.pl) 3) Expected: the same 'Fast cataloging' link in the sidebar, as on the old page. Actual: it is not there F) circ/returns.pl is gone with no redirect, so bookmarks and custom links to it now give a 404. 1) Go to http://localhost:8081/cgi-bin/koha/circ/returns.pl 2) Expected: redirected to http://localhost:8081/cgi-bin/koha/circ/checkin.pl. Actual: 404 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |44137 Blocks| |44138 Blocks| |44139 Blocks| |44140 Blocks| |44141 Blocks| |44142 Blocks| |19814 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19814 [Bug 19814] Batch Check-in function https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44137 [Bug 44137] Check-in page: show hold notes in the hold found dialog https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44138 [Bug 44138] Check-in page: flag checked-out rotating collection items for transfer https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44139 [Bug 44139] Check-in page: honour ShowAllCheckins https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44140 [Bug 44140] Check-in page: cancel waiting hold with cancellation request when return is blocked https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44141 [Bug 44141] Check-in page: add the Fast cataloging link to the sidebar https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44142 [Bug 44142] Redirect circ/returns.pl to circ/checkin.pl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |44143 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44143 [Bug 44143] Check-ins performed in the staff interface log interface "REST API" -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |The staff check-in page is release notes| |rebuilt in Vue and replaces | |the legacy | |`circ/returns.pl`. It | |reproduces the behaviour of | |the old page: check-in | |messages, hold, transfer | |and recall confirmations, | |return claims, bundle | |verification and slip | |printing. It opens from the | |circulation home page, the | |circulation sidebar and | |Alt+r, and the header | |check-in search box now | |checks items in on this | |page. | | | |Developers: the check-in | |API gains follow-up action | |endpoints for hold, | |transfer and recall | |confirmations. They are | |marked EXPERIMENTAL and may | |still change. | | | |**Changed system | |preferences** | |- | |`AutomaticConfirmTransfer` | |- the description now says | |which transfers it applies | |to and what confirming | |does. The setting and its | |default are unchanged. | | | |**Upgrade notes** | |- `circ/returns.pl` has | |been removed. There is no | |redirect, so bookmarks and | |links to it need to use | |`circ/checkin.pl` instead. | |A `?barcode=` parameter on | |`circ/checkin.pl` prefills | |the barcode field without | |checking the item in. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |44195 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44195 [Bug 44195] No visual feedback that barcode has been submitted for checkin -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |44196 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44196 [Bug 44196] Non-blocking checkin modals should have a backdrop -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |44197 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44197 [Bug 44197] Buttons on checkin page should not use btn-outline-* -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |44198 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44198 [Bug 44198] Group checkin actions under patron or status columns -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |44199 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44199 [Bug 44199] Group lost item messages -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Bug 42383 depends on bug 44112, which changed state. Bug 44112 Summary: Add a clear control to the Vue date picker and move its icon inside right https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44112 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |44206 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Status|Pushed to main |Needs documenting --- Comment #242 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Enhancement, no 26.05.x backport. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44206 [Bug 44206] Check-in transfer dialog mentions buttons it does not show -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org