Bug 41478 - AutoILLBackendPriority - Unauthenticated request shows backend form if wrong captcha
Summary: AutoILLBackendPriority - Unauthenticated request shows backend form if wrong ...
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: ILL (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-12-18 13:26 UTC by Pedro Amorim
Modified: 2025-12-18 13:27 UTC (History)
4 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 41478: Render Standard form on OPAC if failed_captcha and AutoILLBackendPriority (1.16 KB, patch)
2025-12-18 13:27 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 41478: Refactor: Readability + Never nester (5.11 KB, patch)
2025-12-18 13:27 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 2025-12-18 13:26:26 UTC
It should always show the Standard form when AutoILLBackendPriority is in use.
Comment 1 Pedro Amorim 2025-12-18 13:27:52 UTC
Created attachment 190622 [details] [review]
Bug 41478: Render Standard form on OPAC if failed_captcha and AutoILLBackendPriority
Comment 2 Pedro Amorim 2025-12-18 13:27:54 UTC
Created attachment 190623 [details] [review]
Bug 41478: Refactor: Readability + Never nester

1) Install the following dummy backend plugin:
https://github.com/openfifth/koha-ill-backend-plugin/releases/tag/v2.0.8
2) Sys prefs preparation: Enable ILLModule, ILLOpacUnauthenticatedRequest and check PluginBackend on AutoILLBackendPriority
3) Logout, create a new Unauthenticated ILL request on the OPAC, visit:
<opac_url>/cgi-bin/koha/opac-illrequests.pl?op=create&backend=Standard
4) Fill in the mandatory top fields (first name, last name, email address and library)
5) Pick 'Book' for type and enter 'green' in title. This will cause the dummy plugin to be available in the AutoILL logic.
6) At the bottom of the form, on the "Verification" captcha, purposely input a wrong captcha e.g. '123'
7) Click 'Create'. Notice an odd looking form is presented, this is the dummy backend form, but it should present the 'Standard' form when using AutoILLBackendPriority as that was also the form we were presented with originally.
This happens because currently it's the backend that delegates back to Koha what template to render. When using AutoILLBackendPriority, however, Koha should handle this template delegation instead and present the Standard form.
8) Apply patches. Repeat test plan. Notice that now on step 7 you get the correct form, and error message (coming from Standard, as expected when using AutoILLBackendPriority).
9) Input the correct captcha this time
10) Confirm the created request landed in the PluginBackend backend.