From 2e633b7f9d7729a84dd8580f512ea9ae433b0f22 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Wed, 6 Mar 2024 12:45:09 +0000 Subject: [PATCH] Bug 36243: Update edit_action to cud-edit_action 1) Install FreeForm, enable ILL module, run: bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh) 2) You'll have to switch the FreeForm branch to the one compatible with this work, i.e.: cd /kohadevbox/koha/Koha/Illbackends/FreeForm git checkout b_36243 3) Restart plack: koha-plack --restart kohadev 4) Create a new FreeForm request, visit: /cgi-bin/koha/ill/ill-requests.pl?method=create&backend=FreeForm 5) Set 'type' enter '42' in cardnumber and pick a library. Click 'Create'. 6) Edit that request, click "manage request" or if #1 visit: /cgi-bin/koha/ill/ill-requests.pl?op=illview&illrequest_id=1 7) Click "Edit request". Click "Submit". Notice it errors "No CSRF token passed for POST" 9) Apply patches. Restart plack. 10) Repeat 7) Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer --- Koha/Illrequest.pm | 1 + ill/ill-requests.pl | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm index bf3f9c3a52..11cfb0f784 100644 --- a/Koha/Illrequest.pm +++ b/Koha/Illrequest.pm @@ -2054,6 +2054,7 @@ sub get_op_param_deprecation { } elsif ( $interface eq 'intranet' ) { $op = $params->{op} // $params->{method} // 'illlist'; $op = 'cud-create' if $op eq 'create'; + $op = 'cud-edit_action' if $op eq 'edit_action'; $op = 'cud-cancel' if $op eq 'cancel'; $op = 'cud-delete' if $op eq 'delete'; } diff --git a/ill/ill-requests.pl b/ill/ill-requests.pl index b23c23e567..74e37dac85 100755 --- a/ill/ill-requests.pl +++ b/ill/ill-requests.pl @@ -215,7 +215,7 @@ if ( $backends_available ) { # handle special commit rules & update type handle_commit_maybe($backend_result, $request); - } elsif ( $op eq 'edit_action' ) { + } elsif ( $op eq 'cud-edit_action' ) { # Handle edits to the Illrequest object. # (not the Illrequestattributes) # We simulate the API for backend requests for uniformity. diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt index 01ec9a0b3e..8be24b166b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt @@ -491,7 +491,7 @@
- + -- 2.39.5