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

--- Comment #19 from David Nind <[email protected]> ---
Created attachment 203658
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203658&action=edit
Bug 41445: Wrong info about holds selection after hold suspending

Replace `.click()` toggle calls on `.select_hold_all` with explicit prop
manipulation throughout holds.js. The `.click()` approach toggled the checkbox
state rather than reliably clearing it, causing the select-all checkbox and
holds-selected counter to be incorrectly set after hold actions.

  - Replace `.click()` toggle in suspend-modal-submit done handler with
    direct prop manipulation; this was the root cause of the original
    report — suspending a single hold via the button would check
    select-all and show total holds selected
  - Remove premature deletion of localStorage.selectedHolds from the
    'Cancel selected' click handler; selections were being lost before
    the user confirmed the action
  - Remove the select_hold_all guard in the cancelModalConfirmBtn done
    handler so selections are always cleared after a confirmed cancel,
    not only when select-all was used
  - Remove the holdsTable reload from the cancelModal hidden.bs.modal
    handler; it was rebuilding the DOM on dismiss (wiping visual checkbox
    state) and was redundant on confirm since .success() already reloads
  - Apply the same fixes in the load_patron_holds_table context
  - Update the holds tab badge count on draw.dt so it reflects the
    current row count after any table reload

Revised test plan:
1. Go to a patron with 2 or more active holds
2. Navigate to Details -> Holds tab
3. Without selecting any checkboxes, click the Suspend button in the Suspend?
column and confirm — verify select-all is NOT checked and holds selected count
is zero
4. Select one or more unsuspended holds and verify count on holds selected is
correct
5. Select Suspend button in Suspend? column, then Suspend on the modal
6. Notice selection boxes are unchecked and holds selected count is zero
7. Repeat steps 4-6 using the trash can icon in the 'Delete?' column and
clicking "Confirm cancellation" in the modal
8. Repeat steps 4-6 using the 'Cancel selected' button underneath the holds
table clicking "Confirm cancellation" in the modal
9. Select a hold. Click on a trash can icon in the 'Delete?' column. Use the X
to dismiss modal or click cancel. Confirm selections remain and count of holds
selected is correct
10. Select an unsuspended hold. Click the 'Suspend Selected' button under the
holds table. Use the X to dismiss modal or click cancel. Confirm selections
remain and count of holds selected is correct
11. Select a hold. Click the 'Cancel selected' button under the holds table.
Use the X to dismiss modal or click cancel. Confirm selections remain and count
of holds selected is correct

Sponsored-by: CLAMS
Assisted by: Sonnet 4.6 (Anthropic)

Signed-off-by: David Nind <[email protected]>

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

Reply via email to