@@ -, +, @@ warning --- C4/Items.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/C4/Items.pm +++ a/C4/Items.pm @@ -2278,7 +2278,8 @@ sub DelItemCheck { if ($onloan){ $error = "book_on_loan" } - elsif ( !C4::Context->IsSuperLibrarian() + elsif ( defined C4::Context->userenv + and !C4::Context->IsSuperLibrarian() and C4::Context->preference("IndependentBranches") and ( C4::Context->userenv->{branch} ne $item->{'homebranch'} ) ) { --