[Bug 16949] New: Batch record deletion says success when no records have been passed in
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16949 Bug ID: 16949 Summary: Batch record deletion says success when no records have been passed in Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Tools Assignee: gmcharlt@gmail.com Reporter: aleishaamohia@hotmail.com QA Contact: testopia@bugs.koha-community.org To reproduce: 1) Go to Tools -> Batch record deletion 2) Put in a record number and click Continue 3) Deselect the record so that it doesn't actually delete and click Delete selected records 4) Page says All records have been deleted successfully! --> Error -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16949 Aleisha Amohia <aleishaamohia@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16949 --- Comment #1 from Aleisha Amohia <aleishaamohia@hotmail.com> --- Created attachment 53540 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=53540&action=edit Bug 16949: Batch record deletion says success when no records have been passed in The reason this happens is because the page will say success when the total number of records given equals the total number of successful deletions. If you pass in no records, there are no successful deletions --> 0 = 0 --> it thinks it has been successful. This patch adds a check that, firstly, there were records to delete. To test: 1) Go to Tools -> Batch record deletion 2) Put in a record number and click Continue 3) Deselect the record so that it doesn't actually delete and click Delete selected records 4) Page says 'All records have been deleted successfully!' 5) Apply patch and refresh page. You may have to go back and resend the form 6) Page should now correctly say 'No record has been deleted. An error occurred.' Sponsored-by: Catalyst IT -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16949 Aleisha Amohia <aleishaamohia@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|gmcharlt@gmail.com |aleishaamohia@hotmail.com Change sponsored?|--- |Sponsored -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16949 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |veron@veron.ch --- Comment #2 from Marc Véron <veron@veron.ch> --- Hi Aleisha, What do you think about having a different message if no record is selected? Maybe something like: (...) [% ELSIF op == 'report' %] [% IF report.total_records == 0 %] No records were selected for deletion! [% ELSIF report.total_records == report.total_success %] All records have been deleted successfully! [% ELSIF report.total_success == 0 %] No record has been deleted. An error occurred. [% ELSE %] (...) Marc -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16949 --- Comment #3 from Marc Véron <veron@veron.ch> --- (In reply to Marc Véron from comment #2)
Hi Aleisha,
What do you think about having a different message if no record is selected?
Maybe something like: (...) [% ELSIF op == 'report' %] [% IF report.total_records == 0 %] No records were selected for deletion! [% ELSIF report.total_records == report.total_success %] All records have been deleted successfully! [% ELSIF report.total_success == 0 %] No record has been deleted. An error occurred. [% ELSE %] (...)
Marc
...and maybe an additional link back to the previous screen to give the opportunity to select records. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16949 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=16948 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16949 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #4 from Owen Leonard <oleonard@myacpl.org> --- I think a client-side check is also in order: Don't submit the form if no titles are checked. That's standard for similar interfaces in Koha. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16949 --- Comment #5 from Aleisha Amohia <aleishaamohia@hotmail.com> --- (In reply to Marc Véron from comment #3)
...and maybe an additional link back to the previous screen to give the opportunity to select records.
There is already a link there that says 'New batch record deletion' after the form has been submitted. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16949 Aleisha Amohia <aleishaamohia@hotmail.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=16949 Aleisha Amohia <aleishaamohia@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #53540|0 |1 is obsolete| | --- Comment #6 from Aleisha Amohia <aleishaamohia@hotmail.com> --- Created attachment 53792 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=53792&action=edit Bug 16949: Batch record deletion says success when no records have been passed in The reason this happens is because the page will say success when the total number of records given equals the total number of successful deletions. If you pass in no records, there are no successful deletions --> 0 = 0 --> it thinks it has been successful. This patch adds a check that validates if any checkboxes were selected before submitting the final form. I have removed the check for if any records were selected AFTER the form has been submitted because it seemed unnecessary if the form can't be submitted without selection of records anyway. To test: 1) Go to Tools -> Batch record deletion 2) Put in a record number and click Continue 3) Deselect the record so that it doesn't actually delete and click Delete selected records 4) Page says 'All records have been deleted successfully!' 5) Apply patch. Go back and repeat step 3 6) Form should not submit and you should receive an alert saying that no records have been selected. Sponsored-by: Catalyst IT -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16949 --- Comment #7 from Marc Véron <veron@veron.ch> --- Hi ALeisha, I applied the patch, cleared the browser cache and tested. Now I get always "No records have been selected" (with or withot items selected in checkboxes). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16949 Aleisha Amohia <aleishaamohia@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #53792|0 |1 is obsolete| | --- Comment #8 from Aleisha Amohia <aleishaamohia@hotmail.com> --- Created attachment 53870 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=53870&action=edit Bug 16949: Batch record deletion says success when no records have been passed in The reason this happens is because the page will say success when the total number of records given equals the total number of successful deletions. If you pass in no records, there are no successful deletions --> 0 = 0 --> it thinks it has been successful. This patch adds a check that validates if any checkboxes were selected before submitting the final form. I have removed the check for if any records were selected AFTER the form has been submitted because it seemed unnecessary if the form can't be submitted without selection of records anyway. To test: 1) Go to Tools -> Batch record deletion 2) Put in a record number and click Continue 3) Deselect the record so that it doesn't actually delete and click Delete selected records 4) Page says 'All records have been deleted successfully!' 5) Apply patch. Go back and repeat step 3 6) Form should not submit and you should receive an alert saying that no records have been selected. 7) If you try selecting and deleting a record after this alert, it should still work Note: Have also changed the wording of error in Step 1 when you are entering record numbers to delete. Sponsored-by: Catalyst IT -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16949 --- Comment #9 from Marc Véron <veron@veron.ch> --- Created attachment 54127 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=54127&action=edit Can not proceed even if items selected Re-tested, I still can not proceed with items selected, see screenshot. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16949 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16949 Aleisha Amohia <aleishaamohia@hotmail.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=16949 Aleisha Amohia <aleishaamohia@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #53870|0 |1 is obsolete| | --- Comment #10 from Aleisha Amohia <aleishaamohia@hotmail.com> --- Created attachment 54901 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=54901&action=edit Bug 16949: Batch record deletion says success when no records have been passed in The reason this happens is because the page will say success when the total number of records given equals the total number of successful deletions. If you pass in no records, there are no successful deletions --> 0 = 0 --> it thinks it has been successful. This patch adds a check that validates if any checkboxes were selected before submitting the final form. I have removed the check for if any records were selected AFTER the form has been submitted because it seemed unnecessary if the form can't be submitted without selection of records anyway. To test: 1) Go to Tools -> Batch record deletion 2) Put in a record number and click Continue 3) Deselect the record so that it doesn't actually delete and click Delete selected records 4) Page says 'All records have been deleted successfully!' 5) Apply patch. Go back and repeat step 3 6) Form should not submit and you should receive an alert saying that no records have been selected. 7) If you try selecting and deleting a record after this alert, it should still work Note: Have also changed the wording of error in Step 1 when you are entering record numbers to delete. Sponsored-by: Catalyst IT -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16949 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch 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=16949 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #54901|0 |1 is obsolete| | --- Comment #11 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 55438 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=55438&action=edit [SIGNED-OFF] Bug 16949: Batch record deletion says success when no records have been passed in The reason this happens is because the page will say success when the total number of records given equals the total number of successful deletions. If you pass in no records, there are no successful deletions --> 0 = 0 --> it thinks it has been successful. This patch adds a check that validates if any checkboxes were selected before submitting the final form. I have removed the check for if any records were selected AFTER the form has been submitted because it seemed unnecessary if the form can't be submitted without selection of records anyway. To test: 1) Go to Tools -> Batch record deletion 2) Put in a record number and click Continue 3) Deselect the record so that it doesn't actually delete and click Delete selected records 4) Page says 'All records have been deleted successfully!' 5) Apply patch. Go back and repeat step 3 6) Form should not submit and you should receive an alert saying that no records have been selected. 7) If you try selecting and deleting a record after this alert, it should still work Note: Have also changed the wording of error in Step 1 when you are entering record numbers to delete. Sponsored-by: Catalyst IT Signed-off-by: Owen Leonard <oleonard@myacpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16949 Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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=16949 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #55438|0 |1 is obsolete| | --- Comment #12 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 55514 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=55514&action=edit Bug 16949: Batch record deletion says success when no records have been passed in The reason this happens is because the page will say success when the total number of records given equals the total number of successful deletions. If you pass in no records, there are no successful deletions --> 0 = 0 --> it thinks it has been successful. This patch adds a check that validates if any checkboxes were selected before submitting the final form. I have removed the check for if any records were selected AFTER the form has been submitted because it seemed unnecessary if the form can't be submitted without selection of records anyway. To test: 1) Go to Tools -> Batch record deletion 2) Put in a record number and click Continue 3) Deselect the record so that it doesn't actually delete and click Delete selected records 4) Page says 'All records have been deleted successfully!' 5) Apply patch. Go back and repeat step 3 6) Form should not submit and you should receive an alert saying that no records have been selected. 7) If you try selecting and deleting a record after this alert, it should still work Note: Have also changed the wording of error in Step 1 when you are entering record numbers to delete. Sponsored-by: Catalyst IT Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16949 --- Comment #13 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 55515 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=55515&action=edit Bug 16949: Simplify the checkbox checked condition It's easier to use jQuery selector to know if checkboxes are checked. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16949 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |kyle@bywatersolutions.com --- Comment #14 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to master for 16.11, thanks Aleisha, Jonathan! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16949 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de Severity|enhancement |minor -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org