Bug 17555 - Add Koha::Patron->category
Summary: Add Koha::Patron->category
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 17556 17578 17604
  Show dependency treegraph
 
Reported: 2016-11-04 15:17 UTC by Jonathan Druart
Modified: 2017-06-14 22:10 UTC (History)
4 users (show)

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


Attachments
Bug 17555: Add Koha::Patron->category (3.23 KB, patch)
2016-11-04 15:22 UTC, Jonathan Druart
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 17555: Add Koha::Patron->category (3.30 KB, patch)
2016-11-04 19:27 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 17555: Add Koha::Patron->category (3.34 KB, patch)
2016-11-15 15:13 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 Jonathan Druart 2016-11-04 15:17:07 UTC
We need to use the DBIx::Class relationship to retrieve the patron category.
It will be more convenient to have a Koha::Patron->category method to retrieve the category of a given patron.
Comment 1 Jonathan Druart 2016-11-04 15:22:03 UTC
Created attachment 57211 [details] [review]
Bug 17555: Add Koha::Patron->category

We need to use the DBIx::Class relationship to retrieve the patron
category.
It is more convenient to have a Koha::Patron->category method to
retrieve the category of a given patron.

Test plan:
Make sure that the tests in t/db_dependent/Koha/Patron* return green
Comment 2 Jonathan Druart 2016-11-04 15:22:40 UTC
(In reply to Jonathan Druart from comment #1)
> Test plan:
> Make sure that the tests in t/db_dependent/Koha/Patron* return green

Note that t/db_dependent/Koha/Patron/Messages.t is broken in master.
Comment 3 Josef Moravec 2016-11-04 19:27:59 UTC
Created attachment 57224 [details] [review]
[SIGNED-OFF] Bug 17555: Add Koha::Patron->category

We need to use the DBIx::Class relationship to retrieve the patron
category.
It is more convenient to have a Koha::Patron->category method to
retrieve the category of a given patron.

Test plan:
Make sure that the tests in t/db_dependent/Koha/Patron* return green

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 4 Josef Moravec 2016-11-04 19:29:14 UTC
With combination of 1st patch from 17558 also Messages.t pass...
Comment 5 Tomás Cohen Arazi 2016-11-12 03:29:09 UTC
Why do u use Koha::Patron::Category->_new_from_dbic instead of Koha::Patron::Categories->find($self->categorycode)?
Comment 6 Jonathan Druart 2016-11-12 08:11:18 UTC
(In reply to Tomás Cohen Arazi from comment #5)
> Why do u use Koha::Patron::Category->_new_from_dbic instead of
> Koha::Patron::Categories->find($self->categorycode)?

Because we want to use the DBIx::Class relationship
Comment 7 Kyle M Hall 2016-11-15 15:13:21 UTC
Created attachment 57495 [details] [review]
Bug 17555: Add Koha::Patron->category

We need to use the DBIx::Class relationship to retrieve the patron
category.
It is more convenient to have a Koha::Patron->category method to
retrieve the category of a given patron.

Test plan:
Make sure that the tests in t/db_dependent/Koha/Patron* return green

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 8 Kyle M Hall 2016-11-15 15:14:14 UTC
Pushed to master for 16.11, thanks Jonathan!
Comment 9 Mason James 2016-11-30 11:53:23 UTC
enhancement, passing for 16.05