[Rt-devel] Error propagation in RT::CustomField::Create.
Jesse Vincent
jesse at bestpractical.com
Thu May 3 15:05:17 EDT 2007
Seems 100% reasonable. Ruz: objections?
On May 3, 2007, at 11:22 AM, Dmitri Tikhonov wrote:
> Dear RTers,
>
> it would be nice if RT::CustomField's Create() method propagated
> error messages from calls to SUPER::Create. What follows is a
> patch against the latest 3.7 code (http://svn.bestpractical.com/cgi-
> bin/index.cgi/bps/view/rt/branches/3.7-EXPERIMENTAL/lib/RT/
> CustomField_Overlay.pm):
>
> Thanks,
>
> - Dmitri.
>
> --- CustomField_Overlay.pm-original 2007-05-03
> 17:03:28.000000000 +0000
> +++ CustomField_Overlay.pm 2007-05-03 17:04:07.000000000 +0000
> @@ -202,7 +202,7 @@
> my ($ok, $msg) = $self->_IsValidRegex( $args{'Pattern'} );
> return (0, $self->loc("Invalid pattern: [_1]", $msg)) unless $ok;
>
> - my $rv = $self->SUPER::Create(
> + my @rv = $self->SUPER::Create(
> Name => $args{'Name'},
> Type => $args{'Type'},
> MaxValues => $args{'MaxValues'},
> @@ -217,7 +217,7 @@
> $self->SetValuesClass( $args{'ValuesClass'} );
> }
>
> - return $rv unless exists $args{'Queue'};
> + return @rv unless exists $args{'Queue'};
>
> # Compat code -- create a new ObjectCustomField mapping
> my $OCF = RT::ObjectCustomField->new( $self->CurrentUser );
> @@ -226,7 +226,7 @@
> ObjectId => $args{'Queue'},
> );
>
> - return $rv;
> + return @rv;
> }
>
> =head2 Load ID/NAME
> _______________________________________________
> List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/
> rt-devel
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://lists.bestpractical.com/pipermail/rt-devel/attachments/20070503/de270fc2/PGP.pgp
More information about the Rt-devel
mailing list