summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2002-12-21 10:02:24 +0000
committerivan <ivan>2002-12-21 10:02:24 +0000
commit3ed2aae6b3e6b303b4058f9cd6e54ea377196b0a (patch)
tree076e4b6c3090eb43d9471272a474f13e866dd62e
parent8c679e623c0e21d3d4e1b1966b310db61871e119 (diff)
better qsearchs warning
-rw-r--r--FS/FS/Record.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/FS/FS/Record.pm b/FS/FS/Record.pm
index ebcbbb497..40215100f 100644
--- a/FS/FS/Record.pm
+++ b/FS/FS/Record.pm
@@ -330,9 +330,11 @@ for a single item, or your data is corrupted.
=cut
sub qsearchs { # $result_record = &FS::Record:qsearchs('table',\%hash);
+ my $table = $_[0];
my(@result) = qsearch(@_);
- carp "warning: Multiple records in scalar search!" if scalar(@result) > 1;
- #should warn more vehemently if the search was on a primary key?
+ carp "warning: Multiple records in scalar search ($table)"
+ if scalar(@result) > 1;
+ #should warn more vehemently if the search was on a primary key?
scalar(@result) ? ($result[0]) : ();
}