@@ -, +, @@ --- C4/Circulation.pm | 1 + t/Circulation/AgeRestrictionMarkers.t | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) --- a/C4/Circulation.pm +++ a/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; --- a/t/Circulation/AgeRestrictionMarkers.t +++ a/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) = @_; --