From f4eb2dd15795c2f9da636ee084516cbafef7fbd5 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 26 Aug 2006 02:12:54 +0000 Subject: [PATCH] foiled by autovivification! --- FS/FS/Record.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/FS/FS/Record.pm b/FS/FS/Record.pm index cc7f551e9..713b96767 100644 --- a/FS/FS/Record.pm +++ b/FS/FS/Record.pm @@ -388,7 +388,9 @@ sub qsearch { my %result; tie %result, "Tie::IxHash"; my @stuff = @{ $sth->fetchall_arrayref( {} ) }; - if ( $pkey && $stuff[0]->{$pkey} ) { + #if ( $pkey ) { + #if ( $pkey && $stuff[0]->{$pkey} ) { + if ( $pkey && scalar(@stuff) && $stuff[0]->{$pkey} ) { %result = map { $_->{$pkey}, $_ } @stuff; } else { @result{@stuff} = @stuff; -- 2.11.0