Summary: | Patron card creator "Remove duplicates" function doesn't work | ||
---|---|---|---|
Product: | Koha | Reporter: | Owen Leonard <oleonard> |
Component: | Tools | Assignee: | Chris Nighswonger <cnighswonger> |
Status: | CLOSED FIXED | QA Contact: | Jonathan Druart <jonathan.druart> |
Severity: | major | ||
Priority: | P5 - low | CC: | chris, jonathan.druart |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Proposed Fix
[SIGNED-OFF] Bug 9535 - Patron card creator "Remove duplicates" function doesn't work Bug 9535 - Patron card creator "Remove duplicates" function doesn't work |
Description
Owen Leonard
2013-02-02 18:23:21 UTC
Upping severity a bit - this is a quite annoying bug! I won't have time to work up a patch until later next week, but here's the fix: C4::Creators::Batch line 202 should read as follows: my @duplicate_items = grep{$_->{'item_number'} ? $seen{$_->{'item_number'}}++ : $seen{$_->{'borrower_number'}}++} @{$self->{'items'}}; Created attachment 17130 [details] [review] Proposed Fix Created attachment 17132 [details] [review] [SIGNED-OFF] Bug 9535 - Patron card creator "Remove duplicates" function doesn't work This bug was due to a difference in field names used in the item data for items versus patrons. This patch adds a ternary to discern between the two. To test: Before applying patch: 1. Create a batch of patroncards with one duplicate. 2. Run the de-duplication on the batch. 3. Note that all patrons beyond the first in the batch are now deleted. After applying patch: 4. Repeat steps 1-2. 5. Note that only the duplicate patron is removed. Signed-off-by: Chris Nighswonger <cnighswonger@foundations.edu> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Tested successfully with both patron card batches and label batches. QA comment: Works great. With the patch, I added some duplicates, clicked on the "Remove duplicates" button and the deduplication works as expected. Marked as Passed QA. Created attachment 17161 [details] [review] Bug 9535 - Patron card creator "Remove duplicates" function doesn't work This bug was due to a difference in field names used in the item data for items versus patrons. This patch adds a ternary to discern between the two. To test: Before applying patch: 1. Create a batch of patroncards with one duplicate. 2. Run the de-duplication on the batch. 3. Note that all patrons beyond the first in the batch are now deleted. After applying patch: 4. Repeat steps 1-2. 5. Note that only the duplicate patron is removed. Signed-off-by: Chris Nighswonger <cnighswonger@foundations.edu> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Tested successfully with both patron card batches and label batches. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Add indentation for readability This patch has been pushed to master. Pushed to 3.10.x and 3.8.x will be in 3.10.5 and 3.8.12 |