[Bug 37226] New: Authority hierarchy tree broken when a child (narrower) term appears under more than one parent (greater) term
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37226 Bug ID: 37226 Summary: Authority hierarchy tree broken when a child (narrower) term appears under more than one parent (greater) term Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: MARC Authority data support Assignee: koha-bugs@lists.koha-community.org Reporter: a.roussos@dataly.gr QA Contact: testopia@bugs.koha-community.org Created attachment 168314 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168314&action=edit short screen recording that shows the bug in action With AuthDisplayHierarchy enabled and the following MARC21 authority data: 001 1 151 $a Europe 551 $a Athens $w h $9 3 942 $a GEOGR_NAME 001 2 151 $a Greece 551 $a Athens $w h $9 3 942 $a GEOGR_NAME 001 3 151 $a Athens 551 $a Europe $w g $9 1 551 $a Greece $w g $9 2 942 $a GEOGR_NAME In the authority details page for 'Athens' (authid=3), clicking on the expand/collapse arrows next to the top-level terms in the hierarchy tree ('Europe' and 'Greece') will not work properly, i.e. *only one* broader term will show 'Athens' as its narrower term at any given time. I attach a small screen recording that shows this in action. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37226 Andreas Roussos <a.roussos@dataly.gr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|koha-bugs@lists.koha-commun |a.roussos@dataly.gr |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37226 --- Comment #1 from Andreas Roussos <a.roussos@dataly.gr> --- 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. The simple fix is to append a random number to each `id` attribute. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37226 --- Comment #2 from Andreas Roussos <a.roussos@dataly.gr> --- Created attachment 168318 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168318&action=edit Sample MARC data in ISO2709 format (contains three authority records) I upload an .mrc file containing some sample MARC authority data, this is meant to be used in the test plan. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37226 Andreas Roussos <a.roussos@dataly.gr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37226 --- Comment #3 from Andreas Roussos <a.roussos@dataly.gr> --- Created attachment 168319 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168319&action=edit 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 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': 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 page) -- this time you should be able to view 'Athens' as a narrower term of both 'Europe' and 'Greece' at the same time. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37226 Andreas Roussos <a.roussos@dataly.gr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168319|0 |1 is obsolete| | --- Comment #4 from Andreas Roussos <a.roussos@dataly.gr> --- Created attachment 168320 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168320&action=edit 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. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37226 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37226 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168320|0 |1 is obsolete| | --- Comment #5 from David Nind <david@davidnind.com> --- Created attachment 168335 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168335&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37226 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #6 from David Nind <david@davidnind.com> --- I think the commit message title needs amending (to follow the commit message guidelines https://wiki.koha-community.org/wiki/Commit_messages). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37226 --- Comment #7 from Andreas Roussos <a.roussos@dataly.gr> --- (In reply to David Nind from comment #6)
I think the commit message title needs amending (to follow the commit message guidelines https://wiki.koha-community.org/wiki/Commit_messages). Hi David, and thanks for the speedy Sign Off!
The current commit message title is: "Bug 37226: append a random number to the `id` attribute of each <li>" I think it meets the guidelines given in the wiki page you refer to? If not, can you elaborate on what needs changing? Thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37226 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #8 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Andreas Roussos from comment #7)
(In reply to David Nind from comment #6)
I think the commit message title needs amending (to follow the commit message guidelines https://wiki.koha-community.org/wiki/Commit_messages). Hi David, and thanks for the speedy Sign Off!
The current commit message title is: "Bug 37226: append a random number to the `id` attribute of each <li>"
I think it meets the guidelines given in the wiki page you refer to?
If not, can you elaborate on what needs changing? Thank you!
I cant see the problem either with that title. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37226 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37226 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168335|0 |1 is obsolete| | --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 169188 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=169188&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37226 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37226 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |24.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37226 --- Comment #10 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Thanks for all the hard work! Pushed to main for the next 24.11.00 release as RM Assistant -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37226 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Version(s)|24.11.00 |24.11.00,24.05.04 released in| | Status|Pushed to main |Pushed to stable --- Comment #11 from Lucas Gass <lucas@bywatersolutions.com> --- Backported to 24.05.x for upcoming 24.05.04 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37226 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable CC| |fridolin.somers@biblibre.co | |m Version(s)|24.11.00,24.05.04 |24.11.00,24.05.04,23.11.09 released in| | --- Comment #12 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.11.x for 23.11.09 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37226 --- Comment #13 from Fridolin Somers <fridolin.somers@biblibre.com> --- Maybe we could create a TT template to generate the random number (without dot) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37226 wainuiwitikapark@catalyst.net.nz changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wainuiwitikapark@catalyst.n | |et.nz --- Comment #14 from wainuiwitikapark@catalyst.net.nz --- Not backporting to 23.05.x unless requested -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37226 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |Needs documenting --- Comment #15 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Not backporting to 22.11 unless requested -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org