I have not been able to recreate this in my testing environment, however, I can find evidence of the problem in many production environments. When renewing a patron the interface recorded in action logs is often 'api' SELECT * FROM action_logs WHERE module='MEMBERS' AND action="RENEW" AND interface='api'; The specific log is from Koha::Patron->renew_account This is only called in members/setstatus.pl setstatus uses 'checkauth' rather than other routines for verifying logged in patron, and it seems that the interface must not be set for Context in that call
No idea how this is possible!
Theory: - Related to bug 31042 - problem arises from api (or other?) calls where setenv is not explicitly set - plack worker retains most recent env that was set until something else overwrites it - when one of these scripts requests userenv, it gets the stale one from plack
Checking production sites, I am not seeing this issue since August, so maybe something in 21.11.05 -> 21.11.10 fixed this
Still valid in master To recreate: 1 - Sign in to staff client 2 - Checkout an item to a patron 3 - Stay on that page 4 - Hit the patrons API with a post request: http://localhost:8081/api/v1/patrons { "surname": "kidclamp", "library_id": "CPL", "category_id": "S" } 5 - Check the box next to the checkout and 'Renew selected' 6 - Check the action logs - interface=api
I remember bumping into this in the past too although I can't remember exactly how... I'm pretty sure in my memories somewhere I know what causes this and how to fix it. Which is super helpful right now I know...
(In reply to David Cook from comment #5) > I remember bumping into this in the past too although I can't remember > exactly how... > > I'm pretty sure in my memories somewhere I know what causes this and how to > fix it. > > Which is super helpful right now I know... Ah, it looks like it was bug 32140.
I cannot recreate this, and haven't seen it in recent spot checks in production, so closing this one