We use a jQuery plugin, jstree (http://www.jstree.com/), for displaying authorities hierarchies in the OPAC and staff client. The version we use is incompatible with the latest version of jQuery. If we are to upgrade the version of jQuery we use in Koha we need to also upgrade jstree. The new version of jstree uses completely different configuration options, so all of the jstree code will have to be re-written. Since the new version of jstree is incompatible with the old version of jQuery we will have to upgrade them simultaneously.
I'm wrong. The old version of jstree does work with the latest jQuery. Upgrading at this time is not necessary.
This patch is too large to attach, so I've pushed it to a GitLab branch: https://gitlab.com/koha-dev/koha-dev/-/tree/bug-11783-upgrade-jstree Bug 11873: Upgrade jstree jQuery plugin to the latest version This patch upgrades the jstree plugin in the OPAC and the staff interface. The old version had compatibility issues with the latest jQuery. Also changed: When viewing an authority record in the OPAC's MARC view, clicking one of the hierarchy links should now open the MARC view again rather than reverting to the normal view. To test, apply the patch and rebuild the staff interface and OPAC CSS (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client). To test you must have the AuthDisplayHierarchy system preference enabled, and you must have some authorities data which can be displayed as a hierarchy. From the test plan for Bug 8523: "Create authority records with a hierarchy of see also fields (in MARC21/NORMARC, you'll be using 5xx fields for this, with a subfield $w = 'g' for broader terms and subfield $w = 'h' for narrower terms)" - Perform an authority search in the OPAC which will return one of your modified authority records. - View the record. - There should be an expanded tree menu at the top of the authority information. - Clicking the arrows in the tree should correctly expand and collapse the nodes. - Clicking the authority record link in the node should load that record. - Test also from the OPAC's MARC view of the authority record. - Confirm that clicking an authority record link in the MARC view opens the corresponding record in MARC view again. - Perform the same tests in the staff interface.
Hi! There are several known security vulnerabilities in jsTree 1.0-rc3, please see: https://snyk.io/vuln/npm:jstree. Can the importance be changed from P5-low to P1-high? and from normal to critical? Thanks!
The best way to get this bug moving is to test and sign off on the patch
I am trying this out in the Koha sandboxes, it seems the patches are not being applied when I check in the git.log. I tried various combinations. I tried for Enter repository url: https://gitlab.com/koha-dev/koha-dev https://gitlab.com/koha-dev/koha-dev/-/tree/bug-11783-upgrade-jstree https://gitlab.com/koha-dev/koha-dev.git And for branch, either "bug-11783-upgrade-jstree" or "https://gitlab.com/koha-dev/koha-dev/-/tree/bug-11783-upgrade-jstree".
Before signing this one off, just want to post my observation. Regarding "There should be an expanded tree menu at the top of the authority" means I am in the details page of the authority record. Because after searching for an authority record, I am presented with search results and when I go to the details page (/cgi-bin/koha/opac-authoritiesdetail.pl), that's the time I see a tree-like structure in the authorities. When I inspect the element for it, I see class "jstree-icon jstree-ocl" screenshot here: https://issuances-library.senate.gov.ph/sites/default/files/2022-01/jstree_screenshot.png. I can confirm that this is also present in MARC view as well as in the Administration panel.
Signing this one off, patch too large to be attached from the sandbox. Tested it and I can see tree-like structure as discussed in test plan and upon reading jstree plugin and also as observed and described in Comment #6. Thanks oleonard!
Do we really need to include the non-minified version of jstree?
(In reply to Jonathan Druart from comment #8) > Do we really need to include the non-minified version of jstree? It's not strictly necessary as long as the minified version includes version number information in it.
(In reply to Owen Leonard from comment #9) > (In reply to Jonathan Druart from comment #8) > > Do we really need to include the non-minified version of jstree? > > It's not strictly necessary as long as the minified version includes version > number information in it. Yes, that's my point. If someone wants to debug it is easy to retrieve the corresponding non-minified version.
Remote branch updated to remove the non-minified version.
Created attachment 129857 [details] [review] Bug 11873: Remove decoration on current authority Previously the current authority was not styled like a link. It was useful to have a visual feedback knowing which authority is currently displayed. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(In reply to Jonathan Druart from comment #12) > Created attachment 129857 [details] [review] [review] > Bug 11873: Remove decoration on current authority > > Previously the current authority was not styled like a link. It was > useful to have a visual feedback knowing which authority is currently > displayed. > > Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> This is a bit ugly (duplication code, and css applied with JS) but didn't find something better.
Hi, How should I push to master ? Merge the branch + this patch ? This branch does not exist anymore : https://gitlab.com/koha-dev/koha-dev/-/tree/bug-11783-upgrade-jstree
Created attachment 130411 [details] [review] Bug 11873: Upgrade jstree jQuery plugin to the latest version This patch upgrades the jstree plugin in the OPAC and the staff interface. The old version had compatibility issues with the latest jQuery. Also changed: When viewing an authority record in the OPAC's MARC view, clicking one of the hierarchy links should now open the MARC view again rather than reverting to the normal view. To test, apply the patch and rebuild the staff interface and OPAC CSS (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client). To test you must have the AuthDisplayHierarchy system preference enabled, and you must have some authorities data which can be displayed as a hierarchy. From the test plan for Bug 8523: "Create authority records with a hierarchy of see also fields (in MARC21/NORMARC, you'll be using 5xx fields for this, with a subfield $w = 'g' for broader terms and subfield $w = 'h' for narrower terms)" - Perform an authority search in the OPAC which will return one of your modified authority records. - View the record. - There should be an expanded tree menu at the top of the authority information. - Clicking the arrows in the tree should correctly expand and collapse the nodes. - Clicking the authority record link in the node should load that record. - Test also from the OPAC's MARC view of the authority record. - Confirm that clicking an authority record link in the MARC view opens the corresponding record in MARC view again. - Perform the same tests in the staff interface. Signed-off-by: Eugene Espinoza <eugenegf@yahoo.com>
Created attachment 130412 [details] [review] Bug 11873: Remove decoration on current authority Previously the current authority was not styled like a link. It was useful to have a visual feedback knowing which authority is currently displayed. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Patch Bug 11873: Remove decoration on current authority removes a [% END %] in koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth-MARCdetail.tt I fix that and reattach the patch Plus a patch to add missing TT filters
Created attachment 130418 [details] [review] Bug 11873: Remove decoration on current authority Previously the current authority was not styled like a link. It was useful to have a visual feedback knowing which authority is currently displayed. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 130419 [details] [review] Bug 11873: (QA follow-up) Add missing TT filters
Pushed to master for 22.05, thanks to everybody involved [U+1F984]
It this does need backported, please let me know!