Bug 17940 - Holds not going to waiting state after having been transferred
Summary: Holds not going to waiting state after having been transferred
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: master
Hardware: All All
: P5 - low critical (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
: 18075 (view as bug list)
Depends on: 14695
Blocks:
  Show dependency treegraph
 
Reported: 2017-01-19 11:54 UTC by Stefan Berndtsson
Modified: 2017-10-24 04:31 UTC (History)
10 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 17940: (follow-up 14695) Fix - Mark holds as waiting when transfer is done (1.26 KB, patch)
2017-02-08 16:56 UTC, Jonathan Druart
Details | Diff | Splinter Review
[SIGNED OFF] Bug 17940: (follow-up 14695) Fix - Mark holds as waiting when transfer is done (1.32 KB, patch)
2017-02-08 18:36 UTC, Christopher Brannon
Details | Diff | Splinter Review
Bug 17940: (follow-up 14695) Fix - Mark holds as waiting when transfer is done (1.38 KB, patch)
2017-02-08 21:03 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 17940: (follow-up 14695) Fix - Mark holds as waiting when transfer is done (1.38 KB, patch)
2017-02-09 06:42 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Berndtsson 2017-01-19 11:54:28 UTC
We seem to have found an issue with holds after transfers.

Steps to reproduce (everything done by staff):

Allow for On shelf holds.
Have library branch A and B.
Have one biblio with one item located at library A.
Have one patron able to have holds placed on them.

1. Place a hold on biblio for patron, select pickup at library B.
2. Check in item on library A (get a transfer notice).
3. Check in item on library B (another transfer notice).
4. Item is not waiting properly on pickup location.

If pickup was set to library A (same as item), it would be properly set to waiting.

Expected outcome would be that the item is set to waiting at library B.

After step 1, the reserves table contains "NULL" in "found" column.
After step 2, "found" contains "T"
After step 3, "found" still contains "T", where it should really contain "W".

This has been tested with both 16.11.00 and 16.11.01.

Thank you.
Comment 1 Stefan Berndtsson 2017-01-24 10:43:37 UTC
Some additional information.

When in the unexpected state after having checked in on library B (step 3), the information notice presented includes:

"Hold found (item is already waiting):"

This state seems to only look at itemnumber and priority == 0. When step 2 executes, the reserve is set to 'T', the priority to 0 and the itemnumber is added to the reserve entry.

As far as I understand things, this is normal (priority is 0 when the item is assigned to a person, even if there is a transfer needed).

When the item is checked in at the pickup (Step 3 again) the item is returned as "Waiting" (from CheckReserves) due to the itemnumber and priority == 0, and since it does not need a transfer from Library B, and is already considered to be waiting, it does not seem to update the 'W' flag.
Comment 2 Jonathan Druart 2017-02-08 16:50:13 UTC
*** Bug 18075 has been marked as a duplicate of this bug. ***
Comment 3 Jonathan Druart 2017-02-08 16:56:13 UTC
Created attachment 60024 [details] [review]
Bug 17940: (follow-up 14695) Fix - Mark holds as waiting when transfer is done

When an item from Library A is reserved and set to be picked up at
Library B, the hold buttons fail to confirm or cancel during check in at
Library B when the item is transferred from Library A.

Test plan:
* Create a hold for item at Library A to be picked up at Library B.
* Check in item at Library A to trigger the transfer.
=> item shows in transit
* Switch to Library B and check in item.
* Confirm the hold.
=> item shows waiting
Comment 4 Jonathan Druart 2017-02-08 16:57:01 UTC
Marked as critical since it impacts last stable release.
Comment 5 Christopher Brannon 2017-02-08 18:36:59 UTC
Created attachment 60035 [details] [review]
[SIGNED OFF] Bug 17940: (follow-up 14695) Fix - Mark holds as waiting when transfer is done

When an item from Library A is reserved and set to be picked up at
Library B, the hold buttons fail to confirm or cancel during check in at
Library B when the item is transferred from Library A.

Test plan:
* Create a hold for item at Library A to be picked up at Library B.
* Check in item at Library A to trigger the transfer.
=> item shows in transit
* Switch to Library B and check in item.
* Confirm the hold.
=> item shows waiting

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Comment 6 Nick Clemens 2017-02-08 21:03:02 UTC
Created attachment 60037 [details] [review]
Bug 17940: (follow-up 14695) Fix - Mark holds as waiting when transfer is done

When an item from Library A is reserved and set to be picked up at
Library B, the hold buttons fail to confirm or cancel during check in at
Library B when the item is transferred from Library A.

Test plan:
* Create a hold for item at Library A to be picked up at Library B.
* Check in item at Library A to trigger the transfer.
=> item shows in transit
* Switch to Library B and check in item.
* Confirm the hold.
=> item shows waiting

Signed-off-by: Crhistopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 7 Christopher Brannon 2017-02-08 22:25:48 UTC
Dude, what did you do to my name in the sign off???  Now I will never get credit for my work!  :)
Comment 8 Jonathan Druart 2017-02-09 06:42:12 UTC
Created attachment 60045 [details] [review]
Bug 17940: (follow-up 14695) Fix - Mark holds as waiting when transfer is done

When an item from Library A is reserved and set to be picked up at
Library B, the hold buttons fail to confirm or cancel during check in at
Library B when the item is transferred from Library A.

Test plan:
* Create a hold for item at Library A to be picked up at Library B.
* Check in item at Library A to trigger the transfer.
=> item shows in transit
* Switch to Library B and check in item.
* Confirm the hold.
=> item shows waiting

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 9 David Roberts 2017-02-10 16:15:37 UTC
I know this has been signed off and passed QA, but in the patch attachment, shouldn't: 

reserve_id     => $reserve->{reserve_id},

actually be:

reserve_id     => $reserve->{'reserve_id'},

?
Comment 10 Marcel de Rooy 2017-02-10 16:37:23 UTC
(In reply to David Roberts from comment #9)
> I know this has been signed off and passed QA, but in the patch attachment,
> shouldn't: 
> 
> reserve_id     => $reserve->{reserve_id},
> 
> actually be:
> 
> reserve_id     => $reserve->{'reserve_id'},
> 
> ?

Just the same. No problem.
Comment 11 Kyle M Hall 2017-02-14 13:53:41 UTC
Pushed to master for 17.05, thanks Jonathan!
Comment 12 Katrin Fischer 2017-02-14 19:34:09 UTC
Good to see this fixed!

This patch has been pushed to 16.11.x and will be in 16.11.04.
Comment 13 Mason James 2017-10-24 04:31:13 UTC
Blocked by new feature, skipping for 16.05.x