From: ivan Date: Sat, 26 Aug 2006 02:12:54 +0000 (+0000) Subject: foiled by autovivification! X-Git-Tag: TRIXBOX_2_6~1013 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=f4eb2dd15795c2f9da636ee084516cbafef7fbd5 foiled by autovivification! --- 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;