Bugzilla – Attachment 97315 Details for
Bug 24361
Fix warnings (or failing tests) from bug 24217
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24361: Remove warning from GetAgeRestriction
Bug-24361-Remove-warning-from-GetAgeRestriction.patch (text/plain), 1.72 KB, created by
Jonathan Druart
on 2020-01-13 14:36:42 UTC
(
hide
)
Description:
Bug 24361: Remove warning from GetAgeRestriction
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-01-13 14:36:42 UTC
Size:
1.72 KB
patch
obsolete
>From e1713cbd9083192cf8ca4504ceefcf359359d1dc Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 13 Jan 2020 15:35:57 +0100 >Subject: [PATCH] Bug 24361: Remove warning from GetAgeRestriction > >Use of uninitialized value $record_restrictions in uc at /kohadevbox/koha/C4/Circulation.pm line 3981 >--- > C4/Circulation.pm | 1 + > t/Circulation/AgeRestrictionMarkers.t | 13 ++++++++++++- > 2 files changed, 13 insertions(+), 1 deletion(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index d2506275e3..c3629c2472 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -3977,6 +3977,7 @@ sub GetAgeRestriction { > my ($record_restrictions, $borrower) = @_; > my $markers = C4::Context->preference('AgeRestrictionMarker'); > >+ return unless $record_restrictions; > # Split $record_restrictions to something like FSK 16 or PEGI 6 > my @values = split ' ', uc($record_restrictions); > return unless @values; >diff --git a/t/Circulation/AgeRestrictionMarkers.t b/t/Circulation/AgeRestrictionMarkers.t >index 49c1d14444..e6d335ee23 100644 >--- a/t/Circulation/AgeRestrictionMarkers.t >+++ b/t/Circulation/AgeRestrictionMarkers.t >@@ -21,7 +21,8 @@ > use Modern::Perl; > > use DateTime; >-use Test::More tests => 7; >+use Test::More tests => 8; >+use Test::Warn; > > use t::lib::Mocks; > >@@ -64,6 +65,16 @@ subtest 'Patron tests - 15 years old (Time Zone shifts)' => sub { > } > }; > >+subtest 'No age restriction' => sub { >+ plan tests => 1; >+ >+ warning_is { >+ C4::Circulation::GetAgeRestriction(); >+ } >+ undef, "No warning if GetAgeRestriction is called without restriction"; >+ >+}; >+ > # The Patron tests > sub TestPatron { > my ($borrower,$offset) = @_; >-- >2.11.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 24361
:
96873
|
96892
|
96969
| 97315 |
97991
|
98796