diff options
author | ivan <ivan> | 2001-08-11 23:19:09 +0000 |
---|---|---|
committer | ivan <ivan> | 2001-08-11 23:19:09 +0000 |
commit | 3d726debcb197b4304208eb758dc9ede7f619f86 (patch) | |
tree | 896d4bcdaf1209e8e5dca5f382fc2e5cbac62fdc /httemplate/edit/part_svc.cgi | |
parent | c473d21fdd01251030b0a90d67d85d1bedfd76ba (diff) |
better error checking, fix scalar context to $cgi->keywords
Diffstat (limited to 'httemplate/edit/part_svc.cgi')
-rwxr-xr-x | httemplate/edit/part_svc.cgi | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index 6617d25ed..7fadf000f 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -1,4 +1,4 @@ -<!-- $Id: part_svc.cgi,v 1.2 2001-08-11 04:55:03 ivan Exp $ --> +<!-- $Id: part_svc.cgi,v 1.3 2001-08-11 23:19:09 ivan Exp $ --> <% my $part_svc; if ( $cgi->param('error') ) { #error @@ -6,9 +6,10 @@ map { $_, scalar($cgi->param($_)) } fields('part_svc') } ); } elsif ( $cgi->keywords ) { #edit - my $query = $cgi->keywords; - $query =~ /^(\d+)$/; - $part_svc=qsearchs('part_svc',{'svcpart'=>$1}); + my($query) = $cgi->keywords; + $query =~ /^(\d+)$/ or die "malformed query: $query"; + $part_svc=qsearchs('part_svc', { 'svcpart'=>$1 } ) + or die "unknown svcpart: $1"; } else { #adding $part_svc = new FS::part_svc {}; } |