Bug 32926: Assign unique ids to <h3> elements
authorAndreas Roussos <a.roussos@dataly.gr>
Fri, 17 Feb 2023 15:05:20 +0000 (16:05 +0100)
committerLucas Gass <lucas@bywatersolutions.com>
Wed, 8 Mar 2023 14:02:21 +0000 (14:02 +0000)
commit386f45da1272fd5078575bff41597fd15bf53c47
treea71f7d17a691a598bb8be5dc38f5dab316f6aac3
parent3681c928790319a9eeb6b6cb5ea4c9e9a01a6fe4
Bug 32926: Assign unique ids to <h3> elements

If you perform a System preferences search for a common word
such as "type", you lose the ability to expand or collapse some
sections. In particular, you cannot expand/collapse the sections
with names that appear more than once in the results page.
All sections except the first one in each group of duplicates
are affected by this. See https://imgur.com/a/NSslIcV for a demo.

This patch fixes that by prepending the <h3> ids with the
top-level System preference section name to make them unique.

Test plan:

1) Perform a System preferences search for a common word such
   as "type" or "log". In the results page, the "Policy" section
   will appear more than once. Now try to expand/collapse any
   "Policy" section but the first one. It won't work, only the
   first "Policy" section is toggled.
2) Apply this patch and refresh the page.
3) This time you should be able to expand or collapse all of
   the available system preference sections.
4) Clicking on the "View all xxx preferences" links on the
   right hand side should take you to the correct System
   preferences tab *and* automatically scroll the appropriate
   section into view at the top of the page.

Signed-off-by: Fridolin <fridolin.somers@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 28a0c039fe9dec3ac97f069f30638ca24bcbf338)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
(cherry picked from commit b73230a5f45d799a248c767ef3d6f2d9e0e37da0)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt