https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42998

Pedro Amorim (ammopt) <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Passed QA                   |Failed QA
                 CC|                            |[email protected]
                   |                            |k

--- Comment #8 from Pedro Amorim (ammopt) <[email protected]> ---
Hi all, 2 small things, steps below.

Setup:
Inside KTD, rebuild the API bundle and restart plack:
  $ ktd --shell
  k$ yarn api:bundle
  k$ koha-plack --restart kohadev
Set these system preferences, clicking the save button under each one:
  'AllowRenewalLimitOverride' to 'Allow', click 'Save all Circulation
preferences':
 
http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=AllowRenewalLimitOverride
  'RenewalLog' to 'Log', click 'Save all Logging preferences':
 
http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=RenewalLog
  'RestrictionBlockRenewing' to 'block', click 'Save all Circulation
preferences':
 
http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=RestrictionBlockRenewing
Check out item '3999900000001' to patron '42':
  http://localhost:8081/cgi-bin/koha/circ/circulation.pl?findborrower=42
Grab the checkout id:
  k$ koha-mysql kohadev -e "SELECT issue_id FROM issues WHERE
borrowernumber=(SELECT borrowernumber FROM borrowers WHERE cardnumber='42')
ORDER BY issue_id DESC LIMIT 1"

1. The renewal_limit override isn't recorded in the action log
The staff interface adds 'RENEWAL_LIMIT' to the renewal log's confirmations
when the limit is overridden (svc/renew and circ/renew.pl). The API passes no
confirmations to AddRenewal, so overrides made through the API leave no audit
trail.
1) Renew through the API with the override (replace <id>):
  k$ curl -s -o /dev/null -w '%{http_code}\n' -u koha:koha -X POST -H
'x-koha-override: renewal_limit'
http://localhost:8081/api/v1/checkouts/<id>/renewal
2) Confirm 201
3) Check the log entry:
  k$ koha-mysql kohadev -e "SELECT info FROM action_logs WHERE
module='CIRCULATION' AND action='RENEWAL' ORDER BY action_id DESC LIMIT 1"
4) Confirm '"confirmations" : []', no 'RENEWAL_LIMIT'

2. The spec understates what renewal_limit bypasses (it also bypasses
RestrictionBlockRenewing)
The spec says renewal_limit "skips the renewal count limits", but it sets
override_limit in CanBookBeRenewed, which also skips restrictions, overdues,
fines, the auto-renewal checks and 'too_soon'. The behaviour matches the staff
interface override, only the description is wrong.
1) On patron '42''s page, go to the 'Restrictions' tab, click 'Add manual
restriction', then 'Add restriction'
2) Renew without the override:
  k$ curl -s -u koha:koha -X POST
http://localhost:8081/api/v1/checkouts/<id>/renewal
3) Confirm 403 with 'error_code' 'restriction'
4) Renew with the override:
  k$ curl -s -o /dev/null -w '%{http_code}\n' -u koha:koha -X POST -H
'x-koha-override: renewal_limit'
http://localhost:8081/api/v1/checkouts/<id>/renewal
5) Confirm 201: the restriction was bypassed

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to