Bug 27703 - Can't navigate in Authorized values
Summary: Can't navigate in Authorized values
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on: 25954
Blocks:
  Show dependency treegraph
 
Reported: 2021-02-15 07:59 UTC by Séverine Queune
Modified: 2021-12-13 21:09 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes an issue when navigating authorized value categories - if you selected an authorized value category from the drop down list it wouldn't change to the selected category.
Version(s) released in:
21.05.00,20.11.04,20.05.10
Circulation function:


Attachments
Bug 27703: Make ID of category select field unique (2.28 KB, patch)
2021-02-16 13:33 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 27703: Make ID of category select field unique (2.50 KB, patch)
2021-02-16 13:45 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 27703: Make ID of category select field unique (2.55 KB, patch)
2021-02-24 02:32 UTC, David Nind
Details | Diff | Splinter Review
Bug 27703: Make ID of category select field unique (2.61 KB, patch)
2021-03-03 10:35 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Séverine Queune 2021-02-15 07:59:55 UTC
When you are seeing a specific authorized value, it's no longer possible to go to another authorized value using the drop-down menu "Show category".
Comment 1 Jonathan Druart 2021-02-15 14:46:54 UTC
Hi Séverine, can you be more specific?

I am seeing the "Show category" on this view https://snipboard.io/Cda091.jpg

Do you mean when we edit an authorised value?
Comment 2 Séverine Queune 2021-02-15 15:45:07 UTC
Hi Jonathan !
Here is a capture made a few minutes ago on Biblibre's sandbox #1 :
https://prnt.sc/zmai4z
When I select a new category in the menu, it doesn't change.
When the page is slow to charge, I can see a "Submit" button that finally disappear.
Comment 3 Jonathan Druart 2021-02-15 16:18:00 UTC
Caused by 

  commit 38bc9eb2a8c01c8625b1c33c7e098cd0022b2710
  Bug 25954: Replace paragraph tags with labels in header search forms

Owen, can you have a look please? There are 2 elements with id=searchfield on this page.
Comment 4 Jonathan Druart 2021-02-15 16:19:40 UTC
This occurrence might be problematic as well:

koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt:        <input type="text" name="searchfield" id="searchfield" size="4" value="[% searchfield | html %]" />
Comment 5 Owen Leonard 2021-02-16 13:33:58 UTC
Created attachment 116923 [details] [review]
Bug 27703: Make ID of category select field unique

Duplicate element IDs on the authorized values page are invalid and
cause a problem with the JavaScript intended to submit the form when the
category select field changes.

This patch changes the ID of the label and the field and makes the
corresponding change to the JavaScript.

To test, apply the patch and go to Administration -> Authorized values.

 - Click an authorized value category to view its contents.
 - Using mouse or keyboard, make a selection from the "Show category"
   dropdown menu.
 - The form should submit automatically and direct you to the
   corresponding category.
 - Validate the HTML of the page and confirm that there are no errors.
Comment 6 Owen Leonard 2021-02-16 13:45:34 UTC
Created attachment 116924 [details] [review]
Bug 27703: Make ID of category select field unique

Duplicate element IDs on the authorized values page are invalid and
cause a problem with the JavaScript intended to submit the form when the
category select field changes.

This patch changes the ID of the label and the field and makes the
corresponding change to the JavaScript.

To test, apply the patch and go to Administration -> Authorized values.

 - Click an authorized value category to view its contents.
 - Using mouse or keyboard, make a selection from the "Show category"
   dropdown menu.
 - The form should submit automatically and direct you to the
   corresponding category.
 - Validate the HTML of the page and confirm that there are no errors.
Comment 7 David Nind 2021-02-24 02:32:01 UTC
Created attachment 117231 [details] [review]
Bug 27703: Make ID of category select field unique

Duplicate element IDs on the authorized values page are invalid and
cause a problem with the JavaScript intended to submit the form when the
category select field changes.

This patch changes the ID of the label and the field and makes the
corresponding change to the JavaScript.

To test, apply the patch and go to Administration -> Authorized values.

 - Click an authorized value category to view its contents.
 - Using mouse or keyboard, make a selection from the "Show category"
   dropdown menu.
 - The form should submit automatically and direct you to the
   corresponding category.
 - Validate the HTML of the page and confirm that there are no errors.

Signed-off-by: David Nind <david@davidnind.com>
Comment 8 David Nind 2021-02-24 02:40:18 UTC
Now works as expected when trying to change the category from the dropdown list.

Not exactly sure how you want the HTML validated. I used Firefox Developer tools, and the HTML Validator - 30 warnings, along the lines of "Warning: trimming empty <i>", "Warning: trimming empty <b>", "Warning: trimming empty <span>", and "Warning: '<' + '/' + letter not allowed here". The WAVE accessibility checker toolbar shows different errors and warnings.
Comment 9 Martin Renvoize (ashimema) 2021-03-03 10:35:17 UTC
Created attachment 117560 [details] [review]
Bug 27703: Make ID of category select field unique

Duplicate element IDs on the authorized values page are invalid and
cause a problem with the JavaScript intended to submit the form when the
category select field changes.

This patch changes the ID of the label and the field and makes the
corresponding change to the JavaScript.

To test, apply the patch and go to Administration -> Authorized values.

 - Click an authorized value category to view its contents.
 - Using mouse or keyboard, make a selection from the "Show category"
   dropdown menu.
 - The form should submit automatically and direct you to the
   corresponding category.
 - Validate the HTML of the page and confirm that there are no errors.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 10 Martin Renvoize (ashimema) 2021-03-03 10:36:18 UTC
Works as expected and passes QA scripts.

No duplicate ID errors during validation and other validation issues can be caught in new bugs.

Passing QA
Comment 11 Jonathan Druart 2021-03-03 10:59:37 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 12 Fridolin Somers 2021-03-04 12:22:15 UTC
Pushed to 20.11.x for 20.11.04
Comment 13 Andrew Fuerste-Henry 2021-03-14 19:09:39 UTC
Pushed to 20.05.x for 20.05.10
Comment 14 Victor Grousset/tuxayo 2021-03-23 06:23:08 UTC
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.