@@ -, +, @@ SELECT * FROM statistics WHERE itemnumber={itemnumber} AND type='RENEWAL' --- C4/Circulation.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -2990,7 +2990,7 @@ sub AddRenewal { } unless ( C4::Context->interface eq 'opac' ) { #if from opac we are obeying OpacRenewalBranch as calculated in opac-renew.pl - $branch = C4::Context->userenv ? C4::Context->userenv->{branch} : $branch; + $branch = ( C4::Context->userenv && defined C4::Context->userenv->{branch} ) ? C4::Context->userenv->{branch} : $branch; } # Add the renewal to stats --