Bug 39446

Summary: OPAC ILL request status_alias is not displayed
Product: Koha Reporter: Pedro Amorim <pedro.amorim>
Component: ILLAssignee: Pedro Amorim <pedro.amorim>
Status: Pushed to main --- QA Contact: Marcel de Rooy <m.de.rooy>
Severity: minor    
Priority: P5 - low CC: david, m.de.rooy, pedro.amorim, slavashishkin, tadeusz, tomascohen
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Trivial patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
25.05.00
Circulation function:
Bug Depends on: 39600    
Bug Blocks:    
Attachments: Bug 39446: Show both status and status_alias
Bug 39446: Show both status and status_alias
Bug 39446: Show both status and status_alias
Bug 39446: Show both status and status_alias
Bug 39446: Show both status and status_alias
[24.11.x] Bug 39446: Show both status and status_alias

Description Pedro Amorim 2025-03-25 13:21:04 UTC

    
Comment 1 Pedro Amorim 2025-03-25 13:36:24 UTC
Created attachment 179684 [details] [review]
Bug 39446: Show both status and status_alias

If a request has a status_alias and that status_alias does not have a lib_opac defined, it'll show as an empty status on the OPAC.
Staff UI always shows the request's status and adds the status_alias only if that is defined. The same should happen on the OPAC.

To test:
1) Enabled ILLModule
2) Create a new ILL request, visit:
http://localhost:8081/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard
3) Add '42' on the cardnumber. Pick any library. Click 'Create'.
4) Add a new 'status_alias' entry, visit the authorized values page:
http://localhost:8081/cgi-bin/koha/admin/authorised_values.pl
5) Search for 'ill_'. Pick 'ILL_STATUS_ALIAS'. Click 'Add a new authorized value'.
6) Enter the 'Authorized value' of 'test', and 'Description' of 'test'. Click 'Save'.
7) Visit the previously created ILL request:
http://localhost:8081/cgi-bin/koha/ill/ill-requests.pl?op=illview&illrequest_id=1
8) Click 'Edit request' from the top toolbar.
9) On the 'Status' dropdown, pick 'test'. Click 'Submit'.
10) Visit the ILL on the OPAC:
http://localhost:8080/cgi-bin/koha/opac-illrequests.pl
11) Notice the 'status' column is empty. Click the 'View', notice the 'status' entry is empty.
12) Apply patch. Repeat
Comment 2 David Nind 2025-04-01 11:15:19 UTC
Created attachment 180130 [details] [review]
Bug 39446: Show both status and status_alias

If a request has a status_alias and that status_alias does not have a lib_opac defined, it'll show as an empty status on the OPAC.
Staff UI always shows the request's status and adds the status_alias only if that is defined. The same should happen on the OPAC.

To test:
1) Enabled ILLModule
2) Create a new ILL request, visit:
http://localhost:8081/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard
3) Add '42' on the cardnumber. Pick any library. Click 'Create'.
4) Add a new 'status_alias' entry, visit the authorized values page:
http://localhost:8081/cgi-bin/koha/admin/authorised_values.pl
5) Search for 'ill_'. Pick 'ILL_STATUS_ALIAS'. Click 'Add a new authorized value'.
6) Enter the 'Authorized value' of 'test', and 'Description' of 'test'. Click 'Save'.
7) Visit the previously created ILL request:
http://localhost:8081/cgi-bin/koha/ill/ill-requests.pl?op=illview&illrequest_id=1
8) Click 'Edit request' from the top toolbar.
9) On the 'Status' dropdown, pick 'test'. Click 'Submit'.
10) Visit the ILL on the OPAC:
http://localhost:8080/cgi-bin/koha/opac-illrequests.pl
11) Notice the 'status' column is empty. Click the 'View', notice the 'status' entry is empty.
12) Apply patch. Repeat

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2025-04-01 11:18:04 UTC
I've signed off, as it fixes this for the OPAC.

However, the staff interface needs fixing as well.

If the "Description" field is left blank, on the staff interface the status shows as "New request test" (test is in bold and italics).
Comment 4 Pedro Amorim 2025-04-15 09:41:29 UTC
Created attachment 180955 [details] [review]
Bug 39446: Show both status and status_alias

If a request has a status_alias and that status_alias does not have a lib_opac defined, it'll show as an empty status on the OPAC.
Staff UI always shows the request's status and adds the status_alias only if that is defined. The same should happen on the OPAC.

To test:
1) Enabled ILLModule
2) Create a new ILL request, visit:
http://localhost:8081/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard
3) Add '42' on the cardnumber. Pick any library. Click 'Create'.
4) Add a new 'status_alias' entry, visit the authorized values page:
http://localhost:8081/cgi-bin/koha/admin/authorised_values.pl
5) Search for 'ill_'. Pick 'ILL_STATUS_ALIAS'. Click 'Add a new authorized value'.
6) Enter the 'Authorized value' of 'test', and 'Description' of 'test'. Click 'Save'.
7) Visit the previously created ILL request:
http://localhost:8081/cgi-bin/koha/ill/ill-requests.pl?op=illview&illrequest_id=1
8) Click 'Edit request' from the top toolbar.
9) On the 'Status' dropdown, pick 'test'. Click 'Submit'.
10) Visit the ILL on the OPAC:
http://localhost:8080/cgi-bin/koha/opac-illrequests.pl
11) Notice the 'status' column does not display the status_alias. Click the 'View', notice the 'status' entry does not display the status_alias.
12) Apply patch. Repeat. Notice it defaults to displaying the authorised value code if lib_opac is empty.
Comment 5 Pedro Amorim 2025-04-15 09:45:13 UTC
Thank you David.
I've revisited this and reimplemented it as depending on bug 39600.
Bug 39600 implicitly fixed the issue of the status showing empty if the status_alias was defined with an empty lib_opac.
I'm also updating the title here to better reflect what this is now doing, which is adding the display of the status_alias next to the status on both table and view, similar to how it happens in Staff UI.

(In reply to David Nind from comment #3)

> However, the staff interface needs fixing as well.
> 
> If the "Description" field is left blank, on the staff interface the status
> shows as "New request test" (test is in bold and italics).

I believe this is the intended behavior i.e. default to the AV code if an appropriate UI description doesn't exist.
Comment 6 Brendan Gallagher 2025-04-15 22:49:20 UTC
Created attachment 180999 [details] [review]
Bug 39446: Show both status and status_alias

If a request has a status_alias and that status_alias does not have a lib_opac defined, it'll show as an empty status on the OPAC.
Staff UI always shows the request's status and adds the status_alias only if that is defined. The same should happen on the OPAC.

To test:
1) Enabled ILLModule
2) Create a new ILL request, visit:
http://localhost:8081/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard
3) Add '42' on the cardnumber. Pick any library. Click 'Create'.
4) Add a new 'status_alias' entry, visit the authorized values page:
http://localhost:8081/cgi-bin/koha/admin/authorised_values.pl
5) Search for 'ill_'. Pick 'ILL_STATUS_ALIAS'. Click 'Add a new authorized value'.
6) Enter the 'Authorized value' of 'test', and 'Description' of 'test'. Click 'Save'.
7) Visit the previously created ILL request:
http://localhost:8081/cgi-bin/koha/ill/ill-requests.pl?op=illview&illrequest_id=1
8) Click 'Edit request' from the top toolbar.
9) On the 'Status' dropdown, pick 'test'. Click 'Submit'.
10) Visit the ILL on the OPAC:
http://localhost:8080/cgi-bin/koha/opac-illrequests.pl
11) Notice the 'status' column does not display the status_alias. Click the 'View', notice the 'status' entry does not display the status_alias.
12) Apply patch. Repeat. Notice it defaults to displaying the authorised value code if lib_opac is empty.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Comment 7 Marcel de Rooy 2025-04-18 06:30:09 UTC
Created attachment 181146 [details] [review]
Bug 39446: Show both status and status_alias

If a request has a status_alias and that status_alias does not have a lib_opac defined, it'll show as an empty status on the OPAC.
Staff UI always shows the request's status and adds the status_alias only if that is defined. The same should happen on the OPAC.

To test:
1) Enabled ILLModule
2) Create a new ILL request, visit:
http://localhost:8081/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard
3) Add '42' on the cardnumber. Pick any library. Click 'Create'.
4) Add a new 'status_alias' entry, visit the authorized values page:
http://localhost:8081/cgi-bin/koha/admin/authorised_values.pl
5) Search for 'ill_'. Pick 'ILL_STATUS_ALIAS'. Click 'Add a new authorized value'.
6) Enter the 'Authorized value' of 'test', and 'Description' of 'test'. Click 'Save'.
7) Visit the previously created ILL request:
http://localhost:8081/cgi-bin/koha/ill/ill-requests.pl?op=illview&illrequest_id=1
8) Click 'Edit request' from the top toolbar.
9) On the 'Status' dropdown, pick 'test'. Click 'Submit'.
10) Visit the ILL on the OPAC:
http://localhost:8080/cgi-bin/koha/opac-illrequests.pl
11) Notice the 'status' column does not display the status_alias. Click the 'View', notice the 'status' entry does not display the status_alias.
12) Apply patch. Repeat. Notice it defaults to displaying the authorised value code if lib_opac is empty.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 8 Katrin Fischer 2025-04-25 17:28:14 UTC
Pushed for 25.05!

Well done everyone, thank you!
Comment 9 Pedro Amorim 2025-05-19 11:05:12 UTC
Created attachment 182591 [details] [review]
[24.11.x] Bug 39446: Show both status and status_alias

If a request has a status_alias and that status_alias does not have a lib_opac defined, it'll show as an empty status on the OPAC.
Staff UI always shows the request's status and adds the status_alias only if that is defined. The same should happen on the OPAC.

To test:
1) Enabled ILLModule
2) Create a new ILL request, visit:
http://localhost:8081/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard
3) Add '42' on the cardnumber. Pick any library. Click 'Create'.
4) Add a new 'status_alias' entry, visit the authorized values page:
http://localhost:8081/cgi-bin/koha/admin/authorised_values.pl
5) Search for 'ill_'. Pick 'ILL_STATUS_ALIAS'. Click 'Add a new authorized value'.
6) Enter the 'Authorized value' of 'test', and 'Description' of 'test'. Click 'Save'.
7) Visit the previously created ILL request:
http://localhost:8081/cgi-bin/koha/ill/ill-requests.pl?op=illview&illrequest_id=1
8) Click 'Edit request' from the top toolbar.
9) On the 'Status' dropdown, pick 'test'. Click 'Submit'.
10) Visit the ILL on the OPAC:
http://localhost:8080/cgi-bin/koha/opac-illrequests.pl
11) Notice the 'status' column is empty. Click the 'View', notice the 'status' entry is empty.
12) Apply patch. Repeat
Comment 10 Pedro Amorim 2025-05-19 11:06:06 UTC
Submitting a 24.11.x version here prior to bug 39600 since we backported this to our customers anyway. Up to RMaint if they want to backport or not.