Bug 10741: restore holdability of in-transit items on OPAC search results
authorFridolyn SOMERS <fridolyn.somers@biblibre.com>
Fri, 16 Aug 2013 11:36:10 +0000 (13:36 +0200)
committerGalen Charlton <gmc@esilibrary.com>
Fri, 23 Aug 2013 14:45:12 +0000 (14:45 +0000)
In search results, one could not place a hold on an item in transit
and for loan (items.notforloan=0).  This appears when AllowOnShelfHolds
is allowed.

This patch repairs a regression introduced by the patch for bug 8975.

Test plan :
- Set AllowOnShelfHolds to on
- Create a record with a normal item : not lost, not withdrawn, not
  damaged, notforloan=0
- Index this record
- Perform a search on OPAC that returns this record (and others)
=> You see in actions "Place hold"
- Add this item in transit : /cgi-bin/koha/circ/branchtransfers.pl
- Re-perform the search on OPAC
=> You see in actions "Place hold" and item "in transit"

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
C4/Search.pm

index aec024b..4e4edb0 100644 (file)
@@ -1950,8 +1950,8 @@ sub searchResults {
                                         $can_place_holds = 1;
                                     }
                                 }
-                            } elsif ( $item->{notforloan} < 0 ) {
-                                # item is not damaged and notforloan is < 0
+                            } elsif ( !$item->{notforloan} || $item->{notforloan} < 0 ) {
+                                # item is not damaged and item is either for loan or has notforloan < 0
                                 $can_place_holds = 1;
                             }
                         }