Bugzilla – Attachment 73319 Details for
Bug 20480
Fix styling issues on bad SCI/SCO module logins
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20480: Make KOHA_VERSION available to all templates in all circumstances
Bug-20480-Make-KOHAVERSION-available-to-all-templa.patch (text/plain), 3.99 KB, created by
Tomás Cohen Arazi (tcohen)
on 2018-03-27 15:01:31 UTC
(
hide
)
Description:
Bug 20480: Make KOHA_VERSION available to all templates in all circumstances
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2018-03-27 15:01:31 UTC
Size:
3.99 KB
patch
obsolete
>From 91c3658bf653656d359c32ed82ac0410e1c320ac Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 27 Mar 2018 11:54:51 -0300 >Subject: [PATCH] Bug 20480: Make KOHA_VERSION available to all templates in > all circumstances > >This patch makes C4::Templates::gettemplate set the KOHA_VERSION param >for the template. This way this template parameter, which is required by >(probably) all pages that include CSS/JS content is available in all >circumstances. > >A noticeable problem with the current approach is when using the SCO and >SCI modules with wrong/forbidden users: C4::Auth short-circuits and >redirects to the login page, without setting the KOHA_VERSION param. >This patch solves it for good. > >To test: >- Enable the SCI module >- Open the browser at > http://localhost:8080/cgi-bin/koha/sci/sci-main.pl >- Login with the db user (koha_kohadev / password) >=> FAIL: Login failure, but styling is broken >- Apply this patch >- Retry >=> SUCCESS: Everything looks as it should! >- Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > C4/Auth.pm | 7 ++----- > C4/Templates.pm | 1 + > 2 files changed, 3 insertions(+), 5 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index e887bc0384..f09817e885 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -501,8 +501,7 @@ sub get_template_and_user { > EnableBorrowerFiles => C4::Context->preference('EnableBorrowerFiles'), > UseKohaPlugins => C4::Context->preference('UseKohaPlugins'), > UseCourseReserves => C4::Context->preference("UseCourseReserves"), >- useDischarge => C4::Context->preference('useDischarge'), >- KOHA_VERSION => C4::Context->preference('Version'), >+ useDischarge => C4::Context->preference('useDischarge') > ); > } > else { >@@ -576,7 +575,6 @@ sub get_template_and_user { > OpacTopissue => C4::Context->preference("OpacTopissue"), > RequestOnOpac => C4::Context->preference("RequestOnOpac"), > 'Version' => C4::Context->preference('Version'), >- KOHA_VERSION => C4::Context->preference('Version'), > hidelostitems => C4::Context->preference("hidelostitems"), > mylibraryfirst => ( C4::Context->preference("SearchMyLibraryFirst") && C4::Context->userenv ) ? C4::Context->userenv->{'branch'} : '', > opaclayoutstylesheet => "" . C4::Context->preference("opaclayoutstylesheet"), >@@ -1292,8 +1290,7 @@ sub checkauth { > PatronSelfRegistration => C4::Context->preference("PatronSelfRegistration"), > PatronSelfRegistrationDefaultCategory => C4::Context->preference("PatronSelfRegistrationDefaultCategory"), > opac_css_override => $ENV{'OPAC_CSS_OVERRIDE'}, >- too_many_login_attempts => ( $patron and $patron->account_locked ), >- KOHA_VERSION => C4::Context->preference('Version'), >+ too_many_login_attempts => ( $patron and $patron->account_locked ) > ); > > $template->param( SCO_login => 1 ) if ( $query->param('sco_user_login') ); >diff --git a/C4/Templates.pm b/C4/Templates.pm >index 343a374199..f8275f7a84 100644 >--- a/C4/Templates.pm >+++ b/C4/Templates.pm >@@ -241,6 +241,7 @@ sub gettemplate { > $template->param( > languages_loop => $languages_loop, > one_language_enabled => $one_language_enabled, >+ KOHA_VERSION => C4::Context->preference('Version') > ) unless $one_language_enabled; > > return $template; >-- >2.16.3
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 20480
:
73319
|
73330
|
73332
|
73333
|
73334