Bug 14632 - Incorrect alert while deleting single item in batch
Summary: Incorrect alert while deleting single item in batch
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Indranil Das Gupta
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on: 14676
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-03 02:14 UTC by Indranil Das Gupta
Modified: 2017-06-14 22:05 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 14632 - Fix alert message for single item batch (2.86 KB, patch)
2015-08-03 04:39 UTC, Indranil Das Gupta
Details | Diff | Splinter Review
Bug 14632 - Fix alert message for single item batch (2.97 KB, patch)
2015-11-03 12:30 UTC, Frédéric Demians
Details | Diff | Splinter Review
[PASSED QA] Bug 14632 - Fix alert message for single item batch (3.03 KB, patch)
2015-11-06 14:26 UTC, Kyle M Hall
Details | Diff | Splinter Review
[PASSED QA] Bug 14632 - Fix alert message for single item batch (3.03 KB, patch)
2015-11-06 14:27 UTC, Kyle M Hall
Details | Diff | Splinter Review
[PASSED QA] Bug 14632 [QA Followup] - Restore missing "Delete batch" button. (1.74 KB, patch)
2015-11-06 14:28 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Indranil Das Gupta 2015-08-03 02:14:28 UTC
In "Manage patron card batches", the user is prevented from deleting the items from a single item batch as that would remove the entry from table creator_batches effectively deleting the batch. 

However, the JS alert's message reads as "Please select at least label to delete.". This is incorrect as one item is already selected.
Comment 1 Indranil Das Gupta 2015-08-03 04:23:09 UTC
(In reply to Indranil Das Gupta from comment #0)> 
> However, the JS alert's message reads as "Please select at least label to
> delete.". This is incorrect as one item is already selected.

The function Remove() checks for document.items.action.length > 0. In cases of batches with only a single item / patron, this test fails.
Comment 2 Indranil Das Gupta 2015-08-03 04:39:38 UTC Comment hidden (obsolete)
Comment 3 Frédéric Demians 2015-11-03 12:30:02 UTC Comment hidden (obsolete)
Comment 4 Kyle M Hall 2015-11-06 14:26:21 UTC Comment hidden (obsolete)
Comment 5 Kyle M Hall 2015-11-06 14:27:24 UTC
Created attachment 44565 [details] [review]
[PASSED QA] Bug 14632 - Fix alert message for single item batch

Fixes the incorrect msg "Please select at least label to delete."
for attempts to delete from single patron batches. Notifies the
user that doing so will delete the batch. It disallows direct
deletion, instead suggests the users to use the 'Delete batch'
option assuming the users know what they are doing.

Test plan
=========

1/ Load a single patron batch in edit mode and attempt to delete
   the single record. The JS alert message will inform that "Please
   select at least label to delete."
2/ Apply patch and refresh page and try to delete the single record
   again.
3/ This time the alert will inform the user that doing so will delete
   the batch and should that be desired action to choose the 'Delete
   batch' option from the toolbar.

Signed-off-by: Frederic Demians <f.demians@tamil.fr>
  It works as before but with an understantable warning message.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 6 Kyle M Hall 2015-11-06 14:28:28 UTC
Created attachment 44566 [details] [review]
[PASSED QA] Bug 14632 [QA Followup] - Restore missing "Delete batch" button.

This button was removed by accident in bug 14676

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 7 Kyle M Hall 2015-11-06 14:29:09 UTC
Upping severity due to missing "Delete batch" button. Patch could be split into a separate bug if need be.
Comment 8 Tomás Cohen Arazi 2015-11-06 15:13:22 UTC
Patches pushed to master.

Thanks Indranil and Kyle!
Comment 9 Frédéric Demians 2015-11-29 20:27:20 UTC
This patch has been pushed to 3.20.x, will be in 3.20.6. (1st patch but not the followup.)
Comment 10 Liz Rea 2016-01-06 21:05:57 UTC
Pushed to 3.18.13, and released.