[Rt-commit] r12039 - rt/branches/3.7-RTIR-RELENG/lib/RT

ruz at bestpractical.com ruz at bestpractical.com
Sun May 4 07:43:31 EDT 2008


Author: ruz
Date: Sun May  4 07:43:15 2008
New Revision: 12039

Modified:
   rt/branches/3.7-RTIR-RELENG/lib/RT/CustomField_Overlay.pm

Log:
* we don't support some combinations of CF type and max values,
  check input in CF->Create method

Modified: rt/branches/3.7-RTIR-RELENG/lib/RT/CustomField_Overlay.pm
==============================================================================
--- rt/branches/3.7-RTIR-RELENG/lib/RT/CustomField_Overlay.pm	(original)
+++ rt/branches/3.7-RTIR-RELENG/lib/RT/CustomField_Overlay.pm	Sun May  4 07:43:15 2008
@@ -176,7 +176,8 @@
         # old style Type string
         $args{'MaxValues'} = $1 ? 1 : 0;
     }
-    
+    $args{'MaxValues'} = int $args{'MaxValues'};
+
     if ( !exists $args{'Queue'}) {
     # do nothing -- things below are strictly backward compat
     }
@@ -202,6 +203,11 @@
     my ($ok, $msg) = $self->_IsValidRegex( $args{'Pattern'} );
     return (0, $self->loc("Invalid pattern: [_1]", $msg)) unless $ok;
 
+    if ( $args{'MaxValues'} != 1 && $args{'Type'} =~ /^(text|combobox)$/i ) {
+        $RT::Logger->warning("Support for 'multiple' Texts or Comboboxes is not implemented");
+        $args{'MaxValues'} = 1;
+    }
+
     (my $rv, $msg) = $self->SUPER::Create(
         Name        => $args{'Name'},
         Type        => $args{'Type'},


More information about the Rt-commit mailing list