Bug 25726: make holds to pull ignore holds where found is not null and itemnumber is null

To test:
1- place 2 bib-level holds on available items
2- confirm they both show on Holds to Pull
3- edit one hold from the database to set found='T'
4- reload Holds to Pull, confirm it is now empty
5- apply patch
6- Reload Holds to Pull
7- confirm it now shows the hold you did not edit

Signed-off-by: donnab <donna@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Using capitals for SQL reserved words; added a FIXME
Tested with:
    update reserves set found='T', itemnumber=NULL where reserve_id=...
This should be a workaround while we fix the underlying problem.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 56220d211d)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit cb76501776)

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

(cherry picked from commit 39547a6279)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
This commit is contained in:
Andrew Fuerste-Henry 2020-06-12 13:51:16 +00:00 committed by Victor Grousset/tuxayo
parent ed4fbbcbee
commit 0ed8da203b
1 changed files with 2 additions and 2 deletions

View File

@ -215,7 +215,7 @@ my $strsth =
$sqldatewhere
AND (reserves.itemnumber IS NULL OR reserves.itemnumber = items.itemnumber)
AND items.itemnumber NOT IN (SELECT itemnumber FROM branchtransfers where datearrived IS NULL)
AND items.itemnumber NOT IN (select itemnumber FROM reserves where found IS NOT NULL)
AND items.itemnumber NOT IN (SELECT itemnumber FROM reserves WHERE found IS NOT NULL AND itemnumber IS NOT NULL)
AND issues.itemnumber IS NULL
AND reserves.priority <> 0
AND reserves.suspend = 0
@ -224,7 +224,7 @@ my $strsth =
";
# GROUP BY reserves.biblionumber allows only items that are not checked out, else multiples occur when
# multiple patrons have a hold on an item
#FIXME "found IS NOT NULL AND itemnumber IS NOT NULL" is just a workaround: see BZ 25726
if (C4::Context->preference('IndependentBranches')){
$strsth .= " AND items.holdingbranch=? ";