Bug 23253: Fix OpacNavRight for self reg by email
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 5 Aug 2019 14:04:25 +0000 (09:04 -0500)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 15 Aug 2019 08:19:28 +0000 (09:19 +0100)
The code expects to display OpacNavRight content at the bottom of the
login form when a user just registered.

Test plan:
- Turn PatronSelfRegistrationVerifyByEmail on
- Register a patron
- Confirm by clicking on the link you received by email (or see the
message_queue table)
=> The OpacNavRight content should be displayed

QA Note: This code smells, the code in the pl should not be needed.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
C4/Auth.pm
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-registration-confirmation.tt
opac/opac-registration-verify.pl

index e658c89..a7ef5fe 100644 (file)
@@ -570,7 +570,6 @@ sub get_template_and_user {
             OpacKohaUrl                           => C4::Context->preference("OpacKohaUrl"),
             OpacMainUserBlock                     => "" . C4::Context->preference("OpacMainUserBlock"),
             OpacNav                               => "" . C4::Context->preference("OpacNav"),
-            OpacNavRight                          => "" . C4::Context->preference("OpacNavRight"),
             OpacNavBottom                         => "" . C4::Context->preference("OpacNavBottom"),
             OpacPasswordChange                    => C4::Context->preference("OpacPasswordChange"),
             OPACPatronDetails                     => C4::Context->preference("OPACPatronDetails"),
@@ -1249,7 +1248,6 @@ sub checkauth {
         LibraryNameTitle                      => "" . $LibraryNameTitle,
         opacuserlogin                         => C4::Context->preference("opacuserlogin"),
         OpacNav                               => C4::Context->preference("OpacNav"),
-        OpacNavRight                          => C4::Context->preference("OpacNavRight"),
         OpacNavBottom                         => C4::Context->preference("OpacNavBottom"),
         opaccredits                           => C4::Context->preference("opaccredits"),
         OpacFavicon                           => C4::Context->preference("OpacFavicon"),
index 5a62324..d8ea3c4 100644 (file)
@@ -1,5 +1,6 @@
 [% USE raw %]
 [% USE Koha %]
+[% USE KohaNews %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
 [% INCLUDE 'doc-head-close.inc' %]
@@ -67,6 +68,7 @@
 
                 </div> <!-- / .span7/9 -->
 
+                    [% SET OpacNavRight = KohaNews.get( location => "OpacNavRight", lang => news_lang, library => branchcode ) %]
                     [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) || OpacNavRight ) %]
                         <div class="span3">
                             [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
                             [% END # /opacuserlogin %]
                             [% IF ( OpacNavRight ) %]
                                 <div id="opacnavright">
-                                    [% OpacNavRight | $raw %]
+                                    [% PROCESS koha_news_block news => OpacNavRight %]
                                 </div>
                             [% END # /OpacNavRight %]
                         </div> <!-- / .span3 -->
index d40631f..d408d5c 100755 (executable)
@@ -80,6 +80,9 @@ if (
               C4::Context->preference(
                 'PatronSelfRegistrationAdditionalInstructions')
         );
+
+        my ($theme, $news_lang, $availablethemes) = C4::Templates::themelanguage(C4::Context->config('opachtdocs'),'opac-registration-confirmation.tt','opac',$cgi);
+        $template->param( news_lang => $news_lang );
     }
 
 }