Bug 15533: Fix 'ambiguous' SQL query in CanItemBeReserved
Adding reserves.itemtype made a query to fail in CanItemBeReserved. This patch prefixes the column names with the corresponding table names to prevent that. You can trigger the error by running prove t/db_dependent/Holds.t You should see something like this: Column 'itemtype' in where clause is ambiguous Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
parent
fc81ee5004
commit
43902cf42d
1 changed files with 2 additions and 2 deletions
|
@ -523,8 +523,8 @@ sub CanItemBeReserved{
|
|||
# level itemtype if the hold has no associated item
|
||||
$querycount .=
|
||||
C4::Context->preference('item-level_itypes')
|
||||
? " AND COALESCE( itype, itemtype ) = ?"
|
||||
: " AND itemtype = ?"
|
||||
? " AND COALESCE( items.itype, biblioitems.itemtype ) = ?"
|
||||
: " AND biblioitems.itemtype = ?"
|
||||
if ( $ruleitemtype ne "*" );
|
||||
|
||||
my $sthcount = $dbh->prepare($querycount);
|
||||
|
|
Loading…
Reference in a new issue