Summary: | Minor fixes and improved code readability in circulation.pl | ||
---|---|---|---|
Product: | Koha | Reporter: | David Gustafsson <glasklas> |
Component: | Circulation | Assignee: | Bugs List <koha-bugs> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | minor | ||
Priority: | P5 - low | CC: | andrew, fridolin.somers, gmcharlt, kyle.m.hall, kyle, nick, victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
22.05.00,21.11.04,21.05.13
|
|
Circulation function: | |||
Attachments: |
Bug 29220: Minor fixes and improved code readability
Bug 29220: Minor fixes and improved code readability Bug 29220: Minor fixes and improved code readability Bug 29220: Minor fixes and improved code readability Bug 29220: Minor fixes and improved code readability |
Description
David Gustafsson
2021-10-13 13:33:12 UTC
Created attachment 126199 [details] [review] Bug 29220: Minor fixes and improved code readability Created attachment 126213 [details] [review] Bug 29220: Minor fixes and improved code readability The current handling of onsite checkouts with OnSiteCheckoutsForce syspref enabled is confusing and hard to understand. It's also fragile with a high risk future changes could result in subtle bugs. Also fix an incosistency in wich errors are considered blocking for forced onsite checkouts. To test: 1) Enable OnSiteCheckouts, disable OnSiteCheckoutsForce 2) Edit a biblio item and for example set Not for loan to a value restricting loans 3) Try to check out the item for some patron 4) A message that item is not for loan should be displayed 5) Select "On-site checkout" and try again 6) The same message should be displayed 7) Try to checkout with some invalid barcode 8) A message that barcode was not found should be displayed 9) Now enable OnSiteCheckoutsForce 10) Try to checkout the item for some patron 11) A message that item is not for loan should be displayed 12) Select "On-site checkout" and try again 13) Checkout should now succeed, no messages should be displayed 14) Try to checkout with some invalid barcode 15) A message that barcode was not found should be displayed 16) All of the above steps should produce the same result with and without this patch Sponsored-by: Gothenburg University Library Created attachment 126214 [details] [review] Bug 29220: Minor fixes and improved code readability The current handling of onsite checkouts with OnSiteCheckoutsForce syspref enabled is confusing and hard to understand. It's also fragile with a high risk future changes could result in subtle bugs. Also fix an inconsistency in which errors are considered blocking for forced onsite checkouts. To test: 1) Enable OnSiteCheckouts, disable OnSiteCheckoutsForce 2) Edit a biblio item and for example set Not for loan to a value restricting loans 3) Try to check out the item for some patron 4) A message that item is not for loan should be displayed 5) Select "On-site checkout" and try again 6) The same message should be displayed 7) Try to checkout with some invalid barcode 8) A message that barcode was not found should be displayed 9) Now enable OnSiteCheckoutsForce 10) Try to checkout the item for some patron 11) A message that item is not for loan should be displayed 12) Select "On-site checkout" and try again 13) Checkout should now succeed, no messages should be displayed 14) Try to checkout with some invalid barcode 15) A message that barcode was not found should be displayed 16) All of the above steps should produce the same result with and without this patch Sponsored-by: Gothenburg University Library Created attachment 131098 [details] [review] Bug 29220: Minor fixes and improved code readability The current handling of onsite checkouts with OnSiteCheckoutsForce syspref enabled is confusing and hard to understand. It's also fragile with a high risk future changes could result in subtle bugs. Also fix an inconsistency in which errors are considered blocking for forced onsite checkouts. To test: 1) Enable OnSiteCheckouts, disable OnSiteCheckoutsForce 2) Edit a biblio item and for example set Not for loan to a value restricting loans 3) Try to check out the item for some patron 4) A message that item is not for loan should be displayed 5) Select "On-site checkout" and try again 6) The same message should be displayed 7) Try to checkout with some invalid barcode 8) A message that barcode was not found should be displayed 9) Now enable OnSiteCheckoutsForce 10) Try to checkout the item for some patron 11) A message that item is not for loan should be displayed 12) Select "On-site checkout" and try again 13) Checkout should now succeed, no messages should be displayed 14) Try to checkout with some invalid barcode 15) A message that barcode was not found should be displayed 16) All of the above steps should produce the same result with and without this patch Sponsored-by: Gothenburg University Library Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Works as described in test plan. Thanks for working on this difficult code ;) Created attachment 131121 [details] [review] Bug 29220: Minor fixes and improved code readability The current handling of onsite checkouts with OnSiteCheckoutsForce syspref enabled is confusing and hard to understand. It's also fragile with a high risk future changes could result in subtle bugs. Also fix an inconsistency in which errors (DEBT_GUARANTORS) are considered blocking for forced onsite checkouts. To test: 1) Enable OnSiteCheckouts, disable OnSiteCheckoutsForce 2) Edit a biblio item and for example set Not for loan to a value restricting loans 3) Try to check out the item for some patron 4) A message that item is not for loan should be displayed 5) Select "On-site checkout" and try again 6) The same message should be displayed 7) Try to checkout with some invalid barcode 8) A message that barcode was not found should be displayed 9) Now enable OnSiteCheckoutsForce 10) Try to checkout the item for some patron 11) A message that item is not for loan should be displayed 12) Select "On-site checkout" and try again 13) Checkout should now succeed, no messages should be displayed 14) Try to checkout with some invalid barcode 15) A message that barcode was not found should be displayed 16) All of the above steps should produce the same result with and without this patch Additional: Before patch: a) Set NoIssuesChargeGuarantorsWithGuarantees to 1 b) add a guarantee with another guarantor c) charge a 1.01 fine to other guarantor d) checkout is blocked due to fines Apply patch e) checkout is allowed when onsite checkouts forced Sponsored-by: Gothenburg University Library Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> This does make the code more readable, and fixes a bug/inconsistency - ideally this logic would happen in CanBookBeIssued and be covered with tests, but is an improvement Pushed to master for 22.05, thanks to everybody involved [U+1F984] Pushed to 21.11.x for 21.11.04 Pushed to 21.05.x for 21.05.13 Not backported to oldoldstable (20.11.x). Feel free to ask if it's needed. |