Bug 36197 - Allow for OPAC unauthenticated ILL request
Summary: Allow for OPAC unauthenticated ILL request
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: ILL (show other bugs)
Version: Main
Hardware: All All
: P5 - low new feature (vote)
Assignee: Pedro Amorim
QA Contact:
URL: https://github.com/PTFS-Europe/koha/c...
Keywords: Sandbox
Depends on: 35604
Blocks:
  Show dependency treegraph
 
Reported: 2024-02-28 16:44 UTC by Pedro Amorim
Modified: 2024-07-03 14:21 UTC (History)
10 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Medium patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro Amorim 2024-02-28 16:44:38 UTC

    
Comment 1 Pedro Amorim 2024-04-24 14:34:01 UTC Comment hidden (obsolete)
Comment 2 Pedro Amorim 2024-05-17 14:09:19 UTC
This is ready for testing. Branch at:
https://github.com/PTFS-Europe/koha/commits/b_36197

0) If k-t-d, run updatedatabase (ignore this if testing on a sandbox)
1) Enable ILLModule syspref:
  {staff_url}/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=ILLModule
2) No need to install a backend as 35570 is in the tree
3) On a different browser session, without being lgoged in, access the create ILL request OPAC page directly:
  {opac_url}/cgi-bin/koha/opac-illrequests.pl?method=create&backend=Standard
4) Notice you're presented with the login page, as expected
5) Enable ILLOpacUnauthenticatedRequest:
  {staff_url}/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=ILLOpacUnauthenticatedRequest
6) Repeat step 3) Notice you now get the create ILL request form, with some additional inputs at the top specific to an unauthenticated request (first name, last name, e-mail address)
6.5) (optional) Confirm the 'Make an Interlibrary loan request' link exists at the bottom of the search results page, while unauthenticated on OPAC:
  {opac_url}/cgi-bin/koha/opac-search.pl?idx=&q=music&weight_search=1
  This should only show for authenticated OPAC users if ILLOpacUnauthenticatedRequest is off.
7) Test the form, try submitting with some blank fields, change type and library after and before inputing data in the input fields, etc.
8) Submit the form successfully. Notice you're presented with the unauthenticated request submission confirmation screen with a message and request details.
9) Go back to Staff UI, logged in, access ILL requests and confirm the unauthenticated request submitted through the OPAC is there:
  {staff_url}/cgi-bin/koha/ill/ill-requests.pl
10) Test that you can add a patron afterwards, if needed, by clicking 'Edit request' on the toolbar of the manage request page, and entering a patron ID
11) Test that you're able to 'confirm' the request by clicking 'Confirm request', as if it was a regular 'NEW' request.

Additional testing:
 Make sure existing ILL functionality interacts with this new optional workflow behavior.
 For this, we're using ILLModuleDisclaimerByType. ILLCheckAvailability or AutoILLBackendPriority can also be used but require more setup (plugins, credentials, etc)
1) Configure ILLModuleDisclaimerByType, visit
  {staff_url}/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=ILLModuleDisclaimerByType
2) Click the 'edit' link at the bottom of the syspref and copy the example code from the description into the text box. Save.
3) Repeat the original test plan from above, but make sure the request type is not 'article' (as that type is bypassed). Use 'journal', for example. Submit the request making sure you fill in all mandatory fields.
4) Notice you're now presented with the ILL request disclaimer screen, hit Submit. Notice the request is created as before.
5) Return to Staff UI, logged in, confirm this 2nd unauthenticated request has been created and the type disclaimer info is stored and presented when viewing the request.

Run tests (k-t-d only):
  prove t/db_dependent/Koha/ILL/Backends.t
  prove t/db_dependent/selenium/opac_ill_requests.t

Sponsored-by: NHS England (National Health Service England)
Comment 3 David Nind 2024-05-20 04:08:54 UTC
I had a go at testing. I haven't signed off yet, mainly because of the error noted in note 5.

Notes from testing (using KTD):

1. Step 8: When you submit the request for type 'Book' (when unauthenticated) and visit the link, you go to a newly created record. This is discoverable by searching. None of the other types creates a record.

2. Additional testing - step 3: I only tested with ILLModuleDisclaimerByType. I don't get a type of 'article', but I think that is the code for 'Journal article'? I get Book, Chapter, Journal, Journal article, Thesis, Conference, DVD, Other, Generic resource.

3. On the input form, compulsory fields have an asterisk after the field label, but nothing to say that these are mandatory (that is, an explanation for the *). When you submit without completing a mandatory field, a plain text message appears at the top. This is different from the "normal" way of presenting forms in the OPAC, but I think you are aware of that 8-).

4. Before or after submitting the form when unauthenticated, the breadcrumb link ('Interlibrary loan requests') comes up with the 'Login to your account' form.

5. If request type is DVD, I get an error trace:

   Template process failed: file error - /kohadevbox/koha/Koha/ILL/Backend/shared-includes/forms/dvd.inc: not found at /kohadevbox/koha/C4/Templates.pm line 134

    in C4::Templates::output at /kohadevbox/koha/C4/Templates.pm line 134
    ....

6. If the request type is Other, there are no additional fields to complete (you can add custom fields).

7. Tests pass. Note: need to start up KTD with Selenium (ktd --selenium up).
Comment 4 Pedro Amorim 2024-05-21 08:41:01 UTC
Hi David, great testing as usual thank you so much.
1) Good point. This is default behavior (for book type) that precedes this work. I'm open to suggestions but have kept this unchanged for now.
2) Correct, 'article' is the code for 'Journal article'
3) Fair points about the form / required fields. As before, I'm open to suggestions but this is default behavior that precedes this work so I've not addressed this here.
4) Thanks for this, will look for providing a follow-up for it.
5) The DVD error, I believe is unrelated to this development and comes from the original commit that added it:
https://github.com/PTFS-Europe/koha-ill-freeform/commit/9d735a2dce267d67b4396a0a33d7cb9521a1dfbe
I believe a required shared-includes/forms/dvd.inc is missing here. I've added Lucas in case he wishes/is available to provide a follow-up here.
6) For the 'other' request type, having no input fields is expected I believe as there's no way what 'other' would have as input hence only considering the custom fields.
Comment 5 David Nind 2024-05-23 06:14:28 UTC
(In reply to Pedro Amorim from comment #4)
> Hi David, great testing as usual thank you so much.
> 1) Good point. This is default behavior (for book type) that precedes this
> work. I'm open to suggestions but have kept this unchanged for now.
> 2) Correct, 'article' is the code for 'Journal article'
> 3) Fair points about the form / required fields. As before, I'm open to
> suggestions but this is default behavior that precedes this work so I've not
> addressed this here.
> 4) Thanks for this, will look for providing a follow-up for it.
> 5) The DVD error, I believe is unrelated to this development and comes from
> the original commit that added it:
> https://github.com/PTFS-Europe/koha-ill-freeform/commit/
> 9d735a2dce267d67b4396a0a33d7cb9521a1dfbe
> I believe a required shared-includes/forms/dvd.inc is missing here. I've
> added Lucas in case he wishes/is available to provide a follow-up here.
> 6) For the 'other' request type, having no input fields is expected I
> believe as there's no way what 'other' would have as input hence only
> considering the custom fields.

Thanks Pedro!

Please add my sign off to the bug.
Comment 6 Pedro Amorim 2024-05-27 14:32:31 UTC
Signed-off-by: David Nind <david@davidnind.com>