Bugzilla – Attachment 130823 Details for
Bug 28955
Add option to set default branch from Apache
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28955: Add OPAC_BRANCH_DEFAULT
Bug-28955-Add-OPACBRANCHDEFAULT.patch (text/plain), 1.87 KB, created by
Martin Renvoize (ashimema)
on 2022-02-18 11:27:39 UTC
(
hide
)
Description:
Bug 28955: Add OPAC_BRANCH_DEFAULT
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-02-18 11:27:39 UTC
Size:
1.87 KB
patch
obsolete
>From 0f107af8e7501499fc6bff2f7d97f432051e8a6e Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 27 Oct 2021 11:27:18 +0100 >Subject: [PATCH] Bug 28955: Add OPAC_BRANCH_DEFAULT > >This patch adds support for OPAC_BRANCH_DEFAULT as an environment option >that can be passed via apache with either SetEnv or as a header for >plack. It allows setting a default branch for the anonymous opac >session such that you can display the right opac content blocks prior to >login if you have set up per branch URI's. > >To test (on top of bug 29691) >1 - Add to apache conf (/etc/apache2/sites-available/kohadev.conf) > SetEnv OPAC_BRANCH_DEFAULT "CPL" > RequestHeader add X-Koha-SetEnv "OPAC_BRANCH_DEFAULT CPL" >2 - Restart all >3 - Confirm that news for all and CPL show on opac mainpage >4 - Sign in as a different library >5 - Confirm users library news shows > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > C4/Auth.pm | 3 +++ > Koha/Middleware/SetEnv.pm | 1 + > 2 files changed, 4 insertions(+) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index 7f9d4e31c3..d5eec4be64 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -452,6 +452,9 @@ sub get_template_and_user { > some_public_shelves => $some_public_shelves, > ); > } >+ >+ # Set default branch if one has been passed by the environment. >+ $template->param( branchcode => $ENV{OPAC_BRANCH_DEFAULT} ) if $ENV{OPAC_BRANCH_DEFAULT}; > } > > # Sysprefs disabled via URL param >diff --git a/Koha/Middleware/SetEnv.pm b/Koha/Middleware/SetEnv.pm >index 6807392c1a..27c91b6b05 100644 >--- a/Koha/Middleware/SetEnv.pm >+++ b/Koha/Middleware/SetEnv.pm >@@ -66,6 +66,7 @@ name. > my $allowed_setenvs = qr/^( > OVERRIDE_SYSPREF_(\w+) | > OVERRIDE_SYSPREF_NAMES | >+ OPAC_BRANCH_DEFAULT | > OPAC_CSS_OVERRIDE | > OPAC_SEARCH_LIMIT | > OPAC_LIMIT_OVERRIDE | >-- >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 28955
:
126989
|
128507
|
128569
|
128570
|
130819
|
130820
|
130823
|
130824
|
130862
|
130949
|
130950
|
130951
|
131833
|
131834
|
131835