Bugzilla – Attachment 142361 Details for
Bug 31908
New login fails while having cookie from previous session
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31908: Only count local suggestions if there is a userenv
Bug-31908-Only-count-local-suggestions-if-there-is.patch (text/plain), 2.74 KB, created by
Nick Clemens (kidclamp)
on 2022-10-21 13:03:33 UTC
(
hide
)
Description:
Bug 31908: Only count local suggestions if there is a userenv
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-10-21 13:03:33 UTC
Size:
2.74 KB
patch
obsolete
>From beee2fa1e8e79fb782ff31df5ddf187db483aa59 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 21 Oct 2022 13:03:07 +0000 >Subject: [PATCH] Bug 31908: Only count local suggestions if there is a userenv > >--- > koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt | 2 +- > mainpage.pl | 9 ++++++--- > 2 files changed, 7 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt >index 1c657872be..50f17ddc6e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt >@@ -187,7 +187,7 @@ > <a href="/cgi-bin/koha/suggestion/suggestion.pl?branchcode=[% Branches.GetLoggedInBranchcode | url %]#ASKED"> > <span id="pendingsuggestions" class="pending-number-link">[% Branches.GetLoggedInBranchname | html %]: [% pendingsuggestions | html %]</span> > </a> >- [% IF (all_pendingsuggestions > 0) %] >+ [% IF (pendingsuggestions && all_pendingsuggestions > 0 && all_pendingsuggestions != pendingsuggestions ) %] > / > <a href="/cgi-bin/koha/suggestion/suggestion.pl?branchcode=__ANY__#ASKED"> > <span id="all_pendingsuggestions" class="pending-number-link">All libraries: [% all_pendingsuggestions | html %]</span> >diff --git a/mainpage.pl b/mainpage.pl >index f5872e65bb..47214cb2f2 100755 >--- a/mainpage.pl >+++ b/mainpage.pl >@@ -85,11 +85,14 @@ if( C4::Context->only_my_library ){ > $template->param( pendingsuggestions => $local_pendingsuggestions_count ); > } else { > my $pendingsuggestions = Koha::Suggestions->search({ status => "ASKED" }); >- my $local_pendingsuggestions_count = $pendingsuggestions->search({ 'me.branchcode' => C4::Context->userenv()->{'branch'} })->count(); >+ if( C4::Context->userenv() && C4::Context->userenv()->{branch} ){ >+ my $local_pendingsuggestions_count = $pendingsuggestions->search({ 'me.branchcode' => C4::Context->userenv()->{'branch'} })->count(); >+ $template->param( pendingsuggestions => $local_pendingsuggestions_count ); >+ } >+ > my $pendingsuggestions_count = $pendingsuggestions->count(); > $template->param( >- all_pendingsuggestions => $pendingsuggestions_count != $local_pendingsuggestions_count ? $pendingsuggestions_count : 0, >- pendingsuggestions => $local_pendingsuggestions_count >+ all_pendingsuggestions => $pendingsuggestions_count, > ); > } > >-- >2.30.2
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 31908
:
142361
|
143392
|
143491
|
143786
|
143819
|
143820
|
143821
|
143822
|
143884
|
143885
|
143886
|
143887
|
145092
|
145093
|
145250
|
145251
|
145252