From bbfd7a87134208532dac7868f2b352df77911e60 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 24 Feb 2026 12:58:14 +0000 Subject: [PATCH] Bug 14962: (QA follow-up) Fix crash in C4::Search when UseDisplayModule is enabled effective_homebranch() and effective_holdingbranch() return a plain branchcode string, not a Koha::Library object. Calling ->branchcode on the return value caused a fatal "Can't call method on unblessed reference" error on every search results page when UseDisplayModule was enabled. Drop the spurious ->branchcode method call. Sponsored-by: ByWater Solutions Signed-of-by: Martin Renvoize --- C4/Search.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index ffe49a7a6b6..e7cf3a9cf54 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1783,7 +1783,7 @@ sub searchResults { my $item_obj = Koha::Items->find( $item->{itemnumber} ); return $item->{homebranch} unless $item_obj; - my $effective_homebranch = $item_obj->effective_homebranch->branchcode; + my $effective_homebranch = $item_obj->effective_homebranch; # If it starts with "DISPLAY:", validate against displays table if ( $effective_homebranch =~ /^DISPLAY:\s*(.+)$/ ) { @@ -1808,7 +1808,7 @@ sub searchResults { my $item_obj = Koha::Items->find( $item->{itemnumber} ); return $item->{holdingbranch} unless $item_obj; - my $effective_holdingbranch = $item_obj->effective_holdingbranch->branchcode; + my $effective_holdingbranch = $item_obj->effective_holdingbranch; # If it starts with "DISPLAY:", validate against displays table if ( $effective_holdingbranch =~ /^DISPLAY:\s*(.+)$/ ) { -- 2.53.0