Bugzilla – Attachment 100589 Details for
Bug 24852
XSLT paths not adjusted for non-dev_install
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24852: Adjust XSLT paths for dev installs
Bug-24852-Adjust-XSLT-paths-for-dev-installs.patch (text/plain), 4.13 KB, created by
Jonathan Druart
on 2020-03-11 16:55:01 UTC
(
hide
)
Description:
Bug 24852: Adjust XSLT paths for dev installs
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-03-11 16:55:01 UTC
Size:
4.13 KB
patch
obsolete
>From 810c37e91bd234fb15d4d8b39d9f0d158fd1b33c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 11 Mar 2020 17:46:54 +0100 >Subject: [PATCH] Bug 24852: Adjust XSLT paths for dev installs > >We are building the XSLT paths with intrahtdocs, it should be intranetdir >(and assume that have the usual git structure). > >For instance, on a dev box, the XSLT base path was outside of the git >repo: >/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/xslt/ > >Now it will be: >/kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/xslt/ > >Test plan: >0. Do not apply the patch, set dev_install to 1 in $KOHA_CONF >1. Modify a xslt in the git repo, and in the "htdocs" path, in a >different way: >/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >/kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >2. Restart all the things and refresh a bibliographic record detail >page >Notice that you see the change from the "htdocs", outside of the git >repo >3. Apply the patch >4. Repeat 2. >Notice that you now see the change you made on the file from the git >repo >5. Set dev_install to 0 in $KOHA_CONF >6. Repeat 2. >Notice that you now see the change from htdocs >--- > C4/XSLT.pm | 17 ++++++++++++++--- > 1 file changed, 14 insertions(+), 3 deletions(-) > >diff --git a/C4/XSLT.pm b/C4/XSLT.pm >index 44b8aea94f..eb07e3029a 100644 >--- a/C4/XSLT.pm >+++ b/C4/XSLT.pm >@@ -197,41 +197,52 @@ sub XSLTParse4Display { > $lang ||= C4::Languages::getlanguage(); > > if ( $xslfilename =~ /^\s*"?default"?\s*$/i ) { >- my $htdocs; >- my $theme; >- my $xslfile; >+ my ( $htdocs, $theme, $xslfile, $interface ); > if ($xslsyspref eq "XSLTDetailsDisplay") { > $htdocs = C4::Context->config('intrahtdocs'); > $theme = C4::Context->preference("template"); > $xslfile = C4::Context->preference('marcflavour') . > "slim2intranetDetail.xsl"; >+ $interface = 'intranet'; > } elsif ($xslsyspref eq "XSLTResultsDisplay") { > $htdocs = C4::Context->config('intrahtdocs'); > $theme = C4::Context->preference("template"); > $xslfile = C4::Context->preference('marcflavour') . > "slim2intranetResults.xsl"; >+ $interface = 'intranet'; > } elsif ($xslsyspref eq "OPACXSLTDetailsDisplay") { > $htdocs = C4::Context->config('opachtdocs'); > $theme = C4::Context->preference("opacthemes"); > $xslfile = C4::Context->preference('marcflavour') . > "slim2OPACDetail.xsl"; >+ $interface = 'opac'; > } elsif ($xslsyspref eq "OPACXSLTResultsDisplay") { > $htdocs = C4::Context->config('opachtdocs'); > $theme = C4::Context->preference("opacthemes"); > $xslfile = C4::Context->preference('marcflavour') . > "slim2OPACResults.xsl"; >+ $interface = 'opac'; > } elsif ($xslsyspref eq 'XSLTListsDisplay') { > # Lists default to *Results.xslt > $htdocs = C4::Context->config('intrahtdocs'); > $theme = C4::Context->preference("template"); > $xslfile = C4::Context->preference('marcflavour') . > "slim2intranetResults.xsl"; >+ $interface = 'intranet'; > } elsif ($xslsyspref eq 'OPACXSLTListsDisplay') { > # Lists default to *Results.xslt > $htdocs = C4::Context->config('opachtdocs'); > $theme = C4::Context->preference("opacthemes"); > $xslfile = C4::Context->preference('marcflavour') . > "slim2OPACResults.xsl"; >+ $interface = 'opac'; >+ } >+ >+ # Dealing with dev installs here >+ if ( C4::Context->config('dev_install') && $interface ) { >+ # /kohadevbox/koha/koha-tmpl/intranet-tmpl >+ # /kohadevbox/koha/koha-tmpl/opac-tmpl >+ $htdocs = sprintf "%s/koha-tmpl/%s-tmpl", C4::Context->config('intranetdir'), $interface; > } > $xslfilename = _get_best_default_xslt_filename($htdocs, $theme, $lang, $xslfile); > } >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24852
: 100589