Bug 36273 - ILL - Refactor $op in ill-requests.pl
Summary: ILL - Refactor $op in ill-requests.pl
Status: ASSIGNED
Alias: None
Product: Koha
Classification: Unclassified
Component: ILL (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact:
URL:
Keywords:
Depends on: 36241 36243 36245 36249
Blocks:
  Show dependency treegraph
 
Reported: 2024-03-07 12:47 UTC by Pedro Amorim
Modified: 2025-01-20 12:52 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 36273: OPAC: WIP (11.46 KB, patch)
2025-01-20 12:52 UTC, Pedro Amorim
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro Amorim 2024-03-07 12:47:52 UTC
With bug 34478, presenting a form page should be a GET request without 'cud-' in the op URL parameter.
Additionally, a form that creates, updates or deletes some object should be a POST with the 'cud-' prefix.

ill-requests.pl did not do this distinction originally, and still doesn't. It instead works around 'cud-' in the $op to preserve existing functionality. It should be refactored to better distinguish between a GET $op and a POST $op.
Comment 1 Pedro Amorim 2025-01-20 12:52:36 UTC
Created attachment 176794 [details] [review]
Bug 36273: OPAC: WIP

This is working, currently built on top of bug 36197 as that was the development that brought this issue to light.

Refreshing the following URL with unauthenticatedOPACILLRequest enabled would always create a new ILL request.
http://localhost:8080/cgi-bin/koha/opac-illrequests.pl?method=create&stage=form&backend=Standard&type=article&branchcode=CPL&unauthenticated_first_name=Pedro%20Jorge&unauthenticated_last_name=Andrade%20Amorim&unauthenticated_email=pedro.amorim@ptfs-europe.com

This patch gets rid of using the get_op_param_deprecation method in the OPAC controller.
This creates the needed distinction between 'create' op (show the form) and 'cud-create' op (handle POST form submission)
More testing is required.