Bug 37064

Summary: Spurious CSRF error logged by 500.pl when a POST request fails
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: Architecture, internals, and plumbingAssignee: Bugs List <koha-bugs>
Status: RESOLVED DUPLICATE QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: dcook, jonathan.druart, kyle, martin.renvoize
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:

Description Nick Clemens (kidclamp) 2024-06-10 18:06:28 UTC
I haven't been able to set things up to recreate on KTD, but in production:
1 - Set an email for a patron and enable HOLD notifications
2 - Edit the HOLD letter to use a spurious item field [% item.itemcopynumber %]
3 - Place a hold for patron and confirm
4 - Error in logs
    ERROR PROCESSING TEMPLATE: undef error - The method Koha::Item->itemcopynumber is not covered by tests!
5 - But also:
    [WARN] Programming error - op 'cud-affect_reserve' must not start with 'cud-' for GET https://staff-library.provider.com/intraneterrors/500.pl (referer: https://staff-library.provider.com/cgi-bin/koha/circ/returns.pl) at /usr/share/koha/lib/Koha/Middleware/CSRF.pm line 82.

6 - The ErrorDocument middleware automatically transforms every request into a GET - so suddenly the cud- op is rejected
Comment 1 David Cook 2024-06-11 01:05:16 UTC
This is probably a duplicate of bug 37040
Comment 2 David Cook 2024-06-11 01:18:44 UTC
Can you check it out and let me know what you think?
Comment 3 Nick Clemens (kidclamp) 2024-06-13 17:10:54 UTC

*** This bug has been marked as a duplicate of bug 37040 ***