[Koha-bugs] [Bug 25089] Add checkout_type to circulation rules

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Apr 23 08:42:19 CEST 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25089

Lari Taskula <lari.taskula at hypernova.fi> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #103358|0                           |1
        is obsolete|                            |

--- Comment #59 from Lari Taskula <lari.taskula at hypernova.fi> ---
Created attachment 103544
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=103544&action=edit
Bug 25089: Add checkout_type to get_effective_rule

To test:
1. Find all occurrences of get_effective_rule that are missing
   checkout_type where required

grep --exclude-dir '.git' --exclude-dir 'misc/translator' \
--exclude-dir 'koha-tmpl' \
-Przo '(?s)(::|->)get_effective_rule(?!s).*?\)' | \
grep -avz 'checkout_type' | \
grep -Pavz 'hold|reserves|article_requests' && echo ""

   The only occasions this should return anything are cases where
   a HASH or HASHref is given to get_effective_rule(), or that we
   are explicitly testing missing parameters in an unit test.

   1.2 Verify the HASH/HASHref cases. The hash should contain
       a checkout_type (unless the rule is related to holds)

   1.3 Verify the other cases. If you find another result than
       what is mentioned above, then this test fails.

2. Find all subroutines using get_effective_rule()

git grep --no-index -n -p -P 'get_effective_rule\s*\(' \
| grep -v 'sub {' | grep -P 'sub .*'

    This list should be returned:

    C4/Circulation.pm=376=sub TooMany {
    C4/Circulation.pm=1300=sub AddIssue {
    C4/Circulation.pm=1633=sub GetBranchBorrowerCircRule {
    C4/Circulation.pm=1689=sub GetBranchItemRule {
    C4/Circulation.pm=3030=sub GetRenewCount {
    C4/Reserves.pm=348=sub CanItemBeReserved {
    C4/Reserves.pm=2230=sub GetHoldRule {
    Koha/Biblio.pm=294=sub article_request_type_for_bib {
    Koha/Charges/Fees.pm=98=sub accumulate_rentalcharge {
    Koha/CirculationRules.pm=218=sub get_effective_rules {
    Koha/CirculationRules.pm=390=sub get_opacitemholds_policy {
    Koha/CirculationRules.pm=416=sub get_onshelfholds_policy {
    Koha/Item.pm=571=sub article_request_type {
    Koha/REST/V1/Checkouts.pm=192=sub allows_renewal {
    Koha/Template/Plugin/CirculationRules.pm=26=sub Get {

    Check these subroutines and make sure they are using
    get_effective_rule() with the new scope, unless not needed.
    When fetching a hold-related rules, checkout_type is not needed.

    These subroutines and classes need changes to sub params:

    2.1. Check modifications to Koha::Charges::Fees
    2.2. Check modification made to C4::Circulation::_debar_user_on_return().
    2.3. Check modification made to C4::Circulation::_calculate_new_debar_dt().

3. Find all occurrences of get_effective_rule with the following command:
      grep --exclude-dir='.git' -Prn 'get_effective_rule(?!s)'

    Make sure all matches (where rule scope allows checkout_type) are
    updated.

Sponsored-by: The National Library of Finland

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


More information about the Koha-bugs mailing list