From: ivan Date: Thu, 8 Feb 2007 22:19:56 +0000 (+0000) Subject: use a LIMIT to retreive the first record, don't rely on qsearchs to trim it for you... X-Git-Tag: TRIXBOX_2_6~661 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=1d15d22917b9e91fbb9b5a195f94bf3b71fe304a use a LIMIT to retreive the first record, don't rely on qsearchs to trim it for you - it is inefficient and outputs long verbose warnings --- diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm index ea959ab11..b2ef2a259 100644 --- a/FS/FS/cust_pkg.pm +++ b/FS/FS/cust_pkg.pm @@ -693,7 +693,7 @@ sub last_reason { my $cust_pkg_reason = qsearchs( { 'table' => 'cust_pkg_reason', 'hashref' => { 'pkgnum' => $self->pkgnum, }, - 'extra_sql'=> 'ORDER BY date DESC', + 'extra_sql'=> 'ORDER BY date DESC LIMIT 1', } ); qsearchs ( 'reason', { 'reasonnum' => $cust_pkg_reason->reasonnum } ) if $cust_pkg_reason;