Bugzilla – Attachment 56349 Details for
Bug 5670
Housebound Readers Module
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 5670: [Followup] Return Koha::Patron objects.
Bug-5670-Followup-Return-KohaPatron-objects.patch (text/plain), 2.38 KB, created by
Claire Gravely
on 2016-10-13 11:45:50 UTC
(
hide
)
Description:
Bug 5670: [Followup] Return Koha::Patron objects.
Filename:
MIME Type:
Creator:
Claire Gravely
Created:
2016-10-13 11:45:50 UTC
Size:
2.38 KB
patch
obsolete
>From 166e51a349ccc5243e7ecf5d05993960e7d2853e Mon Sep 17 00:00:00 2001 >From: Alex Sassmannshausen <alex.sassmannshausen@ptfs-europe.com> >Date: Thu, 8 Sep 2016 12:10:45 +0200 >Subject: [PATCH] Bug 5670: [Followup] Return Koha::Patron objects. > >* Koha/Patron/HouseboundVisit.pm (chooser, deliverer): Use > `_new_from_dbic` to return Koha::Patron objects. >* t/db_dependent/Patron/HouseboundVisits.t: Remove TODO section for this. > >Signed-off-by: Claire Gravely <claire_gravely@hotmail.com> >--- > Koha/Patron/HouseboundVisit.pm | 7 +++++-- > t/db_dependent/Patron/HouseboundVisits.t | 7 ++----- > 2 files changed, 7 insertions(+), 7 deletions(-) > >diff --git a/Koha/Patron/HouseboundVisit.pm b/Koha/Patron/HouseboundVisit.pm >index a7dc0c6..b57effe 100644 >--- a/Koha/Patron/HouseboundVisit.pm >+++ b/Koha/Patron/HouseboundVisit.pm >@@ -18,6 +18,7 @@ package Koha::Patron::HouseboundVisit; > use Modern::Perl; > > use Koha::Database; >+use Koha::Patron; > > use base qw(Koha::Object); > >@@ -49,7 +50,8 @@ Returns the prefetched chooser for this visit. > > sub chooser { > my ( $self ) = @_; >- return $self->_result->chooser_brwnumber; >+ my $rs = $self->_result->chooser_brwnumber; >+ return Koha::Patron->_new_from_dbic( $rs ); > } > > =head3 deliverer >@@ -62,7 +64,8 @@ Returns the prefetched deliverer for this visit. > > sub deliverer { > my ( $self ) = @_; >- return $self->_result->deliverer_brwnumber; >+ my $rs = $self->_result->deliverer_brwnumber; >+ return Koha::Patron->_new_from_dbic( $rs ); > > } > >diff --git a/t/db_dependent/Patron/HouseboundVisits.t b/t/db_dependent/Patron/HouseboundVisits.t >index bec556c..e6f8245 100644 >--- a/t/db_dependent/Patron/HouseboundVisits.t >+++ b/t/db_dependent/Patron/HouseboundVisits.t >@@ -81,11 +81,8 @@ is( $result->deliverer->borrowernumber, $visit->{deliverer_brwnumber} ); > > is( $result->chooser->borrowernumber, $visit->{chooser_brwnumber} ); > >-TODO: { >- local $TODO = "We want our results here to be Koha::Patron objects, but they by default return DBIC Schema objects. The currently accepted solution to this (use the _from_dbic method), is defined for Koha::Objects, but not for Koha::Object. We do not resolve this issue here"; >- isa_ok( $result->deliverer, "Koha::Patron"); >- isa_ok( $result->chooser, "Koha::Patron"); >-} >+isa_ok( $result->deliverer, "Koha::Patron"); >+isa_ok( $result->chooser, "Koha::Patron"); > > $schema->storage->txn_rollback; > >-- >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 5670
:
3038
|
22162
|
22163
|
22164
|
22165
|
26816
|
27288
|
50930
|
51377
|
51875
|
54384
|
54385
|
55326
|
55334
|
55335
|
55336
|
55734
|
55735
|
55736
|
55737
|
55738
|
55739
|
55865
|
55866
|
55867
|
55890
|
55891
|
56298
|
56299
|
56300
|
56301
|
56302
|
56308
|
56337
|
56341
|
56346
|
56347
|
56348
|
56349
|
56350
|
56351
|
56352
|
56353
|
56354
|
56355
|
56356
|
56357
|
56358
|
56359
|
56360
|
56361
|
56362
|
56363
|
56364
|
56365
|
56366
|
56367
|
56368
|
56369
|
56580
|
56581
|
56582
|
56583
|
56584
|
56585
|
56586
|
56587
|
56588
|
56589
|
56590
|
56591
|
56592
|
56593
|
56594
|
56595
|
56596
|
56597
|
56598
|
56599
|
56600
|
56601
|
56602
|
56603
|
56604
|
56605
|
56606