Bug 37127

Summary: Authorized values select not working on authority forms
Product: Koha Reporter: Kdask <kdask>
Component: CatalogingAssignee: Phil Ringnalda <phil>
Status: RESOLVED FIXED QA Contact: Emily Lamancusa (emlam) <emily.lamancusa>
Severity: major    
Priority: P5 - low CC: david, emily.lamancusa, fridolin.somers, lucas, m.de.rooy, phil
Version: 24.05   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This fixes the add and edit forms for authority records that use authorized values for subfields - values for these subfields can now be selected using a dropdown list. After the CSRF changes in 24.05 to improve form security, no dropdown list for selecting the subfield value was displayed.
Version(s) released in:
24.11.00,24.05.02
Circulation function:
Bug Depends on:    
Bug Blocks: 36192    
Attachments: Bug 37127: Authorized value select not working on authority forms
Bug 37127: Authorized value select not working on authority forms
Bug 37127: Authorized value select not working on authority forms

Description Kdask 2024-06-19 11:02:47 UTC
When connecting an authorized value on a subfield on Authority Type framework configuration (Example: 040$b - Authorized value: LANG) the Select widget (Select2?) on the cataloging form (Edit/New) is not working.

This seems to happen for any connection on any authorized values/subfields only on authorities cataloging.
Tried creating new authorized value category etc, but the behavior is the same.

Thanks
Comment 1 Phil Ringnalda 2024-06-19 17:13:27 UTC
Created attachment 167884 [details] [review]
Bug 37127: Authorized value select not working on authority forms

Linking an authority subfield to an authorized value just leaves a blank
in the form rather than creating a <select>, because there's a stray cud-
in the type returned from build_authorized_values_list.

Test plan:
 1. Without the patch, Administration - Authority types - Actions menu for
    Default - MARC Structure
 2. Actions menu for 040 - Subfields
 3. Edit subfields - Tab b - Authorized value - set to LANG - Save changes
 4. Authorities - New authority - Default
 5. In 040 tag, click CATALOGING SOURCE to expand the tag
 6. Note that subfield b has a blank space rather than a dropdown menu
 7. Apply patch, restart_all
 8. Authorities - New authority - Default
 9. In 040 tag, click CATALOGING SOURCE to expand the tag
10. Note that subfield b has a dropdown menu listing language names
Comment 2 David Nind 2024-06-19 18:50:18 UTC
Created attachment 167892 [details] [review]
Bug 37127: Authorized value select not working on authority forms

Linking an authority subfield to an authorized value just leaves a blank
in the form rather than creating a <select>, because there's a stray cud-
in the type returned from build_authorized_values_list.

Test plan:
 1. Without the patch, Administration - Authority types - Actions menu for
    Default - MARC Structure
 2. Actions menu for 040 - Subfields
 3. Edit subfields - Tab b - Authorized value - set to LANG - Save changes
 4. Authorities - New authority - Default
 5. In 040 tag, click CATALOGING SOURCE to expand the tag
 6. Note that subfield b has a blank space rather than a dropdown menu
 7. Apply patch, restart_all
 8. Authorities - New authority - Default
 9. In 040 tag, click CATALOGING SOURCE to expand the tag
10. Note that subfield b has a dropdown menu listing language names

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Emily Lamancusa (emlam) 2024-06-20 20:43:19 UTC
Created attachment 167942 [details] [review]
Bug 37127: Authorized value select not working on authority forms

Linking an authority subfield to an authorized value just leaves a blank
in the form rather than creating a <select>, because there's a stray cud-
in the type returned from build_authorized_values_list.

Test plan:
 1. Without the patch, Administration - Authority types - Actions menu for
    Default - MARC Structure
 2. Actions menu for 040 - Subfields
 3. Edit subfields - Tab b - Authorized value - set to LANG - Save changes
 4. Authorities - New authority - Default
 5. In 040 tag, click CATALOGING SOURCE to expand the tag
 6. Note that subfield b has a blank space rather than a dropdown menu
 7. Apply patch, restart_all
 8. Authorities - New authority - Default
 9. In 040 tag, click CATALOGING SOURCE to expand the tag
10. Note that subfield b has a dropdown menu listing language names

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Comment 4 Katrin Fischer 2024-06-21 13:04:46 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 5 Lucas Gass (lukeg) 2024-07-18 19:25:58 UTC
Backported to 24.05.x for upcoming 24.05.02
Comment 6 Fridolin Somers 2024-07-19 08:36:03 UTC
Full CSRF not in 23.11.x
Comment 7 Phil Ringnalda 2024-09-10 23:44:10 UTC
Just a temporary bug, nothing to document.