[Rt-commit] rt branch, ip-customfields, updated. rt-3.8.8-677-gfba6e6b

Shawn Moore sartak at bestpractical.com
Mon Sep 20 16:51:23 EDT 2010


The branch, ip-customfields has been updated
       via  fba6e6bd1961b312119c6714da71b8389bc5b52f (commit)
       via  f7bfa386e2c9f9f4d82b39d87bc4f58d1daea3df (commit)
      from  2fb3132ecdb563c5e0f90903037df5acf18af7f1 (commit)

Summary of changes:
 lib/RT/CustomField_Overlay.pm            |    4 ++--
 lib/RT/ObjectCustomFieldValue_Overlay.pm |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

- Log -----------------------------------------------------------------
commit f7bfa386e2c9f9f4d82b39d87bc4f58d1daea3df
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Mon Sep 20 13:46:18 2010 -0700

    Include the failure message when we can't add an OCFV

diff --git a/lib/RT/CustomField_Overlay.pm b/lib/RT/CustomField_Overlay.pm
index 9e6b3cc..cbd0cd5 100755
--- a/lib/RT/CustomField_Overlay.pm
+++ b/lib/RT/CustomField_Overlay.pm
@@ -1330,7 +1330,7 @@ sub AddValueForObject {
 
 
     my $newval = RT::ObjectCustomFieldValue->new( $self->CurrentUser );
-    my $val    = $newval->Create(
+    my ($val, $msg) = $newval->Create(
         ObjectType   => ref($obj),
         ObjectId     => $obj->Id,
         Content      => $args{'Content'},
@@ -1341,7 +1341,7 @@ sub AddValueForObject {
 
     unless ($val) {
         $RT::Handle->Rollback();
-        return ($val, $self->loc("Couldn't create record"));
+        return ($val, $self->loc("Couldn't create record: [_1]", $msg));
     }
 
     $RT::Handle->Commit();

commit fba6e6bd1961b312119c6714da71b8389bc5b52f
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Mon Sep 20 13:54:08 2010 -0700

    Better error messages for when parse fails

diff --git a/lib/RT/ObjectCustomFieldValue_Overlay.pm b/lib/RT/ObjectCustomFieldValue_Overlay.pm
index 53d13f1..03abec0 100644
--- a/lib/RT/ObjectCustomFieldValue_Overlay.pm
+++ b/lib/RT/ObjectCustomFieldValue_Overlay.pm
@@ -85,7 +85,7 @@ sub Create {
         unless ( defined $args{'Content'} ) {
             return
               wantarray
-              ? ( 0, $self->loc("Content can't be empty for IPAddress") )
+              ? ( 0, $self->loc("Content is an invalid IP address") )
               : 0;
         }
     }
@@ -99,7 +99,7 @@ sub Create {
         unless ( defined $args{'Content'} ) {
             return
               wantarray
-              ? ( 0, $self->loc("Content can't be empty for IPAddressRange") )
+              ? ( 0, $self->loc("Content is an invalid IP address range") )
               : 0;
         }
     }

-----------------------------------------------------------------------


More information about the Rt-commit mailing list