Main Koha release repository https://koha-community.org
Find a file
Andrew Nugged 4599fcc59d 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@theke.io>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-08-24 10:12:45 +02:00
acqui Bug 26134: (bug 23463 follow-up) Fix add to basket from staged file 2020-08-19 08:24:43 +02:00
admin Bug 19036: Add ability to enable credit number for only some credit types 2020-08-20 12:31:59 +02:00
api/v1 Bug 23820: Add checkout to default to patron's home branch on club hold 2020-07-20 17:45:30 +02:00
authorities Bug 25428: Correctly encode link if authority subfield is a URL 2020-05-22 09:33:16 +01:00
basket Bug 17842: Simplify the code 2020-06-12 10:32:35 +02:00
C4 Bug 24683: Fix for take smart rules into account in "if all unavailable" 2020-08-24 10:12:45 +02:00
catalogue Bug 18501: Add _set_found_trigger 2020-08-20 12:31:59 +02:00
cataloguing Bug 18501: Add _set_found_trigger 2020-08-20 12:31:59 +02:00
circ Bug 23695: Alter transferbook to take a hash of params and specify from_branch 2020-08-18 15:45:48 +02:00
clubs Bug 23084: Replace grep {^$var$} with grep {$_ eq $var} 2020-02-17 10:44:45 +00:00
course_reserves Bug 25606: Remove all reserve items button 2020-08-07 16:54:40 +02:00
debian Bug 25778: Fix var scope in koha-plack for PERL5LIB and KOHA_HOME 2020-08-18 15:45:49 +02:00
docs Bug 26179: Add Timothy Alexis Vass to contributors 2020-08-13 08:09:10 +02:00
errors Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
etc Bug 26253: (bug 22857 follow-up) Remove duplicated mana_config in etc/koha-conf.xml 2020-08-24 10:12:39 +02:00
ill Bug 23173: (follow-up) Small improvements in efficiency 2020-04-06 11:05:09 +01:00
installer Bug 19036: DBRev 20.06.00.026 2020-08-20 12:31:59 +02:00
Koha Bug 18501: (follow-up) Do not rely on userenv->{branchcode} 2020-08-21 11:51:20 +02:00
koha-tmpl Bug 26023: Properly secure the cashup and refund actions 2020-08-24 10:12:42 +02:00
labels Bug 24735: Remove QueryParser-related code 2020-03-02 11:13:03 +00:00
members Bug 6725: Make patron duplicate matching flexible 2020-08-18 17:39:48 +02:00
misc Bug 24591: Add --help option to misc/devel/get-prepared-letter.pl 2020-08-07 16:54:40 +02:00
offline_circ Bug 23463: Replace ModItem with Koha::Item->store 2020-03-23 09:26:30 +00:00
opac Bug 16371: Combine get_daily_quote and get_daily_quote_for_interface 2020-08-13 10:15:33 +02:00
patron_lists Bug 19524: Use existing logged_in_user variable 2018-07-18 16:49:30 +00:00
patroncards Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
plugins Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
pos Bug 26023: Properly secure the cashup and refund actions 2020-08-24 10:12:42 +02:00
reports Bug 25605: Replace NULL values with '' when downloading a report as a tab separated text 2020-08-19 09:29:40 +02:00
reserve Bug 24683: Subroutine name changed (fix), no code logic changed This is the intermediate refactor: renamed subroutine only. 2020-08-24 10:12:45 +02:00
reviews Bug 18789: Send Koha::Patron object to the templates 2018-02-16 13:03:58 -03:00
rotating_collections Bug 21500: Remove warnings in rotating collections 2018-10-09 15:02:45 +00:00
serials Bug 25081: Fix wrong comment 2020-04-08 11:53:37 +01:00
services Bug 20019: use Modern::Perl in misc perl scripts 2018-02-05 09:47:08 -03:00
skel
suggestion Bug 24819: (follow-up) Rename suggestor to suggester 2020-04-20 13:36:42 +01:00
svc Bug 26251: Remove unused routines from svc/split_callnumbers 2020-08-20 10:23:56 +02:00
t Bug 24683: Fix for take smart rules into account in "if all unavailable" 2020-08-24 10:12:45 +02:00
tags Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
tmp/modified_authorities
tools Bug 5428: (QA follow-up) Add searchid for deleting items in a batch and editing in batch 2020-08-13 07:55:45 +02:00
virtualshelves Bug 23084: Replace grep {^$var$} with grep {$_ eq $var} 2020-02-17 10:44:45 +00:00
xt Bug 22844: Fix yaml_valid.t - don't pick .json files 2020-07-21 09:47:11 +02:00
.editorconfig Bug 24774: Set JSON indentation of 2 spaces in .editorconfig 2020-03-19 09:24:52 +00:00
.eslintrc.json Bug 23834: Add default ESLint configuration 2019-11-03 08:02:39 +00:00
.gitignore Bug 20427: Convert OPAC LESS to SCSS 2018-08-09 15:17:07 +00:00
.htaccess Fix file permissions: if it is not a script, it should not be executable. 2010-04-16 00:40:34 -04:00
.mailmap Update mailmap - Jonathan Druart 2017-06-21 12:42:19 -03:00
.perlcriticrc Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
.scss-lint.yml Bug 21237: Clean up staff client SCSS 2018-08-24 16:23:25 +00:00
about.pl Bug 25826: Add a warning to the about page 2020-08-07 09:55:50 +02:00
changelanguage.pl Bug 21299: (QA follow-up) Rename module and subroutine 2018-11-07 21:52:17 +00:00
cpanfile Bug 25723: Drop DateTime::Set from cpanfile 2020-07-20 17:45:31 +02:00
fix-perl-path.PL Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
gulpfile.js Bug 26228: Update gulpfile to work with Node.js v12 2020-08-18 14:47:44 +02:00
help.pl Bug 19817: Use the language from the interface if valid 2018-09-06 17:32:28 +00:00
INSTALL
Koha.pm Bug 19036: DBRev 20.06.00.026 2020-08-20 12:31:59 +02:00
koha_perl_deps.pl Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
kohaversion.pl
LICENSE Bug 9440 - update Koha's LICENSE file from GPL2 to GPL3 2013-02-12 08:52:10 -05:00
mainpage.pl Bug 16371: Combine get_daily_quote and get_daily_quote_for_interface 2020-08-13 10:15:33 +02:00
Makefile.PL Bug 25792: Rename 'ttf-dejavu' package to 'fonts-dejavu' for Debian 11 2020-07-21 14:34:25 +02:00
MANIFEST.SKIP Bug 9546 : Updating make manifest tardist 2013-02-06 23:54:46 -05:00
package.json Bug 26228: Update gulpfile to work with Node.js v12 2020-08-18 14:47:44 +02:00
README
README.md Bug 15465: Fix typo in bugs.k-c.org 2017-05-26 11:45:31 -03:00
README.robots
rewrite-config.PL Bug 25792: Rename 'ttf-dejavu' package to 'fonts-dejavu' for Debian 11 2020-07-21 14:34:25 +02:00
yarn.lock Bug 26228: Update gulpfile to work with Node.js v12 2020-08-18 14:47:44 +02:00

Koha is a free software integrated library system (ILS).

Koha is distributed under the GNU GPL version 3 or later.

Note: This is a synced mirror of the official Koha repo.

Note: Koha does not accept pull requests from git hosting sites.

Note: This project has its own bug tracker, to report a bug or submit a patch visit http://bugs.koha-community.org.

For guidelines on submitting patches for Koha please visit https://wiki.koha-community.org/wiki/SubmitingAPatch

The developers handbook can be found at https://wiki.koha-community.org/wiki/Developer_handbook

http://koha-community.org/

Koha Logo