Bugzilla – Attachment 53870 Details for
Bug 16949
Batch record deletion says success when no records have been passed in
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16949: Batch record deletion says success when no records have been passed in
Bug-16949-Batch-record-deletion-says-success-when-.patch (text/plain), 2.69 KB, created by
Aleisha Amohia
on 2016-08-02 04:07:50 UTC
(
hide
)
Description:
Bug 16949: Batch record deletion says success when no records have been passed in
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2016-08-02 04:07:50 UTC
Size:
2.69 KB
patch
obsolete
>From 45739760dde4a92c188a1a736d4440cd4be63046 Mon Sep 17 00:00:00 2001 >From: Aleisha <aleishaamohia@hotmail.com> >Date: Wed, 20 Jul 2016 22:14:05 +0000 >Subject: [PATCH] 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 >--- > .../prog/en/modules/tools/batch_delete_records.tt | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt >index 6f6f58a..e0d4427 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt >@@ -60,6 +60,15 @@ $(document).ready(function() { > "aaSorting": [], > "bPaginate": false > })); >+ >+ var $selectForm = $('#selectrecords'); >+ var $checkbox = $('#record_id'); >+ $selectForm.on('submit', function(e) { >+ if(!$checkbox.is(':checked')){ >+ alert("No records have been selected."); >+ e.preventDefault(); >+ } >+ }); > }); > //]]> > </script> >@@ -150,7 +159,7 @@ $(document).ready(function() { > | <a id="selectwithoutitems" href="#">Select without items</a> > | <a id="selectnotreserved" href="#">Select without holds</a> > </div> >- <form action="/cgi-bin/koha/tools/batch_delete_records.pl" method="post"> >+ <form action="/cgi-bin/koha/tools/batch_delete_records.pl" method="post" id="selectrecords"> > <table id="biblios" class="records"> > <thead> > <tr> >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 16949
:
53540
|
53792
|
53870
|
54127
|
54901
|
55438
|
55514
|
55515