Bugzilla – Attachment 58966 Details for
Bug 8361
Issuing rule if no rule is defined
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8361: Do not allow checkouts if no rules are defined
Bug-8361-Do-not-allow-checkouts-if-no-rules-are-de.patch (text/plain), 2.10 KB, created by
Nick Clemens (kidclamp)
on 2017-01-13 18:11:20 UTC
(
hide
)
Description:
Bug 8361: Do not allow checkouts if no rules are defined
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2017-01-13 18:11:20 UTC
Size:
2.10 KB
patch
obsolete
>From d144dee4db7f097ae0288ed0d73e0c977ad83b89 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 22 Nov 2016 11:23:23 +0000 >Subject: [PATCH] Bug 8361: Do not allow checkouts if no rules are defined > >We should require a circulation rule to allow checkouts and reject them >if no rules are defined. > >Test plan: >- Delete all issuing rules >- Check an item out >=> Without this patch the checkout is allowed >=> With this patch applied it is rejected > >Signed-off-by: Mark Tompsett <mtompset@hotmail.com> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > C4/Circulation.pm | 4 ++++ > t/db_dependent/Circulation/TooMany.t | 12 ++++++------ > 2 files changed, 10 insertions(+), 6 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 80ae062..aba983c 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -555,6 +555,10 @@ sub TooMany { > } > } > >+ if ( not defined( $issuing_rule ) and not defined($branch_borrower_circ_rule->{maxissueqty}) ) { >+ return { reason => 'NO_RULE_DEFINED', max_allowed => 0 }; >+ } >+ > # OK, the patron can issue !!! > return; > } >diff --git a/t/db_dependent/Circulation/TooMany.t b/t/db_dependent/Circulation/TooMany.t >index 0e129c3..428c08b 100644 >--- a/t/db_dependent/Circulation/TooMany.t >+++ b/t/db_dependent/Circulation/TooMany.t >@@ -92,15 +92,15 @@ C4::Context->set_userenv($patron->{borrowernumber}, $patron->{userid}, 'usercnum > > subtest 'no rules exist' => sub { > plan tests => 2; >- is( >+ is_deeply( > C4::Circulation::TooMany( $patron, $biblio->{biblionumber}, $item ), >- undef, >- 'CO should be allowed, in any cases' >+ { reason => 'NO_RULE_DEFINED', max_allowed => 0 }, >+ 'CO should not be allowed, in any cases' > ); >- is( >+ is_deeply( > C4::Circulation::TooMany( $patron, $biblio->{biblionumber}, $item, { onsite_checkout => 1 } ), >- undef, >- 'OSCO should be allowed, in any cases' >+ { reason => 'NO_RULE_DEFINED', max_allowed => 0 }, >+ 'OSCO should not be allowed, in any cases' > ); > }; > >-- >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 8361
:
57704
|
57717
| 58966 |
58967
|
59086
|
59087