Bug 19074 - Show patron category description instead of code in patron batch modification list
Summary: Show patron category description instead of code in patron batch modification...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Alex Sassmannshausen
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-10 10:00 UTC by Katrin Fischer
Modified: 2018-12-03 20:03 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 19074: bugfix: Dereference correct value from Koha::Object. (1.37 KB, patch)
2017-08-10 11:05 UTC, Alex Sassmannshausen
Details | Diff | Splinter Review
Bug 19074: Fix category display in Batch patron modification. (2.52 KB, patch)
2017-08-10 11:36 UTC, Alex Sassmannshausen
Details | Diff | Splinter Review
[SIGNED OFF] Bug 19074: Fix category display in Batch patron modification. (2.57 KB, patch)
2017-08-10 11:59 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 19074: Fix category display in Batch patron modification. (2.64 KB, patch)
2017-08-10 18:22 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 19074: Do not crash if cardnumber does not exist (1.78 KB, patch)
2017-08-10 18:22 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2017-08-10 10:00:58 UTC
When editing mulitple patrons unsing the patron batch modification tool, the list of patrons shows the patron category code instead of the patron category description.

As the pull down below has the description, this can be quite confusing to some users and makes it harder to verify the correct results.
Comment 1 Alex Sassmannshausen 2017-08-10 11:05:24 UTC
Created attachment 65798 [details] [review]
Bug 19074: bugfix: Dereference correct value from Koha::Object.

* tools/modborrowers.pl: Dereference 'branchcode' rather than
  'value'.

Test Plan:
- Carry out "Batch patron modification" with any number of patrons.
  + Change the library.
  + Hit Save.
- The library will not have been updated.
- Apply patch.
- Run same modification.
- The library will have been updated
Comment 2 Alex Sassmannshausen 2017-08-10 11:08:46 UTC
Accidentally uploaded patch to wrong bug.

Alex
Comment 3 Alex Sassmannshausen 2017-08-10 11:36:09 UTC
Created attachment 65800 [details] [review]
Bug 19074: Fix category display in Batch patron modification.

* tools/modborrowers.pl (GetBorrowerInfos): Fix setting of patron
  category description.
* koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt: Use
  it.
Comment 4 Alex Sassmannshausen 2017-08-10 11:36:56 UTC
(In reply to Alex Sassmannshausen from comment #3)
> Created attachment 65800 [details] [review] [review]
> Bug 19074: Fix category display in Batch patron modification.
> 
> * tools/modborrowers.pl (GetBorrowerInfos): Fix setting of patron
>   category description.
> * koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt: Use
>   it.

Test Plan:
- Check that patron categories display in a human friendly way throughout batch modification tool.
Comment 5 Katrin Fischer 2017-08-10 11:59:14 UTC
Created attachment 65806 [details] [review]
[SIGNED OFF] Bug 19074: Fix category display in Batch patron modification.

* tools/modborrowers.pl (GetBorrowerInfos): Fix setting of patron
  category description.
* koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt: Use
  it.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Jonathan Druart 2017-08-10 18:22:20 UTC
Created attachment 65839 [details] [review]
Bug 19074: Fix category display in Batch patron modification.

* tools/modborrowers.pl (GetBorrowerInfos): Fix setting of patron
  category description.
* koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt: Use
  it.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 7 Jonathan Druart 2017-08-10 18:22:25 UTC
Created attachment 65840 [details] [review]
Bug 19074: Do not crash if cardnumber does not exist

If a cardnumber does not exist, $borrower will be undef and the ->category call will explode
Can't call method "category" on an undefined value at
/home/vagrant/kohaclone/tools/modborrowers.pl line 370.

This patch makes sure the patron exists before calling any methods.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Jonathan Druart 2017-08-10 19:32:52 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 9 Fridolin Somers 2017-09-29 09:40:40 UTC
Patch does not apply on 17.05.x because of Bug 17829.

Since this is a minor, I propose to set as resolved.