Bugzilla – Attachment 172828 Details for
Bug 37204
Add a booking has changed notice to update a patron should a booking be updated
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37204: (QA follow-up) Consistently pick notice library
Bug-37204-QA-follow-up-Consistently-pick-notice-li.patch (text/plain), 3.39 KB, created by
Martin Renvoize (ashimema)
on 2024-10-16 15:51:12 UTC
(
hide
)
Description:
Bug 37204: (QA follow-up) Consistently pick notice library
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-10-16 15:51:12 UTC
Size:
3.39 KB
patch
obsolete
>From a7408bbf4ca1232b2ff726c1212f532db449dda1 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 16 Oct 2024 16:45:18 +0100 >Subject: [PATCH] Bug 37204: (QA follow-up) Consistently pick notice library > >We should use the notice from the library that initiated the action that >triggered the notice. This should be available to us always in the >userenv. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/Booking.pm | 6 ++++-- > t/db_dependent/Koha/Booking.t | 6 ++++-- > 2 files changed, 8 insertions(+), 4 deletions(-) > >diff --git a/Koha/Booking.pm b/Koha/Booking.pm >index f3376af918d..c849c07e9ec 100644 >--- a/Koha/Booking.pm >+++ b/Koha/Booking.pm >@@ -160,12 +160,13 @@ sub store { > { > my $patron = $self->patron; > my $pickup_library = $self->pickup_library; >+ my $branch = C4::Context->userenv->{'branch'}; > > my $letter = C4::Letters::GetPreparedLetter( > module => 'bookings', > letter_code => 'BOOKING_MODIFICATION', > message_transport_type => 'email', >- branchcode => $pickup_library->branchcode, >+ branchcode => $branch, > lang => $patron->lang, > objects => { > old_booking => $old_booking, >@@ -286,6 +287,7 @@ sub to_api_mapping { > sub delete { > my ($self) = @_; > >+ my $branch = C4::Context->userenv->{'branch'}; > my $patron = $self->patron; > my $pickup_library = $self->pickup_library; > >@@ -293,7 +295,7 @@ sub delete { > module => 'bookings', > letter_code => 'BOOKING_CANCELLATION', > message_transport_type => 'email', >- branchcode => $pickup_library->branchcode, >+ branchcode => $branch, > lang => $patron->lang, > objects => { booking => $self } > ); >diff --git a/t/db_dependent/Koha/Booking.t b/t/db_dependent/Koha/Booking.t >index 9eef67069d5..cfb9764a6eb 100755 >--- a/t/db_dependent/Koha/Booking.t >+++ b/t/db_dependent/Koha/Booking.t >@@ -126,7 +126,8 @@ subtest 'store() tests' => sub { > plan tests => 14; > $schema->storage->txn_begin; > >- my $patron = $builder->build_object( { class => "Koha::Patrons" } ); >+ my $patron = $builder->build_object( { class => "Koha::Patrons" } ); >+ t::lib::Mocks::mock_userenv( { patron => $patron } ); > my $biblio = $builder->build_sample_biblio(); > my $item_1 = $builder->build_sample_item( { biblionumber => $biblio->biblionumber } ); > my $start_0 = dt_from_string->subtract( days => 2 )->truncate( to => 'day' ); >@@ -412,7 +413,8 @@ subtest 'delete() tests' => sub { > > $schema->storage->txn_begin; > >- my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); >+ my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); >+ t::lib::Mocks::mock_userenv( { patron => $patron } ); > my $biblio = $builder->build_sample_biblio; > my $item_1 = $builder->build_sample_item( { biblionumber => $biblio->biblionumber } ); > my $start_0 = dt_from_string->subtract( days => 2 )->truncate( to => 'day' ); >-- >2.47.0
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 37204
:
170805
|
170939
|
172824
|
172825
|
172826
|
172827
|
172828
|
173283
|
173284
|
173285