[Koha-bugs] [Bug 32926] Cannot expand or collapse some System preference sections after a search

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Feb 9 15:20:14 CET 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32926

Andreas Roussos <a.roussos at dataly.gr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
              Alias|                            |Non-unique, HTML, <h3>,
                   |                            |heading, ids, in, System,
                   |                            |preferences, search,
                   |                            |results
           Assignee|oleonard at myacpl.org         |a.roussos at dataly.gr
                URL|                            |admin/preferences.pl
           See Also|                            |https://bugs.koha-community
                   |                            |.org/bugzilla3/show_bug.cgi
                   |                            |?id=3599,
                   |                            |https://bugs.koha-community
                   |                            |.org/bugzilla3/show_bug.cgi
                   |                            |?id=23410

--- Comment #1 from Andreas Roussos <a.roussos at dataly.gr> ---
This is happening because the page does not have unique ids for
the <h3> elements. To see for yourself, perform the steps to
reproduce, then open your web browser's Developer Tools (F12 key).
Now copy/paste the following code [*] in the JavaScript console
and press <ENTER>:

ids = Array.from(document.querySelectorAll('h3[id]'))
  .map(v => v.id)
  .reduce((acc, v) => { acc[v] = (acc[v] || 0) + 1; return acc }, {});
dupes = Object.entries(ids)
  .filter(([key, value]) => value > 1);
console.table(dupes);

You should get a table in the console window similar to the one below:
+---------+--------------+---+
| (index) | 0            | 1 |
+---------+--------------+---+
| 0       | 'Features'   | 3 |
| 1       | 'Policy'     | 2 |
| 2       | 'Appearance' | 2 |
+---------+--------------+---+

The table lists the <h3> ids that occur more than once in the DOM.
The 2nd column is the actual id value and the last column is the
number of occurences. Notice that the "Features" id occurs 3 times,
while "Policy" and "Appearance" occur 2 times each.

[*] Code adapted from https://stackoverflow.com/a/70373818

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list