@@ -, +, @@ --- C4/Items.pm | 5 +---- t/db_dependent/Items.t | 4 +++- 2 files changed, 4 insertions(+), 5 deletions(-) --- a/C4/Items.pm +++ a/C4/Items.pm @@ -1298,6 +1298,7 @@ sub GetItemsInfo { items.notforloan as itemnotforloan, issues.borrowernumber, issues.date_due as datedue, + issues.onsite_checkout, borrowers.cardnumber, borrowers.surname, borrowers.firstname, @@ -1311,8 +1312,6 @@ sub GetItemsInfo { holding.opac_info as holding_branch_opac_info, home.opac_info as home_branch_opac_info "; - $query .= ", issues.onsite_checkout" - if C4::Context->preference("OnSiteCheckouts"); $query .= " FROM items LEFT JOIN branches AS holding ON items.holdingbranch = holding.branchcode @@ -1325,8 +1324,6 @@ sub GetItemsInfo { LEFT JOIN serial USING (serialid) LEFT JOIN itemtypes ON itemtypes.itemtype = " . (C4::Context->preference('item-level_itypes') ? 'items.itype' : 'biblioitems.itemtype'); - $query .= " LEFT JOIN issues ON issues.itemnumber = items.itemnumber" - if C4::Context->preference("OnSiteCheckouts"); $query .= " WHERE items.biblionumber = ? ORDER BY home.branchname, items.enumchron, LPAD( items.copynumber, 8, '0' ), items.dateaccessioned DESC" ; my $sth = $dbh->prepare($query); $sth->execute($biblionumber); --- a/t/db_dependent/Items.t +++ a/t/db_dependent/Items.t @@ -157,7 +157,7 @@ subtest 'GetHiddenItemnumbers tests' => sub { subtest 'GetItemsInfo tests' => sub { - plan tests => 3; + plan tests => 4; # Start transaction $dbh->{AutoCommit} = 0; @@ -186,6 +186,8 @@ subtest 'GetItemsInfo tests' => sub { 'GetItemsInfo returns the correct home branch OPAC info notice' ); is( $results[0]->{ holding_branch_opac_info }, "holdingbranch OPAC info", 'GetItemsInfo returns the correct holding branch OPAC info notice' ); + is( exists( $results[0]->{ onsite_checkout } ), 1, + 'GetItemsInfo returns a onsite_checkout key' ); $dbh->rollback; }; --