[Koha-bugs] [Bug 13106] Encapsulate Circulation::GetAgeRestriction() and modify it to check borrowers age as well.

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Oct 20 17:00:16 CEST 2014


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13106

Marc Véron <veron at veron.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |veron at veron.ch

--- Comment #3 from Marc Véron <veron at veron.ch> ---
Hi Olli,

Great idea to encapsulate the age restriction.

I did not yet test, but I have the following remark:

In Circulation.pm, line 988 reads:
if ( $daysToAgeRestriction ) 
(...)

Negative days mean the borrower has gone past the age restriction age. But a
negative value would evaluate to true and trigger the age restriction.
(see: http://www.foo.be/docs/tpj/issues/vol4_2/tpj0402-0002.html , rule 7)


I think the line should be something like 
if ( $daysToAgeRestriction > 0 ) 
or
if ( $daysToAgeRestriction >= 0 ) 

Oh, it seems that $daysToAgeRestriction is not always returned as a defined
value in sub GetAgeRestriction. (See Line 3807). Then maybe the comparision
should be something like:

if ( $daysToAgeRestriction && $daysToAgeRestriction > 0 ) 
or
if ( $daysToAgeRestriction && $daysToAgeRestriction >= 0 ) 

Marc

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list