Bug 10204 - Patron image no longer appears in the OPAC
[koha.git] / opac / opac-search.pl
index 9a58bcc..363a11e 100755 (executable)
@@ -652,7 +652,7 @@ for (my $i=0;$i<@servers;$i++) {
                 $newsearchcookie = $cgi->cookie(
                             -name => 'KohaOpacRecentSearches',
                             # We uri_escape the whole freezed structure so we're sure we won't have any encoding problems
-                            -value => uri_escape(freeze(\@recentSearches)),
+                            -value =>freeze(\@recentSearches),
                             -expires => ''
                 );
                 $cookie = [$cookie, $newsearchcookie];
@@ -715,8 +715,10 @@ for (my $i=0;$i<@servers;$i++) {
             $template->param(results_per_page =>  $results_per_page);
             my $hide = C4::Context->preference('OpacHiddenItems');
             $hide = ($hide =~ m/\S/) if $hide; # Just in case it has some spaces/new lines
-
-            my $branch = C4::Context->userenv->{branch};
+            my $branch = '';
+            if (C4::Context->userenv){
+                $branch = C4::Context->userenv->{branch};
+            }
             if ( C4::Context->preference('HighlightOwnItemsOnOPAC') ) {
                 if (
                     ( ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'PatronBranch' ) && $branch )