Koha/koha-tmpl/opac-tmpl/bootstrap/en/includes
Andreas Roussos 24e54b1fd4
Bug 37226: append a random number to the id attribute of each <li>
When you view the authority details page for a term that contains more
than one terms with broader relationship, clicking on the expand/collapse
arrows next to the top-level terms in the hierarchy tree will not work
properly, i.e. *only one* broader term will show the narrower term under
it at any given time.

This is affecting both the OPAC and the Staff interface.

This is happening because in the HTML source of the page the individual
<li> elements associated with each node do not have unique `id` values,
which confuses the JavaScript library (jsTree) responsible for rendering
the hierarchy tree.

This patch fixes that by appending a random number to each `id` attribute.

Test plan:

0) Enable the AuthDisplayHierarchy System Preference (set to 'Show').

1) Copy the provided MARC21 Authority sample data (sample-data.mrc)
   to your KTD Koha container (it must have MARC21 marc flavour):

   docker cp sample-data.mrc koha-koha-1:/kohadevbox/

2) Import the provided authorities (the sample file contains three
   Geographic Name records):

   WARNING! the --delete switch is passed to bulkmarcimport.pl
   WARNING! this will erase any authority data you have in your instance!
   (this is done to retain the broader/narrower authid associations)

   misc/migration_tools/bulkmarcimport.pl --authorities --file=/kohadevbox/sample-data.mrc --verbose -c=MARC21 --delete -m=ISO2709

3) Visit the authority details page for 'Athens' in OPAC/Staff:

   http://localhost:8080/cgi-bin/koha/opac-authoritiesdetail.pl?authid=3
   http://localhost:8081/cgi-bin/koha/authorities/detail.pl?authid=3

   In the authority hierarchy tree, click the arrows next to 'Europe'
   and 'Greece' to expand and show the narrower term: notice how only
   one item works at any given time.

4) Apply the patch.

5) Repeat step 3) (refresh the pages) -- this time you should be able
   to view 'Athens' as a narrower term of both 'Europe' and 'Greece'
   at the same time.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2024-07-22 09:56:14 +01:00
..
modals
account-table.inc
accounts.inc
authorities-search-results.inc
authority-information.inc Bug 29948: (follow-up) Add CSS class to list items 2024-05-13 14:00:14 +02:00
av-build-dropbox.inc
biblio-title-head.inc
biblio-title.inc
bodytag.inc
calendar.inc Bug 37371: Move Maskito instantiation to onReady ( OPAC ) 2024-07-22 07:33:23 +01:00
columns_settings.inc
csrf-token.inc
datatables.inc
date-format.inc
display-library-address.inc
doc-head-close.inc Bug 33317: Add system preference to set meta robots for the OPAC 2024-06-25 18:34:17 +02:00
doc-head-open.inc
greybox.inc
holds-table.inc
html_helpers.inc
i18n.inc
ill-availability-table.inc
item-status.inc
js-biblio-format.inc
js-date-format.inc
masthead-langmenu.inc
masthead-sci.inc
masthead-sco.inc
masthead.inc Bug 30873: Add system preference to hide libraries link in the OPAC 2024-07-02 17:20:39 +02:00
navigation.inc
opac-authorities.inc Bug 37226: append a random number to the id attribute of each <li> 2024-07-22 09:56:14 +01:00
opac-bottom.inc
opac-detail-sidebar.inc
opac-facets.inc Bug 36905: Terminology: home locations / home collections 2024-06-27 17:24:36 +02:00
opac-note.inc Bug 35869: Removes the dismiss button from messages on OPAC SCO module 2024-06-11 11:55:42 +01:00
opac-topissues.inc
openlibrary-readapi.inc
overdrive-checkout.inc
overdrive-login.inc
page-numbers.inc
password_check.inc
patron-title.inc
resort_form.inc
result-batch-controls.inc Bug 36557: (follow-up) Restore missing "Remove from list" control 2024-07-01 18:55:44 +02:00
serial-status.inc
shelfbrowser.inc
slip-print.inc
subtypes_unimarc.inc
title-actions-menu.inc Bug 36557: Convert Cart and Lists controls to buttons and rework logic 2024-07-01 18:55:43 +02:00
user-star-ratings.inc
usermenu.inc
validator-strings.inc
xslt-handler.inc