[Bug 41438] New: Batch hold tool: Suspended holds are unsuspended when making other changes to holds
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41438 Bug ID: 41438 Summary: Batch hold tool: Suspended holds are unsuspended when making other changes to holds Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Tools Assignee: koha-bugs@lists.koha-community.org Reporter: emmi.takkinen@koha-suomi.fi QA Contact: testopia@bugs.koha-community.org If one modifies suspended holds e.g. changes their pickup library, holds are unsuspended. This happens due error in logic of checking if "Suspend holds" selection is empty. To reproduce: 1. Navigate to Tools->Batch modify holds. 2. Search suspended holds. 3. Select a hold to modify and change it's pickup library, but leave "Suspend holds" selection empty. 4. Press "Modify holds". => Note that hold is now not suspended. -- 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=41438 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |major Assignee|koha-bugs@lists.koha-commun |emmi.takkinen@koha-suomi.fi |ity.org | Status|NEW |ASSIGNED -- 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=41438 --- Comment #1 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 190454 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=190454&action=edit Bug 41438: Do not always unsuspend holds when using batch modify holds tool If one modifies suspended holds e.g. changes their pickup library, holds are unsuspended. This happens due error in logic of checking if "Suspend holds" selection is empty. This patch fixes this by moving the if statement for checking new suspended status before doing anything else for the value. To reproduce: 1. Navigate to Tools->Batch modify holds. 2. Search suspended holds. 3. Select a hold to modify and change it's pickup library, but leave "Suspend holds" selection empty. 4. Press "Modify holds". => Note that hold is now unsuspended. 5. Apply this patch, start services again if needed. 6. Repeat steps from 2. to 4. => Note that hold is not suspended. => Confirm that suspending and unsuspending with and without suspend date still works as expected. Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41438 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41438 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41438 Roman Dolny <roman.dolny@jezuici.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41438 Roman Dolny <roman.dolny@jezuici.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #190454|0 |1 is obsolete| | --- Comment #2 from Roman Dolny <roman.dolny@jezuici.pl> --- Created attachment 190468 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=190468&action=edit Bug 41438: Do not always unsuspend holds when using batch modify holds tool If one modifies suspended holds e.g. changes their pickup library, holds are unsuspended. This happens due error in logic of checking if "Suspend holds" selection is empty. This patch fixes this by moving the if statement for checking new suspended status before doing anything else for the value. To reproduce: 1. Navigate to Tools->Batch modify holds. 2. Search suspended holds. 3. Select a hold to modify and change it's pickup library, but leave "Suspend holds" selection empty. 4. Press "Modify holds". => Note that hold is now unsuspended. 5. Apply this patch, start services again if needed. 6. Repeat steps from 2. to 4. => Note that hold is not suspended. => Confirm that suspending and unsuspending with and without suspend date still works as expected. Sponsored-by: Koha-Suomi Oy Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41438 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@openfifth.c | |o.uk QA Contact|testopia@bugs.koha-communit |martin.renvoize@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=41438 --- Comment #3 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- I think this may have an unintended side effect.. If a user sets new_suspend_date but leaves new_suspend_status empty (default), the suspend date will be completely ignored now when it wasn't before. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41438 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #190468|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=41438 --- Comment #4 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 190575 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=190575&action=edit Bug 41438: Do not always unsuspend holds when using batch modify holds tool If one modifies suspended holds e.g. changes their pickup library, holds are unsuspended. This happens due error in logic of checking if "Suspend holds" selection is empty. This patch fixes this by moving the if statement for checking new suspended status before doing anything else for the value. To reproduce: 1. Navigate to Tools->Batch modify holds. 2. Search suspended holds. 3. Select a hold to modify and change it's pickup library, but leave "Suspend holds" selection empty. 4. Press "Modify holds". => Note that hold is now unsuspended. 5. Apply this patch, start services again if needed. 6. Repeat steps from 2. to 4. => Note that hold is not suspended. => Confirm that suspending and unsuspending with and without suspend date still works as expected. Sponsored-by: Koha-Suomi Oy Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> 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=41438 --- Comment #5 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 190576 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=190576&action=edit Bug 41438: (follow-up) Fix JavaScript validation issues This follow-up patch corrects two JavaScript issues in the batch modify holds form: 1. Fixes typo: 'suspened' -> 'suspended' on line 637 This typo prevented the suspended status check from working correctly when determining if any selected holds are suspended. 2. Fixes ineffective validation logic on line 643 When a suspend date is provided without explicitly setting the suspend status, the code now properly updates the form field value instead of just setting a local variable. Changes: - Old: new_suspend_status = 1; - New: $("#new_suspend_status").val("1"); This ensures that setting a suspend date automatically sets the suspend status to "Suspend" as intended, allowing the behavior to match the server-side logic. Test plan: 1. Navigate to Tools->Batch modify holds 2. Search for and select some holds 3. Set only a "Suspend until" date without changing "Suspend holds" 4. Click "Modify holds" 5. Verify the holds are suspended with the specified date 6. Confirm the form properly auto-selects "Suspend" when a date is provided -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41438 --- Comment #6 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Can you take a look at my follow-up Emmi and let me know if you agree with it? I think it resolves the case where one could attempt to set a suspend date without setting the suspend state correspondingly. If you're happy I think we can PQA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41438 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #190576|0 |1 is obsolete| | --- Comment #7 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 190611 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=190611&action=edit Bug 41438: (follow-up) Fix JavaScript validation issues This follow-up patch corrects two JavaScript issues in the batch modify holds form: 1. Fixes typo: 'suspened' -> 'suspended' on line 637 This typo prevented the suspended status check from working correctly when determining if any selected holds are suspended. 2. Fixes ineffective validation logic on line 643 When a suspend date is provided without explicitly setting the suspend status, the code now properly updates the form field value instead of just setting a local variable. Changes: - Old: new_suspend_status = 1; - New: $("#new_suspend_status").val("1"); This ensures that setting a suspend date automatically sets the suspend status to "Suspend" as intended, allowing the behavior to match the server-side logic. Test plan: 1. Navigate to Tools->Batch modify holds 2. Search for and select some holds 3. Set only a "Suspend until" date without changing "Suspend holds" 4. Click "Modify holds" 5. Verify the holds are suspended with the specified date 6. Confirm the form properly auto-selects "Suspend" when a date is provided Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41438 --- Comment #8 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- (In reply to Martin Renvoize (ashimema) from comment #6)
Can you take a look at my follow-up Emmi and let me know if you agree with it?
I think it resolves the case where one could attempt to set a suspend date without setting the suspend state correspondingly.
If you're happy I think we can PQA
Thank you Martin for the quick follow-up! Tested this and different suspend scenarios (suspending with and without suspend date, unsuspend) seem to be working now as intended. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41438 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rel_25_11_candidate -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41438 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Patch doesn't apply --- Comment #9 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Doesn't apply now due to Bug 38739, -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41438 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #190575|0 |1 is obsolete| | --- Comment #10 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 191510 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=191510&action=edit Bug 41438: Do not always unsuspend holds when using batch modify holds tool If one modifies suspended holds e.g. changes their pickup library, holds are unsuspended. This happens due error in logic of checking if "Suspend holds" selection is empty. This patch fixes this by moving the if statement for checking new suspended status before doing anything else for the value. To reproduce: 1. Navigate to Tools->Batch modify holds. 2. Search suspended holds. 3. Select a hold to modify and change it's pickup library, but leave "Suspend holds" selection empty. 4. Press "Modify holds". => Note that hold is now unsuspended. 5. Apply this patch, start services again if needed. 6. Repeat steps from 2. to 4. => Note that hold is not suspended. => Confirm that suspending and unsuspending with and without suspend date still works as expected. Sponsored-by: Koha-Suomi Oy Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> 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=41438 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #190611|0 |1 is obsolete| | --- Comment #11 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 191511 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=191511&action=edit Bug 41438: (follow-up) Fix JavaScript validation issues This follow-up patch corrects two JavaScript issues in the batch modify holds form: 1. Fixes typo: 'suspened' -> 'suspended' on line 637 This typo prevented the suspended status check from working correctly when determining if any selected holds are suspended. 2. Fixes ineffective validation logic on line 643 When a suspend date is provided without explicitly setting the suspend status, the code now properly updates the form field value instead of just setting a local variable. Changes: - Old: new_suspend_status = 1; - New: $("#new_suspend_status").val("1"); This ensures that setting a suspend date automatically sets the suspend status to "Suspend" as intended, allowing the behavior to match the server-side logic. Test plan: 1. Navigate to Tools->Batch modify holds 2. Search for and select some holds 3. Set only a "Suspend until" date without changing "Suspend holds" 4. Click "Modify holds" 5. Verify the holds are suspended with the specified date 6. Confirm the form properly auto-selects "Suspend" when a date is provided Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41438 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41438 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #191510|0 |1 is obsolete| | --- Comment #12 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 191512 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=191512&action=edit Bug 41438: Do not always unsuspend holds when using batch modify holds tool If one modifies suspended holds e.g. changes their pickup library, holds are unsuspended. This happens due error in logic of checking if "Suspend holds" selection is empty. This patch fixes this by moving the if statement for checking new suspended status before doing anything else for the value. To reproduce: 1. Navigate to Tools->Batch modify holds. 2. Search suspended holds. 3. Select a hold to modify and change it's pickup library, but leave "Suspend holds" selection empty. 4. Press "Modify holds". => Note that hold is now unsuspended. 5. Apply this patch, start services again if needed. 6. Repeat steps from 2. to 4. => Note that hold is not suspended. => Confirm that suspending and unsuspending with and without suspend date still works as expected. Sponsored-by: Koha-Suomi Oy Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41438 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #191511|0 |1 is obsolete| | --- Comment #13 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 191513 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=191513&action=edit Bug 41438: (follow-up) Fix JavaScript validation issues This follow-up patch corrects two JavaScript issues in the batch modify holds form: 1. Fixes typo: 'suspened' -> 'suspended' on line 637 This typo prevented the suspended status check from working correctly when determining if any selected holds are suspended. 2. Fixes ineffective validation logic on line 643 When a suspend date is provided without explicitly setting the suspend status, the code now properly updates the form field value instead of just setting a local variable. Changes: - Old: new_suspend_status = 1; - New: $("#new_suspend_status").val("1"); This ensures that setting a suspend date automatically sets the suspend status to "Suspend" as intended, allowing the behavior to match the server-side logic. Test plan: 1. Navigate to Tools->Batch modify holds 2. Search for and select some holds 3. Set only a "Suspend until" date without changing "Suspend holds" 4. Click "Modify holds" 5. Verify the holds are suspended with the specified date 6. Confirm the form properly auto-selects "Suspend" when a date is provided Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41438 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_25_11_candidate | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41438 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rel_25_11_candidate -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41438 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |26.05.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41438 --- Comment #14 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Nice work everyone! Pushed to main for 26.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41438 Jacob O'Mara <jacob.omara@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Pushed to stable Version(s)|26.05.00 |26.05.00,25.11.02 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41438 --- Comment #15 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Thanks all, pushed to 25.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41438 Laura Escamilla <Laura.escamilla@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_25_11_candidate | CC| |Laura.escamilla@bywatersolu | |tions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41438 Laura Escamilla <Laura.escamilla@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Needs documenting --- Comment #16 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- I am not backporting this as it does not apply cleanly to 25.05.x and would require additional adjustments specific to that branch. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org