Bug 19198

Summary: Renewal as issue causes too many error
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: CirculationAssignee: Nick Clemens (kidclamp) <nick>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: major    
Priority: P5 - low CC: gmcharlt, kyle.m.hall, m.de.rooy, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 19198 - Unit tests
Bug 19198 - Renewal as issue causes too many error
Bug 19198 - Unit tests
Bug 19198 - Renewal as issue causes too many error
Bug 19198 - Unit tests
Bug 19198 - Renewal as issue causes too many error
Bug 19198 (QA Followup) Fix typo in conditions
Bug 19198 - Unit tests
Bug 19198 - Renewal as issue causes too many error
Bug 19198 (QA Followup) Fix typo in conditions
Bug 19198: Unit tests
Bug 19198: Renewal as issue causes too many error
Bug 19198: (QA followup) Fix typo in conditions
Bug 19198: do not autovivify
Bug 19198: Prevent the test to fail randomly

Description Nick Clemens (kidclamp) 2017-08-29 14:13:51 UTC
To recreate:

1 - Set a rule to limit checkouts to a single issue, allowing renewal
2 - Issue an item to a patron
3 - Issue the same item
4 - In staff client you get a confirm to renew and a notice of Too Many checkouts
5 - VIA Sip - you get a renewal response, but in logs the renewal fails as a 'too many'
Comment 1 Nick Clemens (kidclamp) 2017-08-29 14:27:25 UTC
Created attachment 66584 [details] [review]
Bug 19198 - Unit tests
Comment 2 Nick Clemens (kidclamp) 2017-08-29 14:27:28 UTC
Created attachment 66585 [details] [review]
Bug  19198 - Renewal as issue causes too many error

This patch moves some code and prevents checking for too many checkouts
when performing a renewal via checkout

To test:
1 - Set a rule to limit checkouts to a single issue, allowing renewal
2 - Issue an item to a patron
3 - Issue the same item
4 - In staff client you get a confirm to renew and a notice of Too Many
checkouts, don't confirm
5 - VIA Sip - you get a renewal response, but in logs the renewal fails
as a 'too
6 - Apply patch
7 - Via staff client you shoudl get renewal confirm with no too many
error
8 - SIP checkout should renew
Comment 3 Lee Jamison 2017-08-31 13:23:38 UTC
Created attachment 66670 [details] [review]
Bug 19198 - Unit tests

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Comment 4 Lee Jamison 2017-08-31 13:23:47 UTC
Created attachment 66671 [details] [review]
Bug 19198 - Renewal as issue causes too many error

This patch moves some code and prevents checking for too many checkouts
when performing a renewal via checkout

To test:
1 - Set a rule to limit checkouts to a single issue, allowing renewal
2 - Issue an item to a patron
3 - Issue the same item
4 - In staff client you get a confirm to renew and a notice of Too Many
checkouts, don't confirm
5 - VIA Sip - you get a renewal response, but in logs the renewal fails
as a 'too
6 - Apply patch
7 - Via staff client you shoudl get renewal confirm with no too many
error
8 - SIP checkout should renew

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Comment 5 Marcel de Rooy 2017-09-01 07:33:03 UTC
QA: Looking here now
Comment 6 Marcel de Rooy 2017-09-01 07:55:36 UTC
cd t/db_dependent/; git grep -l CanBookBeIssued | xargs prove

not ok 8 - Not a specific case, $delta should not be incremented
#   Failed test 'Not a specific case, $delta should not be incremented'
#   at t/db_dependent/Circulation/SwitchOnSiteCheckouts.t line 146.
#          got: undef
#     expected: 'TOO_MANY_CHECKOUTS'
Comment 7 Nick Clemens (kidclamp) 2017-09-13 12:00:54 UTC
Created attachment 67111 [details] [review]
Bug 19198 - Unit tests

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Comment 8 Nick Clemens (kidclamp) 2017-09-13 12:00:56 UTC
Created attachment 67112 [details] [review]
Bug 19198 - Renewal as issue causes too many error

This patch moves some code and prevents checking for too many checkouts
when performing a renewal via checkout

To test:
1 - Set a rule to limit checkouts to a single issue, allowing renewal
2 - Issue an item to a patron
3 - Issue the same item
4 - In staff client you get a confirm to renew and a notice of Too Many
checkouts, don't confirm
5 - VIA Sip - you get a renewal response, but in logs the renewal fails
as a 'too
6 - Apply patch
7 - Via staff client you shoudl get renewal confirm with no too many
error
8 - SIP checkout should renew

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Comment 9 Nick Clemens (kidclamp) 2017-09-13 12:00:59 UTC
Created attachment 67113 [details] [review]
Bug 19198 (QA Followup) Fix typo in conditions

'&' should be '&&'
Comment 10 Tomás Cohen Arazi (tcohen) 2017-10-03 17:34:34 UTC
Sorry Nick, can you rebase?
Comment 11 Nick Clemens (kidclamp) 2017-10-03 17:44:06 UTC
Created attachment 67567 [details] [review]
Bug 19198 - Unit tests

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Comment 12 Nick Clemens (kidclamp) 2017-10-03 17:44:10 UTC
Created attachment 67568 [details] [review]
Bug 19198 - Renewal as issue causes too many error

This patch moves some code and prevents checking for too many checkouts
when performing a renewal via checkout

To test:
1 - Set a rule to limit checkouts to a single issue, allowing renewal
2 - Issue an item to a patron
3 - Issue the same item
4 - In staff client you get a confirm to renew and a notice of Too Many
checkouts, don't confirm
5 - VIA Sip - you get a renewal response, but in logs the renewal fails
as a 'too
6 - Apply patch
7 - Via staff client you shoudl get renewal confirm with no too many
error
8 - SIP checkout should renew

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Comment 13 Nick Clemens (kidclamp) 2017-10-03 17:44:13 UTC
Created attachment 67569 [details] [review]
Bug 19198 (QA Followup) Fix typo in conditions

'&' should be '&&'
Comment 14 Tomás Cohen Arazi (tcohen) 2017-10-03 18:34:06 UTC
Created attachment 67571 [details] [review]
Bug 19198: Unit tests

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 15 Tomás Cohen Arazi (tcohen) 2017-10-03 18:34:16 UTC
Created attachment 67572 [details] [review]
Bug 19198: Renewal as issue causes too many error

This patch moves some code and prevents checking for too many checkouts
when performing a renewal via checkout

To test:
1 - Set a rule to limit checkouts to a single issue, allowing renewal
2 - Issue an item to a patron
3 - Issue the same item
4 - In staff client you get a confirm to renew and a notice of Too Many
checkouts, don't confirm
5 - VIA Sip - you get a renewal response, but in logs the renewal fails
as a 'too
6 - Apply patch
7 - Via staff client you shoudl get renewal confirm with no too many
error
8 - SIP checkout should renew

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 16 Tomás Cohen Arazi (tcohen) 2017-10-03 18:34:28 UTC
Created attachment 67573 [details] [review]
Bug 19198: (QA followup) Fix typo in conditions

'&' should be '&&'

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 17 Nick Clemens (kidclamp) 2017-10-06 01:03:19 UTC
I think Tomas just didn't change status, revert if I am wrong :-)
Comment 18 Jonathan Druart 2017-10-06 14:59:53 UTC
Created attachment 67719 [details] [review]
Bug 19198: do not autovivify
Comment 19 Jonathan Druart 2017-10-06 14:59:57 UTC
Created attachment 67720 [details] [review]
Bug 19198: Prevent the test to fail randomly

If categorycode is 'X', the test will fail
Comment 20 Jonathan Druart 2017-10-06 15:18:16 UTC
Pushed to master for 17.11, thanks to everybody involved!