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:
<staff_url>/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:
<staff_url>/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 <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Pedro Amorim 2024-03-06 12:45:09 +00:00 committed by Katrin Fischer
parent 0cefd8c112
commit 2e633b7f9d
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
3 changed files with 3 additions and 2 deletions

View File

@ -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';
}

View File

@ -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.

View File

@ -491,7 +491,7 @@
</ol>
</fieldset>
<fieldset class="action">
<input type="hidden" value="edit_action" name="op">
<input type="hidden" value="cud-edit_action" name="op">
<input type="hidden" value="form" name="stage">
<input type="hidden" value="[% request.illrequest_id | html %]" name="illrequest_id">
<input type="submit" class="btn btn-primary" value="Submit" />