Bug 4137: Fix the OPACViewOthersSuggestions behavior
[koha-ffzg.git] / C4 / Auth.pm
index 581bdd1..c4719e6 100644 (file)
@@ -107,7 +107,7 @@ C4::Auth - Authenticates Koha users
             query           => $query,
       type            => "opac",
       authnotrequired => 0,
-      flagsrequired   => {borrow => 1, catalogue => '*', tools => 'import_patrons' },
+      flagsrequired   => { catalogue => '*', tools => 'import_patrons' },
   }
     );
 
@@ -131,7 +131,7 @@ automatically. This gets loaded into the template.
          query           => $query,
          type            => "opac",
          authnotrequired => 0,
-         flagsrequired   => {borrow => 1, catalogue => '*', tools => 'import_patrons' },
+         flagsrequired   => { catalogue => '*', tools => 'import_patrons' },
        }
      );
 
@@ -230,7 +230,6 @@ sub get_template_and_user {
             $template->param( CAN_user_borrowers        => 1 );
             $template->param( CAN_user_permissions      => 1 );
             $template->param( CAN_user_reserveforothers => 1 );
-            $template->param( CAN_user_borrow           => 1 );
             $template->param( CAN_user_editcatalogue    => 1 );
             $template->param( CAN_user_updatecharges    => 1 );
             $template->param( CAN_user_acquisition      => 1 );
@@ -434,12 +433,15 @@ sub get_template_and_user {
         $LibraryNameTitle =~ s/<(?:\/?)(?:br|p)\s*(?:\/?)>/ /sgi;
         $LibraryNameTitle =~ s/<(?:[^<>'"]|'(?:[^']*)'|"(?:[^"]*)")*>//sg;
 
-        # clean up the busc param in the session if the page is not opac-detail and not the "add to list" page
+        # clean up the busc param in the session
+        # if the page is not opac-detail and not the "add to list" page
+        # and not the "edit comments" page
         if ( C4::Context->preference("OpacBrowseResults")
             && $in->{'template_name'} =~ /opac-(.+)\.(?:tt|tmpl)$/ ) {
             my $pagename = $1;
             unless ( $pagename =~ /^(?:MARC|ISBD)?detail$/
-                or $pagename =~ /^addbybiblionumber$/ ) {
+                or $pagename =~ /^addbybiblionumber$/
+                or $pagename =~ /^review$/ ) {
                 my $sessionSearch = get_session( $sessionID || $in->{'query'}->cookie("CGISESSID") );
                 $sessionSearch->clear( ["busc"] ) if ( $sessionSearch->param("busc") );
             }
@@ -477,7 +479,6 @@ sub get_template_and_user {
             OPACShelfBrowser                      => "" . C4::Context->preference("OPACShelfBrowser"),
             OPACURLOpenInNewWindow                => "" . C4::Context->preference("OPACURLOpenInNewWindow"),
             OPACUserCSS                           => "" . C4::Context->preference("OPACUserCSS"),
-            OPACViewOthersSuggestions             => "" . C4::Context->preference("OPACViewOthersSuggestions"),
             OpacAuthorities                       => C4::Context->preference("OpacAuthorities"),
             opac_css_override                     => $ENV{'OPAC_CSS_OVERRIDE'},
             opac_search_limit                     => $opac_search_limit,