Bug 30114 - Koha offline circulation will always cancel the next hold when issuing item to a patron
Summary: Koha offline circulation will always cancel the next hold when issuing item t...
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Kyle M Hall
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-15 16:32 UTC by Kyle M Hall
Modified: 2022-04-08 12:35 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Text to go in the release notes:
Version(s) released in:
22.05.00,21.11.05


Attachments
Bug 30114: Koha offline circulation will always cancel the next hold when issuing item to a patron (1.56 KB, patch)
2022-02-15 16:38 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 30114: Koha offline circulation will always cancel the next hold when issuing item to a patron (1.61 KB, patch)
2022-02-16 15:09 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 30114: Koha offline circulation will always cancel the next hold when issuing item to a patron (1.68 KB, patch)
2022-02-23 11:16 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 30114: Add Unit Tests (4.94 KB, patch)
2022-03-07 14:49 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 30114: Koha offline circulation will always cancel the next hold when issuing item to a patron (1.68 KB, patch)
2022-03-07 14:49 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 30114: Add Unit Tests (5.01 KB, patch)
2022-03-24 16:59 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 30114: Koha offline circulation will always cancel the next hold when issuing item to a patron (1.68 KB, patch)
2022-03-24 16:59 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall 2022-02-15 16:32:43 UTC
If a record has holds on it, and, using offline circulation, an item on that is checked out to a patron that did not have a hold on the record, the next hold that would have trapped that item will be canceled.
Comment 1 Kyle M Hall 2022-02-15 16:38:37 UTC
Created attachment 130631 [details] [review]
Bug 30114: Koha offline circulation will always cancel the next hold when issuing item to a patron

If a record has holds on it, and, using offline circulation, an item on that is checked out to a patron
that did not have a hold on the record, the next hold that would have trapped that item will be canceled.

1) Place two bib level holds on an item for two patrons
2) Find a third patron, note his or her cardnumber
3) Create the file test.koc by copying and pasting the following into a
   text editor
Version=1.0	Generator=kocTest	GeneratorVersion=0.7
2008-06-11 12:24:11 547	issue	PATRONCARDNUMBER	ITEMBARCODE

note the fields are tab delemited, ensure the tabs do not get lost
when copying and pasting!
4) Upload the offline circ action, and commit the action
5) Note the item was checked out to the third patron
6) Note one of the other patron's holds were canceled
7) Reset your database
8) Apply this patch
9) Test again, no hold should be canceled!
Comment 2 Owen Leonard 2022-02-16 15:09:27 UTC
Created attachment 130669 [details] [review]
Bug 30114: Koha offline circulation will always cancel the next hold when issuing item to a patron

If a record has holds on it, and, using offline circulation, an item on
that is checked out to a patron that did not have a hold on the record,
the next hold that would have trapped that item will be canceled.

1) Place two bib level holds on an item for two patrons
2) Find a third patron, note his or her cardnumber
3) Create the file test.koc by copying and pasting the following into a
   text editor

Version=1.0	Generator=kocTest	GeneratorVersion=0.7
2008-06-11 12:24:11 547	issue	PATRONCARDNUMBER	ITEMBARCODE

note the fields are tab delemited, ensure the tabs do not get lost
when copying and pasting!

4) Upload the offline circ action, and commit the action
5) Note the item was checked out to the third patron
6) Note one of the other patron's holds were canceled
7) Reset your database
8) Apply this patch
9) Test again, no hold should be canceled!

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 3 Martin Renvoize 2022-02-23 11:16:47 UTC
Created attachment 131033 [details] [review]
Bug 30114: Koha offline circulation will always cancel the next hold when issuing item to a patron

If a record has holds on it, and, using offline circulation, an item on
that is checked out to a patron that did not have a hold on the record,
the next hold that would have trapped that item will be canceled.

1) Place two bib level holds on an item for two patrons
2) Find a third patron, note his or her cardnumber
3) Create the file test.koc by copying and pasting the following into a
   text editor

Version=1.0	Generator=kocTest	GeneratorVersion=0.7
2008-06-11 12:24:11 547	issue	PATRONCARDNUMBER	ITEMBARCODE

note the fields are tab delemited, ensure the tabs do not get lost
when copying and pasting!

4) Upload the offline circ action, and commit the action
5) Note the item was checked out to the third patron
6) Note one of the other patron's holds were canceled
7) Reset your database
8) Apply this patch
9) Test again, no hold should be canceled!

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize 2022-02-23 11:18:13 UTC
I would love to see a unit test for this.. but it appears we don't have any unit tests at all for the Offline methods (other than payment).

Any chance of adding a simple test for this Kyle?
Comment 5 Kyle M Hall 2022-03-07 14:49:32 UTC
Created attachment 131440 [details] [review]
Bug 30114: Add Unit Tests
Comment 6 Kyle M Hall 2022-03-07 14:49:41 UTC
Created attachment 131441 [details] [review]
Bug 30114: Koha offline circulation will always cancel the next hold when issuing item to a patron

If a record has holds on it, and, using offline circulation, an item on
that is checked out to a patron that did not have a hold on the record,
the next hold that would have trapped that item will be canceled.

1) Place two bib level holds on an item for two patrons
2) Find a third patron, note his or her cardnumber
3) Create the file test.koc by copying and pasting the following into a
   text editor

Version=1.0	Generator=kocTest	GeneratorVersion=0.7
2008-06-11 12:24:11 547	issue	PATRONCARDNUMBER	ITEMBARCODE

note the fields are tab delemited, ensure the tabs do not get lost
when copying and pasting!

4) Upload the offline circ action, and commit the action
5) Note the item was checked out to the third patron
6) Note one of the other patron's holds were canceled
7) Reset your database
8) Apply this patch
9) Test again, no hold should be canceled!

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize 2022-03-24 16:59:19 UTC
Created attachment 132190 [details] [review]
Bug 30114: Add Unit Tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 8 Martin Renvoize 2022-03-24 16:59:23 UTC
Created attachment 132191 [details] [review]
Bug 30114: Koha offline circulation will always cancel the next hold when issuing item to a patron

If a record has holds on it, and, using offline circulation, an item on
that is checked out to a patron that did not have a hold on the record,
the next hold that would have trapped that item will be canceled.

1) Place two bib level holds on an item for two patrons
2) Find a third patron, note his or her cardnumber
3) Create the file test.koc by copying and pasting the following into a
   text editor

Version=1.0	Generator=kocTest	GeneratorVersion=0.7
2008-06-11 12:24:11 547	issue	PATRONCARDNUMBER	ITEMBARCODE

note the fields are tab delemited, ensure the tabs do not get lost
when copying and pasting!

4) Upload the offline circ action, and commit the action
5) Note the item was checked out to the third patron
6) Note one of the other patron's holds were canceled
7) Reset your database
8) Apply this patch
9) Test again, no hold should be canceled!

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 9 Martin Renvoize 2022-03-24 16:59:59 UTC
Ooops, I forgot to revisit this.

Awesome.. you added a unit test!


PQA
Comment 10 Fridolin Somers 2022-04-05 15:29:03 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄
Comment 11 Kyle M Hall 2022-04-08 12:35:55 UTC
Pushed to 21.11.x for 21.11.05