[Rt-commit] r8301 - rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT

ruz at bestpractical.com ruz at bestpractical.com
Thu Jul 26 17:19:17 EDT 2007


Author: ruz
Date: Thu Jul 26 17:19:16 2007
New Revision: 8301

Modified:
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Record.pm

Log:
* normalize value of the CF before adding, undef and '' are empty values,
  when 0 is valid, so we undef first two to avoid double checks later

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Record.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Record.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Record.pm	Thu Jul 26 17:19:16 2007
@@ -1514,6 +1514,12 @@
             )
         );
     }
+
+    # empty string is not correct value of any CF, so undef it
+    foreach ( qw(Value LargeContent) ) {
+        $args{ $_ } = undef if defined $args{ $_ } && !length $args{ $_ };
+    }
+
     unless ( $cf->ValidateValue( $args{'Value'} ) ) {
         return ( 0, $self->loc("Invalid value for custom field") );
     }


More information about the Rt-commit mailing list