[koha-commits] main Koha release repository branch 20.05.x updated. v20.05.03-41-geef685ee19

Git repo owner gitmaster at git.koha-community.org
Fri Sep 4 20:23:21 CEST 2020


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "main Koha release repository".

The branch, 20.05.x has been updated
       via  eef685ee19e81ea50c90863634922ad62ea6cd1f (commit)
       via  b1b018e04aeff8b59c2707ab28388002150ae65f (commit)
       via  2d741d4d7158eff6dbeaf64bfc7e1fd9db9458a1 (commit)
       via  13c5c4d85e8aaf57e511f037cb4e5de32066eebf (commit)
       via  a831c288da603f022a9894d560ed542e69feb5e3 (commit)
      from  afd9828ba357fcbd16973c8e84a8a170eaf053ba (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit eef685ee19e81ea50c90863634922ad62ea6cd1f
Author: Andrew Nugged <nugged at gmail.com>
Date:   Mon Jul 20 00:16:51 2020 +0300

    Bug 24683: IsAvailableForItemLevelRequest sub description expanded
    
    Signed-off-by: Agustin Moyano <agustinmoyano at theke.io>
    
    Signed-off-by: Katrin Fischer <katrin.fischer.83 at web.de>
    
    Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
    (cherry picked from commit d19e76000f02533302d8093e051cf3a0034d1e27)
    
    Signed-off-by: Lucas Gass <lucas at bywatersolutions.com>

commit b1b018e04aeff8b59c2707ab28388002150ae65f
Author: Andrew Nugged <nugged at gmail.com>
Date:   Mon Jul 20 00:15:37 2020 +0300

    Bug 24683: whole test formatted by 'perltidy'
    
    This is complementary patch using styling from
    bundled /xt/perltidyrc file
    
    Almost no code change except a few long constant strings
    broken to parts by concatenation.
    
    Signed-off-by: Agustin Moyano <agustinmoyano at theke.io>
    
    Signed-off-by: Katrin Fischer <katrin.fischer.83 at web.de>
    
    Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
    (cherry picked from commit 3c4f475d1a4e64e8e437e9b4906af9cba6c0756f)
    
    Signed-off-by: Lucas Gass <lucas at bywatersolutions.com>

commit 2d741d4d7158eff6dbeaf64bfc7e1fd9db9458a1
Author: Andrew Nugged <nugged at gmail.com>
Date:   Mon Jul 20 00:20:56 2020 +0300

    Bug 24683: Fix for take smart rules into account in "if all unavailable"
    
    Inside of ItemsAnyAvailableAndNotRestricted was no effect from main set
    of smart rules (per record and other limits): i.e. call to
    "CanItemBeReserved" was absent totally.
    
    Because of this there was a bug: for example none of two items were
    allowed to be held when first was allowed by one smart rule, BUT on loan,
    and second was disallowed by another smart rule (for example,
    0 "Holds per record"),
    
    i.e. in this case both items unavailable: so on-shelf holds setting
    "allow hold if all unavailable" should allow to hold first one, and not
    the second one. But it was that both wasn't allowed to be held.
    
    Solution: call to sub "CanItemBeReserved" added so it checked for
    "...->{status} ne 'OK'" so now if item restricted by smart rule it also
    accounted as "unavailable" and "AnyAvailavble" not counts it.
    
    How to reproduce:
    
    1. Add 2 smart rules (/cgi-bin/koha/admin/smart-rules.pl) with "on shelf
       holds": "if all unavailable" for all rules, no "item level holds", and
       set "holds per record" to 2 for "books" and "0" for "computer files".
    
    2. Create only 2 items for one biblio, but different types, "book"
       and "computer file". For example in misc4dev env:
       /cgi-bin/koha/cataloguing/additem.pl?biblionumber=1#additem
    
    3. Check out that item of type "book" to some person, for example,
       in misc4dev:
       /cgi-bin/koha/circ/circulation.pl?borrowernumber=2&barcode=3999900000001
    
    4. Open reserve/request, for example, for item 1 and patron 1 in misc4dev
       env (/cgi-bin/koha/reserve/request.pl?biblionumber=1&borrowernumber=1)
    
    5. It does not allow to hold, both red crossed, but computer file says
       "Exceeded max holds per record" because of "0" limit set on step 1.
    
    6. Apply the patch.
    
    7. Reload page on step 5 and see that "book" will be available for hold,
       but "computer file" still will be red-crossed "Exceeded max holds
       per record", now that's correct because both items unavailable:
       one because on load, another because of "0" limit for computer files.
    
    8. Check-in book from step 3 so it will be returned to the library,
    
    9. Reload page on step 5 and see that again no any holds available,
       but it's now also correct: "book" now returned but "on shelf holds"
       set to "if all unavailable".
    
    Signed-off-by: Agustin Moyano <agustinmoyano at theke.io>
    
    Signed-off-by: Katrin Fischer <katrin.fischer.83 at web.de>
    
    Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
    (cherry picked from commit 4599fcc59d4036cb5e3d776b9f162062968e8d98)
    
    Signed-off-by: Lucas Gass <lucas at bywatersolutions.com>

commit 13c5c4d85e8aaf57e511f037cb4e5de32066eebf
Author: Andrew Nugged <nugged at gmail.com>
Date:   Fri Jul 17 14:59:19 2020 +0300

    Bug 24683: Optimize loop in ItemsAnyAvailableAndNotRestricted
    
    Add cut-off shortcut (return from inside the loop) when first
    "Any Available And Not Restricted" item found, because one is
    enough for "Any".
    
    Testing: no change visible for code behavior/results,
    it is just faster because won't loop over the whole set.
    
    Signed-off-by: Agustin Moyano <agustinmoyano at theke.io>
    
    Signed-off-by: Katrin Fischer <katrin.fischer.83 at web.de>
    
    Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
    (cherry picked from commit 720b69780c1f62c61f4b36df02d46d8c85c0d30a)
    
    Signed-off-by: Lucas Gass <lucas at bywatersolutions.com>

commit a831c288da603f022a9894d560ed542e69feb5e3
Author: Andrew Nugged <nugged at gmail.com>
Date:   Fri Jun 5 09:59:48 2020 +0300

    Bug 24683: Subroutine name changed (fix), no code logic changed This is the intermediate refactor: renamed subroutine only.
    
    Naming mistake came because this sub is used to detect if anything
    available for hold, but it used in "if ANY UNAVAILABLE rule", so actually
    results of this sub negated (see below "return" in the code).
    
    In details:
    
    when previous refactor was done, name for subroutine was chosen
    wrongly in "opposite" direction from what it actually does:
    
    it was named "ItemsAnyAvailableForHold", but this subroutine gave
    truth (1) if at least one of the items available on shelf, not lost,
    not on loan, not held, and not restricted by smart rules and damaged
    status. So, if this sub says that item is still "available", this
    actually PREVENTS item from hold in parent sub (see negated return):
    
        sub IsAvailableForItemLevelRequest {
            ...
            my $any_available = ItemsAnyAvailableAndNotRestricted...
            return $any_available ? 0 : 1;
                 # ^^^ if any available and not restricted - we don't allow
                 #     on-shelf holds
            ...
    
    I.e. like it named now: "ItemsAnyAvailableAndNotRestricted".
    
    Small aside fix: white space for '&&' inside brackets added to join
    operation by priority visually.
    
    Testing plan not needed: all places where sub used it just renamed.
    More: all this places/code was introduced in one older commit so there
    is also no overlaps or other calls/uses for this subroutine.
    
    Signed-off-by: Agustin Moyano <agustinmoyano at theke.io>
    
    Signed-off-by: Katrin Fischer <katrin.fischer.83 at web.de>
    
    Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
    (cherry picked from commit 618cf80df9b0b668174b28ff61cad8a938704ec3)
    
    Signed-off-by: Lucas Gass <lucas at bywatersolutions.com>

-----------------------------------------------------------------------

Summary of changes:
 C4/Reserves.pm                                     |  34 +-
 reserve/request.pl                                 |   2 +-
 .../Holds/DisallowHoldIfItemsAvailable.t           | 367 +++++++++++++--------
 3 files changed, 258 insertions(+), 145 deletions(-)


hooks/post-receive
-- 
main Koha release repository


More information about the koha-commits mailing list