Bug 11426 - Make HighlightOwnItemsOnOPAC work with XSLT
Summary: Make HighlightOwnItemsOnOPAC work with XSLT
Status: CLOSED WONTFIX
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on: 7740 15758
Blocks: 12561
  Show dependency treegraph
 
Reported: 2013-12-19 14:39 UTC by Nicole C. Engard
Modified: 2022-06-06 20:24 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 11426: Restore HighlightOwnItemsOnOPAC for XSLT view (1.84 KB, patch)
2019-10-23 14:48 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 11426: [POC] Make HighlightOwnItemsOnOPAC work with XSLT (5.16 KB, patch)
2020-04-21 14:23 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nicole C. Engard 2013-12-19 14:39:13 UTC
It would be nice if the HighlightOwnItemsOnOPAC preference worked on sites using XSLT
Comment 1 Christopher Brannon 2019-09-07 02:40:25 UTC
I agree.  This is still an issue.  While at this time, it does move the item(s), it does not increase the size of the font or highlight the row.

I would also add it would be nice it the prefernce allowed you to choose both options for detection, rather than either or.
Comment 2 Owen Leonard 2019-09-08 19:43:06 UTC
In my quick test this looks like it works with or without XSLT on the detail page and neither with or without XSLT on the results page. Can anyone confirm?
Comment 3 Christopher Brannon 2019-09-09 18:04:19 UTC
(In reply to Owen Leonard from comment #2)
> In my quick test this looks like it works with or without XSLT on the detail
> page and neither with or without XSLT on the results page. Can anyone
> confirm?

I can confirm that for us, it puts the items at the top of the list, but I don't see any font changes or highlighting.  I think we have XSLT in use, but am not sure.
Comment 4 Jonathan Druart 2019-10-23 14:40:09 UTC
Detail page: The highlight is supposed to be done adding a "highlight-row-detail" class, but it does not appear in the css file.

Result page: The code has been copied from the detail page, but... cannot work.
A class is also used, highlight-row-results, but is never set. The 'branchcode' key that is compared with $branchcode:
 850                             if ( $item->{branchcode} eq $branchcode ) {
does not exist (not set by searchResults)
Comment 5 Jonathan Druart 2019-10-23 14:41:10 UTC
(In reply to Jonathan Druart from comment #4)
> Result page: The code has been copied from the detail page, but... cannot
> work.
> A class is also used, highlight-row-results, but is never set. The
> 'branchcode' key that is compared with $branchcode:
>  850                             if ( $item->{branchcode} eq $branchcode ) {
> does not exist (not set by searchResults)

=> This is actually a regression, my bad.
  commit df97814f3034a3d5015546c4eca21f08ae951e37
  Bug 15758: Koha::Libraries - Remove GetBranches
Comment 6 Jonathan Druart 2019-10-23 14:48:32 UTC
Created attachment 94631 [details] [review]
Bug 11426: Restore HighlightOwnItemsOnOPAC for XSLT view
Comment 7 Jonathan Druart 2019-10-23 14:49:37 UTC
With this page you will get the feature working as expected with the non-XSLT views (do not forget `yarn build --view opac`)
Comment 8 Katrin Fischer 2020-01-05 11:44:55 UTC
Should this be 'Needs signoff'?
Comment 9 Jonathan Druart 2020-01-05 21:30:10 UTC
(In reply to Katrin Fischer from comment #8)
> Should this be 'Needs signoff'?

No, see my previous comment.
It only makes the feature work for non-XSLT view. We need it for the XSLT view.
Comment 10 Jonathan Druart 2020-04-21 14:23:48 UTC
Created attachment 103379 [details] [review]
Bug 11426: [POC] Make HighlightOwnItemsOnOPAC work with XSLT

This xsl syntax is insane. We should add this ugly choose test all over
this xsl file, then also in the detail page (with the class highlight-row-detail).

Note that the non-XSLT view use HighlightOwnItemsOnOPACWhich that can be
'OpacURLBranch'. In that case we should not test
logged_in_user_branchcode, but $ENV{BRANCHCODE}. However since we use
plack this feature may have been lost.
Comment 11 Jonathan Druart 2020-04-21 14:24:10 UTC
This is a way to go, feel free to continue the job if you need it.
Comment 12 Owen Leonard 2020-06-05 16:09:44 UTC
Jonathan are you unsatisfied with your solution for some reason? What do you think is unfinished?
Comment 13 Jonathan Druart 2020-06-11 11:23:13 UTC
I cannot remember exactly but I think the answer is in the patch comment:

"""
This xsl syntax is insane. We should add this ugly choose test all over
this xsl file, then also in the detail page (with the class highlight-row-detail).
"""
Comment 14 Jonathan Druart 2021-06-18 14:18:42 UTC
This non-XSLT feature will be removed on bug 12561.