[Rt-commit] rt branch, 3.999-trunk, updated. ac45e1abf01262f3147960e0109a337be415929d
sartak at bestpractical.com
sartak at bestpractical.com
Tue Dec 1 04:58:11 EST 2009
The branch, 3.999-trunk has been updated
via ac45e1abf01262f3147960e0109a337be415929d (commit)
from b9171d8baf6cbb904bb49c537274715790d56b51 (commit)
Summary of changes:
lib/RT/Record.pm | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
- Log -----------------------------------------------------------------
commit ac45e1abf01262f3147960e0109a337be415929d
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Tue Dec 1 04:57:59 2009 -0500
Pass the other arguments to validate_*, too
diff --git a/lib/RT/Record.pm b/lib/RT/Record.pm
index 5c7978c..d383424 100755
--- a/lib/RT/Record.pm
+++ b/lib/RT/Record.pm
@@ -252,15 +252,16 @@ If this object's table has any of the following atetributes defined as
sub create {
my $self = shift;
my %attribs = (@_);
+
foreach my $key ( keys %attribs ) {
my $method = $self->can("validate_$key");
- if ($method) {
- unless ( $method->( $self, $attribs{$key}, { for => 'create' } ) ) {
- if (wantarray) {
- return ( 0, _( 'Invalid value for %1', $key ) );
- } else {
- return (0);
- }
+ next if !$method;
+
+ unless ( $method->( $self, $attribs{$key}, \%attribs, { for => 'create' } ) ) {
+ if (wantarray) {
+ return ( 0, _( 'Invalid value for %1', $key ) );
+ } else {
+ return (0);
}
}
}
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list