Bug 12655 - PROG/CCSR deprecation: Correct hard-coded opac-tmpl/prog path in XSLT
Summary: PROG/CCSR deprecation: Correct hard-coded opac-tmpl/prog path in XSLT
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 11346
  Show dependency treegraph
 
Reported: 2014-07-24 16:18 UTC by Owen Leonard
Modified: 2015-06-04 23:23 UTC (History)
4 users (show)

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


Attachments
Bug 12655 - PROG/CCSR deprecation: Correct hard-coded opac-tmpl/prog path in XSLT (6.47 KB, patch)
2014-07-24 16:50 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 12655 [Revised] PROG/CCSR deprecation: Correct hard-coded opac-tmpl/prog path in XSLT (9.75 KB, patch)
2014-08-12 14:26 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 12655 [Revised] PROG/CCSR deprecation: Correct hard-coded opac-tmpl/prog path in XSLT (9.76 KB, patch)
2014-08-16 01:43 UTC, Chris Cormack
Details | Diff | Splinter Review
Doubled up magnifying glass (41.44 KB, image/png)
2014-08-16 08:31 UTC, Katrin Fischer
Details
Bug 12655 [Revised] PROG/CCSR deprecation: Correct hard-coded opac-tmpl/prog path in XSLT (9.04 KB, patch)
2014-08-20 13:27 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 12655 [Revised] PROG/CCSR deprecation: Correct hard-coded opac-tmpl/prog path in XSLT (9.06 KB, patch)
2014-09-17 22:18 UTC, Brendan Gallagher
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2014-07-24 16:18:19 UTC
Several OPAC XSL files in the bootstrap template contain hard-coded paths to the prog theme.
Comment 1 Owen Leonard 2014-07-24 16:50:23 UTC Comment hidden (obsolete)
Comment 2 Bernardo Gonzalez Kriegel 2014-07-26 00:02:20 UTC
This works for you? Not for me :(

First 'opacthemes' need to be added to C4/XSLT.pm list of usable sysprefs

Second I think the proper syntax is

<xsl:element name="img">
  <xsl:attribute name="src">/opac-tmpl/<xsl:value-of select="$theme"/>/images/filefind.png</xsl:attribute>
  <xsl:attribute name="style">vertical-align:middle</xsl:attribute>
  <xsl:attribute name="height">15</xsl:attribute>
  <xsl:attribute name="width">15</xsl:attribute>
</xsl:element>

With your patch i got "http://.../opac-tmpl/%24theme/images/filefind.png"
Comment 3 Owen Leonard 2014-08-12 14:26:52 UTC Comment hidden (obsolete)
Comment 4 Owen Leonard 2014-08-12 14:28:04 UTC
(In reply to Bernardo Gonzalez Kriegel from comment #2)

> This works for you? Not for me :(

It really did! But it must have been a quirk of that machine's setup. Thanks for testing. I have implemented your suggestions.
Comment 5 Chris Cormack 2014-08-16 01:43:14 UTC Comment hidden (obsolete)
Comment 6 Katrin Fischer 2014-08-16 08:22:16 UTC
I am not sure about this change, as we recently agreed to keep the fallback functionality - so if you don't have a file in your selected theme, it should fall back to a main theme for the templates. I think it might be harder to do here and the patch is an improvement - hardcoding prog is not exactly a fallback right now :) So I am going to test.
Comment 7 Katrin Fischer 2014-08-16 08:31:51 UTC
Created attachment 30872 [details]
Doubled up magnifying glass

With the patch applied, I have 2 magnifying glasses show up for the record. On the master branch only one shows up. The second one is not linked.

MARC21:
650 		7	
_0(DE-588c)4127914-1
_0(DE-576)209597631
_2swd
_aChronik
_989 

HTML:
<span class="label">Subject(s): </span>
<span property="keywords">
  <a href="/cgi-bin/koha/opac-search.pl?q=an:89">Chronik</a>
</span>
  <a class="authlink" href="/cgi-bin/koha/opac-authoritiesdetail.pl?authid=89"><img src="/opac-tmpl/bootstrap/images/filefind.png" style="vertical-align:middle" height="15" width="15"></a>
</span><img src="/opac-tmpl/bootstrap/images/filefind.png" style="vertical-align:middle" height="15" width="15">
Comment 8 Owen Leonard 2014-08-20 13:27:11 UTC Comment hidden (obsolete)
Comment 9 Bernardo Gonzalez Kriegel 2014-08-20 20:05:55 UTC
Hi,
have an idea and a problem with this

1) Idea: build this on top of Bug 12539, in that a syspref OPACFallback is introduced. Using that instead of 'opacthemes' could make this patch valid using 'ccsr', also provides the fallback mentioned in Commet #6

2) Problem: MARC21 details, second replacemente of filefind (around line ~1050) on showAuthor template can't show $theme value, I need to pass it as parameter, don't know if it's a problem of mine, but opac complains.
Comment 10 Brendan Gallagher 2014-09-17 22:18:36 UTC
Created attachment 31687 [details] [review]
Bug 12655 [Revised] PROG/CCSR deprecation: Correct hard-coded opac-tmpl/prog path in XSLT

Two XSL files in the bootstrap theme contain hard-coded paths to the
prog theme directory. This patch adds a query of the opacthemes system
preference and builds the path based on the returned value.

To test in a MARC21 system:

Create or locate a record which contains a subject which is linked to an
authority record. View the detail page for that record in the bootstrap
OPAC and confirm that there is a magnifying class icon next to the link
for that subject heading. Inspect or right-click the image and "View
image" [FF. "Open image in new tab" in Chrome] to verify that the image
being shown is from the bootstrap theme directory.

Also modified: The NORMARC XSL for the detail page which has been
changed in the same way. I did not test it in a NORMARC catalog.

Edit: Fixed copy-and-paste error causing duplicate image.
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Comment 11 Chris Cormack 2014-10-09 17:00:16 UTC
Pushed to MM-OPAC/theme_dep
Comment 12 Tomás Cohen Arazi 2014-10-30 00:49:17 UTC
Patch merged into master.

Thanks Owen!