summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FS/FS/Record.pm4
1 files changed, 3 insertions, 1 deletions
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;