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.
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!
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>
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>
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?
Created attachment 131440 [details] [review] Bug 30114: Add Unit Tests
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>
Created attachment 132190 [details] [review] Bug 30114: Add Unit Tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
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>
Ooops, I forgot to revisit this. Awesome.. you added a unit test! PQA
Pushed to master for 22.05, thanks to everybody involved [U+1F984]
Pushed to 21.11.x for 21.11.05