[Rt-commit] rt branch 5.0/allow-custom-validation-hint-on-cfs created. rt-5.0.3-21-g34ac5f753b

BPS Git Server git at git.bestpractical.com
Wed Feb 8 15:50:29 UTC 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".

The branch, 5.0/allow-custom-validation-hint-on-cfs has been created
        at  34ac5f753bdc4732d538463ee1029f940fd747c0 (commit)

- Log -----------------------------------------------------------------
commit 34ac5f753bdc4732d538463ee1029f940fd747c0
Author: Brian Conry <bconry at bestpractical.com>
Date:   Tue May 31 13:09:14 2022 -0500

    Update tests for new added ValidationHint feature

diff --git a/t/web/cf_pattern.t b/t/web/cf_pattern.t
index 8e18baba3e..af880dda99 100644
--- a/t/web/cf_pattern.t
+++ b/t/web/cf_pattern.t
@@ -5,14 +5,52 @@ use RT::Test tests => 'no_declare';
 
 my ($base, $m) = RT::Test->started_ok;
 
-my $cf = RT::Test->load_or_create_custom_field(
+my $cf_yaks = RT::Test->load_or_create_custom_field(
     Name        => 'Yaks',
     Type        => 'FreeformSingle',
     Pattern     => '(?#Digits)^\d+$',
     Queue       => 0,
     LookupType  => 'RT::Queue-RT::Ticket',
 );
-ok $cf && $cf->id, "Created CF with Pattern";
+ok $cf_yaks && $cf_yaks->id, "Created CF with Pattern";
+
+my $cf_guars = RT::Test->load_or_create_custom_field(
+    Name        => 'Guars',
+    Type        => 'FreeformSingle',
+    Pattern     => '^\d+$',
+    Queue       => 0,
+    LookupType  => 'RT::Queue-RT::Ticket',
+);
+ok $cf_guars && $cf_guars->id, "Created CF with commentless Pattern";
+
+my $cf_bison = RT::Test->load_or_create_custom_field(
+    Name           => 'Bison',
+    Type           => 'FreeformSingle',
+    Pattern        => '(?#Digits)^\d+$',
+    Queue          => 0,
+    LookupType     => 'RT::Queue-RT::Ticket',
+    ValidationHint => 'Buffalo',
+);
+ok $cf_bison && $cf_bison->id, "Created CF with Pattern and ValidationHint";
+
+my $cf_zebus = RT::Test->load_or_create_custom_field(
+    Name           => 'Zebus',
+    Type           => 'FreeformSingle',
+    Pattern        => '^\d+$',
+    Queue          => 0,
+    LookupType     => 'RT::Queue-RT::Ticket',
+    ValidationHint => 'AKA Cebu',
+);
+ok $cf_zebus && $cf_zebus->id, "Created CF with commentless Pattern and ValidationHint";
+
+my $cf_gnus = RT::Test->load_or_create_custom_field(
+    Name           => 'Gnus',
+    Type           => 'FreeformSingle',
+    Queue          => 0,
+    LookupType     => 'RT::Queue-RT::Ticket',
+    ValidationHint => 'No Gnus',
+);
+ok $cf_gnus && $cf_gnus->id, "Created CF with ValidationHint without Pattern";
 
 my $ticket = RT::Test->create_ticket(
     Queue   => 1,
@@ -27,25 +65,69 @@ for my $page ("/Ticket/Create.html?Queue=1", "/Ticket/Modify.html?id=".$ticket->
     $m->get_ok($page, "Fetched $page");
     $m->content_contains("Yaks");
     $m->content_contains("Input must match [Digits]");
+    $m->content_contains("Guars");
+    $m->content_contains("Input must match ^\\d+\$");
+    $m->content_contains("Bison");
+    $m->content_contains("Buffalo");
+    $m->content_contains("Zebus");
+    $m->content_contains("AKA Cebu");
+    $m->content_contains("Gnus");
+    $m->content_lacks("No Gnus");
     $m->content_lacks("cfinvalidfield");
 
-    my $cfinput = RT::Interface::Web::GetCustomFieldInputName(
+    my $cfinput_yaks = RT::Interface::Web::GetCustomFieldInputName(
+        Object => ( $page =~ /Create/ ? RT::Ticket->new( RT->SystemUser ) : $ticket ),
+        CustomField => $cf_yaks,
+    );
+    my $cfinput_guars = RT::Interface::Web::GetCustomFieldInputName(
+        Object => ( $page =~ /Create/ ? RT::Ticket->new( RT->SystemUser ) : $ticket ),
+        CustomField => $cf_guars,
+    );
+    my $cfinput_bison = RT::Interface::Web::GetCustomFieldInputName(
+        Object => ( $page =~ /Create/ ? RT::Ticket->new( RT->SystemUser ) : $ticket ),
+        CustomField => $cf_bison,
+    );
+    my $cfinput_zebus = RT::Interface::Web::GetCustomFieldInputName(
+        Object => ( $page =~ /Create/ ? RT::Ticket->new( RT->SystemUser ) : $ticket ),
+        CustomField => $cf_zebus,
+    );
+    my $cfinput_gnus = RT::Interface::Web::GetCustomFieldInputName(
         Object => ( $page =~ /Create/ ? RT::Ticket->new( RT->SystemUser ) : $ticket ),
-        CustomField => $cf,
+        CustomField => $cf_gnus,
     );
     $m->submit_form_ok({
         with_fields => {
-            $cfinput            => "too many",
-            "${cfinput}-Magic" => "1",
+            $cfinput_yaks            => "too many",
+            "${cfinput_yaks}-Magic"  => "1",
+            $cfinput_guars           => "too many",
+            "${cfinput_guars}-Magic" => "1",
+            $cfinput_bison           => "too many",
+            "${cfinput_bison}-Magic" => "1",
+            $cfinput_zebus           => "too many",
+            "${cfinput_zebus}-Magic" => "1",
+            $cfinput_gnus            => "too many",
+            "${cfinput_gnus}-Magic"  => "1",
         },
     });
     $m->content_contains("Input must match [Digits]");
+    $m->content_contains("Input must match ^\\d+\$");
+    $m->content_contains("Buffalo");
+    $m->content_contains("AKA Cebu");
+    $m->content_lacks("No Gnus");
     $m->content_contains("cfinvalidfield");
 
     $m->submit_form_ok({
         with_fields => {
-            $cfinput            => "42",
-            "${cfinput}-Magic" => "1",
+            $cfinput_yaks            => "42",
+            "${cfinput_yaks}-Magic"  => "1",
+            $cfinput_guars           => "42",
+            "${cfinput_guars}-Magic" => "1",
+            $cfinput_bison           => "42",
+            "${cfinput_bison}-Magic" => "1",
+            $cfinput_zebus           => "42",
+            "${cfinput_zebus}-Magic" => "1",
+            $cfinput_gnus            => "too many",
+            "${cfinput_gnus}-Magic"  => "1",
         },
         button => 'SubmitTicket',
     });
@@ -53,8 +135,16 @@ for my $page ("/Ticket/Create.html?Queue=1", "/Ticket/Modify.html?id=".$ticket->
     if ($page =~ /Create/) {
         $m->content_like(qr/Ticket \d+ created/, "Created ticket");
     } else {
-        $m->content_contains("Yaks 42 added", "Updated ticket");
+        $m->content_contains("Yaks 42 added", "Updated ticket Yaks");
+        $m->content_contains("Guars 42 added", "Updated ticket Guars");
+        $m->content_contains("Bison 42 added", "Updated ticket Bison");
+        $m->content_contains("Zebus 42 added", "Updated ticket Zebu");
+        $m->content_contains("Gnus too many added", "Updated ticket Gnus");
         $m->content_contains("Input must match [Digits]");
+        $m->content_contains("Input must match ^\\d+\$");
+        $m->content_contains("Buffalo");
+        $m->content_contains("AKA Cebu");
+        $m->content_lacks("No Gnus");
         $m->content_lacks("cfinvalidfield");
     }
 }
@@ -73,7 +163,10 @@ diag "Quick ticket creation";
     is $tickets->Count, 0, "No ticket created";
 
     like $m->uri, qr/Ticket\/Create\.html/, "Redirected to the ticket create page";
-    $m->content_contains("Yaks: Input must match", "Found CF validation error");
+    $m->content_contains("Yaks: Input must match", "Found CF validation error Yaks");
+    $m->content_contains("Guars: Input must match", "Found CF validation error Guars");
+    $m->content_contains("Bison: Buffalo", "Found CF validation error Bison");
+    $m->content_contains("Zebus: AKA Cebu", "Found CF validation error Zebus");
     $m->content_contains("test quick create", "Found prefilled Subject");
 }
 

commit b20427c040db52690c2cfd9aa540711139a6d909
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Feb 8 22:40:58 2023 +0800

    Make custom field FriendlyPattern UI a bit nicer
    
    Just spacing and color adjustments, no functionality changes.

diff --git a/share/html/Elements/EditCustomFields b/share/html/Elements/EditCustomFields
index 149e447ce5..1dfddbc73d 100644
--- a/share/html/Elements/EditCustomFields
+++ b/share/html/Elements/EditCustomFields
@@ -71,11 +71,9 @@
           Object => $Object,
       &>
 %  if (my $msg = $m->notes('InvalidField-' . $CustomField->Id)) {
-        <br />
-        <span class="cfinvalidfield"><% $msg %></span>
+        <span class="cfinvalidfield my-1 d-inline-block"><% $msg %></span>
 %  } elsif ($ShowHints and $CustomField->FriendlyPattern) {
-        <br>
-        <span class="cfhints">
+        <span class="cfhints my-1 d-inline-block">
           <% $CustomField->FriendlyPattern %>
         </span>
 %  }
diff --git a/share/static/css/elevator-light/forms.css b/share/static/css/elevator-light/forms.css
index 2bfcc777f8..f7ee857543 100644
--- a/share/static/css/elevator-light/forms.css
+++ b/share/static/css/elevator-light/forms.css
@@ -151,6 +151,10 @@ div.widget .hints {
     color: red;
 }
 
+.cfhints {
+    color: #3858a3;
+}
+
 form div.submit div.buttons {
     min-height: 2.8em;
 }

commit 1e62570e00d1bcc21843fe4ecaec5c90d02f2041
Author: Brian Conry <bconry at bestpractical.com>
Date:   Tue May 31 13:09:14 2022 -0500

    Add UI for CF ValidationHint
    
    Adds the appropriate fields to the web UI for Custom Fields to set and
    maintain the ValidationHint value.  This value is only used when a
    Pattern is set for the field and is preferred by FriendlyPattern over
    deriving a hint from the regex.

diff --git a/share/html/Admin/CustomFields/Modify.html b/share/html/Admin/CustomFields/Modify.html
index d026f760ec..0810d86159 100644
--- a/share/html/Admin/CustomFields/Modify.html
+++ b/share/html/Admin/CustomFields/Modify.html
@@ -177,6 +177,15 @@ jQuery( function() {
   </div>
 </div>
 
+<div class="form-row">
+  <div class="label col-3">
+    <&|/l&>Validation Hint</&>
+  </div>
+  <div class="value col-9">
+    <input class="form-control" type="text" name="ValidationHint" value="<% $CustomFieldObj->ValidationHint // $ValidationHint // '' %>" size="80" />
+  </div>
+</div>
+
 % if ( $CustomFieldObj->SupportDefaultValues ) {
 <div class="form-row">
   <div class="label col-3 edit_default_values">
@@ -321,17 +330,18 @@ unless ( $id ) {
 else {
     if ( $id eq 'new' ) {
         my ( $val, $msg ) = $CustomFieldObj->Create(
-            Name          => $Name,
-            TypeComposite => $TypeComposite,
-            LookupType    => $LookupType,
-            Description   => $Description,
-            Pattern       => $Pattern,
-            LinkValueTo   => $LinkValueTo,
+            Name           => $Name,
+            TypeComposite  => $TypeComposite,
+            LookupType     => $LookupType,
+            Description    => $Description,
+            Pattern        => $Pattern,
+            LinkValueTo    => $LinkValueTo,
             IncludeContentForValue => $IncludeContentForValue,
-            BasedOn       => $BasedOn,
-            Disabled      => ($Enabled ? 0 : 1),
-            EntryHint     => $EntryHint,
-            UniqueValues  => $UniqueValues,
+            BasedOn        => $BasedOn,
+            Disabled       => ($Enabled ? 0 : 1),
+            EntryHint      => $EntryHint,
+            ValidationHint => $ValidationHint,
+            UniqueValues   => $UniqueValues,
         );
         if (!$val) {
             push @results, loc("Could not create CustomField: [_1]", $msg);
@@ -357,7 +367,7 @@ if ( $ARGS{'Update'} && $id ne 'new' ) {
     # make sure the unchecked checkbox still causes an update
     $ARGS{UniqueValues} ||= 0 if $SetUniqueValues;
 
-    my @attribs = qw(Disabled Pattern Name TypeComposite LookupType Description LinkValueTo IncludeContentForValue EntryHint UniqueValues);
+    my @attribs = qw(Disabled Pattern Name TypeComposite LookupType Description LinkValueTo IncludeContentForValue EntryHint ValidationHint UniqueValues);
 
     push @results, UpdateRecordObject(
         AttributesRef => \@attribs,
@@ -548,4 +558,5 @@ $LinkValueTo => undef
 $IncludeContentForValue => undef
 $BasedOn => undef
 $EntryHint => undef
+$ValidationHint => undef
 </%ARGS>

commit 11409676cc4ba88882d71503eac794c3d9a2ec24
Author: Brian Conry <bconry at bestpractical.com>
Date:   Fri May 27 13:31:18 2022 -0500

    Convert $cf->FriendlyPattern to use ValidationHint
    
    The RT::CustomField::FriendlyPattern method now uses the ValidationHint
    field if that is set, and the previous logic otherwise.
    
    This also refactored the 'Input must match [_1]' into FriendlyPattern
    from the places where the method is used.

diff --git a/lib/RT/CustomField.pm b/lib/RT/CustomField.pm
index 6541a39bd0..6c9abd4f9a 100644
--- a/lib/RT/CustomField.pm
+++ b/lib/RT/CustomField.pm
@@ -1840,7 +1840,7 @@ sub AddValueForObject {
     }
 
     unless ( $self->MatchPattern($args{'Content'}) ) {
-        return ( 0, $self->loc('Input must match [_1]', $self->FriendlyPattern) );
+        return ( 0, $self->FriendlyPattern );
     }
 
     $RT::Handle->BeginTransaction;
@@ -2040,12 +2040,21 @@ sub FriendlyPattern {
     my $regex = $self->Pattern;
 
     return '' unless length $regex;
-    if ( $regex =~ /\(\?#([^)]*)\)/ ) {
-        return '[' . $self->loc($1) . ']';
-    }
-    else {
-        return $regex;
+
+    my $hint = $self->ValidationHint;
+
+    # NOTE: this means there's no way to have no hint for the user
+    if ( !defined $hint or $hint eq '' ) {
+        if ( $regex =~ /\(\?#([^)]*)\)/ ) {
+            $hint = '[' . $self->loc($1) . ']';
+        }
+        else {
+            $hint = $regex;
+        }
+        $hint = $self->loc( 'Input must match [_1]', $hint );
     }
+
+    return $hint;
 }
 
 
@@ -2092,7 +2101,7 @@ sub DeleteValueForObject {
 
     # for single-value fields, we need to validate that empty string is a valid value for it
     if ( $self->SingleValue and not $self->MatchPattern( '' ) ) {
-        return ( 0, $self->loc('Input must match [_1]', $self->FriendlyPattern) );
+        return ( 0, $self->FriendlyPattern );
     }
 
     # delete it
diff --git a/share/html/Elements/EditCustomFields b/share/html/Elements/EditCustomFields
index 47d21f0d68..149e447ce5 100644
--- a/share/html/Elements/EditCustomFields
+++ b/share/html/Elements/EditCustomFields
@@ -76,7 +76,7 @@
 %  } elsif ($ShowHints and $CustomField->FriendlyPattern) {
         <br>
         <span class="cfhints">
-          <&|/l, $CustomField->FriendlyPattern &>Input must match [_1]</&>
+          <% $CustomField->FriendlyPattern %>
         </span>
 %  }
     </div>
diff --git a/share/html/Elements/ValidateCustomFields b/share/html/Elements/ValidateCustomFields
index 69c2c179aa..3edb56dc97 100644
--- a/share/html/Elements/ValidateCustomFields
+++ b/share/html/Elements/ValidateCustomFields
@@ -118,7 +118,7 @@ while ( my $CF = $CustomFields->Next ) {
         }
 
         if (!$CF->MatchPattern($value)) {
-            my $msg = loc("Input must match [_1]", $CF->FriendlyPattern);
+            my $msg = $CF->FriendlyPattern;
             $m->notes( ('InvalidField-' . $CF->Id) => $msg );
             push @res, $CF->Name .': '. $msg;
             $valid = 0;
diff --git a/t/api/cf_validation_hint.t b/t/api/cf_validation_hint.t
new file mode 100644
index 0000000000..c3e6403d1d
--- /dev/null
+++ b/t/api/cf_validation_hint.t
@@ -0,0 +1,36 @@
+use strict;
+use warnings;
+
+use RT::Test tests => 6;
+
+my $cf = RT::CustomField->new($RT::SystemUser);
+my ( $id, $ret, $msg );
+
+diag "single select";
+( $id, $msg ) = $cf->Create(
+    Name      => 'single_select',
+    Type      => 'FreeformSingle',
+    MaxValues => '1',
+    Queue     => 0,
+);
+ok( $id, $msg );
+
+is( $cf->FriendlyPattern, '', 'Empty hint with no pattern' );
+
+( $ret, $msg ) = $cf->SetPattern( '^(?#CustomPattern).*$' );
+
+is( $cf->FriendlyPattern, 'Input must match [CustomPattern]', 'Hint from pattern comment' );
+
+( $ret, $msg ) = $cf->SetValidationHint( 'CustomHint' );
+
+is( $cf->FriendlyPattern, 'CustomHint', 'Explicit hint overrides pattern comment' );
+
+( $ret, $msg ) = $cf->SetValidationHint( '' );
+
+( $ret, $msg ) = $cf->SetPattern( '^.*$' );
+
+is( $cf->FriendlyPattern, 'Input must match ^.*$', 'Hint from pattern' );
+
+( $ret, $msg ) = $cf->SetValidationHint( 'CustomHint' );
+
+is( $cf->FriendlyPattern, 'CustomHint', 'Explicit hint overrides pattern text' );

commit 80bfa8bf5bcc80b19950d5571577ec68a8a18cb7
Author: Brian Conry <bconry at bestpractical.com>
Date:   Fri May 27 11:29:52 2022 -0500

    Add ValidationHint column for CustomFields table

diff --git a/etc/schema.Oracle b/etc/schema.Oracle
index 324f790d19..0a8f7c69c7 100644
--- a/etc/schema.Oracle
+++ b/etc/schema.Oracle
@@ -360,6 +360,7 @@ CREATE TABLE CustomFields (
         SortOrder         NUMBER(11,0) DEFAULT 0 NOT NULL,
         LookupType        VARCHAR2(255),
         EntryHint         VARCHAR2(255) NULL,
+        ValidationHint    VARCHAR2(255) NULL,
         UniqueValues      NUMBER(11,0) DEFAULT 0 NOT NULL,
         CanonicalizeClass VARCHAR2(64),
         Creator           NUMBER(11,0) DEFAULT 0 NOT NULL,
diff --git a/etc/schema.Pg b/etc/schema.Pg
index 9f34ec4b0a..ad3b0cdd38 100644
--- a/etc/schema.Pg
+++ b/etc/schema.Pg
@@ -540,6 +540,7 @@ CREATE TABLE CustomFields (
   Pattern varchar(65536) NULL  ,
   LookupType varchar(255) NOT NULL  ,
   EntryHint varchar(255) NULL,
+  ValidationHint varchar(255) NULL,
   Description varchar(255) NULL  ,
   SortOrder integer NOT NULL DEFAULT 0  ,
   UniqueValues integer NOT NULL DEFAULT 0 ,
diff --git a/etc/schema.SQLite b/etc/schema.SQLite
index d2e455f9e5..d022331275 100644
--- a/etc/schema.SQLite
+++ b/etc/schema.SQLite
@@ -388,6 +388,7 @@ CREATE TABLE CustomFields (
   SortOrder integer NOT NULL DEFAULT 0  ,
   LookupType varchar(255) collate NOCASE NOT NULL,
   EntryHint varchar(255) NULL,
+  ValidationHint varchar(255) NULL,
   UniqueValues int2 NOT NULL DEFAULT 0,
   CanonicalizeClass varchar(64) collate NOCASE NULL  ,
 
diff --git a/etc/schema.mysql b/etc/schema.mysql
index f773ffd472..7035085ea2 100644
--- a/etc/schema.mysql
+++ b/etc/schema.mysql
@@ -360,6 +360,7 @@ CREATE TABLE CustomFields (
   SortOrder integer NOT NULL DEFAULT 0  ,
   LookupType varchar(255) CHARACTER SET ascii NOT NULL,
   EntryHint varchar(255) NULL,
+  ValidationHint varchar(255) NULL,
   UniqueValues int2 NOT NULL DEFAULT 0 ,
   CanonicalizeClass varchar(64) CHARACTER SET ascii NULL  ,
 
diff --git a/etc/upgrade/5.0.4/schema.Oracle b/etc/upgrade/5.0.4/schema.Oracle
new file mode 100644
index 0000000000..ab87bd37fd
--- /dev/null
+++ b/etc/upgrade/5.0.4/schema.Oracle
@@ -0,0 +1 @@
+ALTER TABLE CustomFields ADD ValidationHint VARCHAR2(255) NULL;
diff --git a/etc/upgrade/5.0.4/schema.Pg b/etc/upgrade/5.0.4/schema.Pg
new file mode 100644
index 0000000000..489ae51a84
--- /dev/null
+++ b/etc/upgrade/5.0.4/schema.Pg
@@ -0,0 +1 @@
+ALTER TABLE CustomFields ADD COLUMN ValidationHint VARCHAR(255) NULL;
diff --git a/etc/upgrade/5.0.4/schema.SQLite b/etc/upgrade/5.0.4/schema.SQLite
new file mode 100644
index 0000000000..489ae51a84
--- /dev/null
+++ b/etc/upgrade/5.0.4/schema.SQLite
@@ -0,0 +1 @@
+ALTER TABLE CustomFields ADD COLUMN ValidationHint VARCHAR(255) NULL;
diff --git a/etc/upgrade/5.0.4/schema.mysql b/etc/upgrade/5.0.4/schema.mysql
new file mode 100644
index 0000000000..489ae51a84
--- /dev/null
+++ b/etc/upgrade/5.0.4/schema.mysql
@@ -0,0 +1 @@
+ALTER TABLE CustomFields ADD COLUMN ValidationHint VARCHAR(255) NULL;
diff --git a/lib/RT/CustomField.pm b/lib/RT/CustomField.pm
index c0112ae7da..6541a39bd0 100644
--- a/lib/RT/CustomField.pm
+++ b/lib/RT/CustomField.pm
@@ -258,6 +258,7 @@ Create takes a hash of values and creates a row in the database:
   int(11) 'SortOrder'.
   varchar(255) 'LookupType'.
   varchar(255) 'EntryHint'.
+  varchar(255) 'ValidationHint'.
   smallint(6) 'Disabled'.
 
 C<LookupType> is generally the result of either
@@ -279,6 +280,7 @@ sub Create {
         LinkValueTo            => '',
         IncludeContentForValue => '',
         EntryHint              => undef,
+        ValidationHint         => undef,
         UniqueValues           => 0,
         CanonicalizeClass      => undef,
         @_,
@@ -383,6 +385,7 @@ sub Create {
         }
 
         $self->SetEntryHint( $args{EntryHint} // $self->FriendlyType );
+        $self->SetValidationHint( $args{ValidationHint} ) if $args{ValidationHint};
 
         if ( exists $args{'IncludeContentForValue'}) {
             $self->SetIncludeContentForValue($args{'IncludeContentForValue'});
@@ -986,6 +989,11 @@ sub SetPattern {
     my $self = shift;
     my $regex = shift;
 
+    # NOTE: we can't currently automatically update the ValidationHint here the way that
+    #       we update the EntryHint when the type changes because FriendlyPattern will
+    #       return ValidationHint if it's set, while FriendlyType doesn't do anything with
+    #       the EntryHint.
+
     my ($ok, $msg) = $self->_IsValidRegex($regex);
     if ($ok) {
         return $self->_Set(Field => 'Pattern', Value => $regex);
@@ -2628,6 +2636,17 @@ Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
 =cut
 
 
+=head2 SetValidationHint VALUE
+
+
+Set ValidationHint to VALUE.
+Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
+(In the database, ValidationHint will be stored as a varchar(255).)
+
+
+=cut
+
+
 =head2 Creator
 
 Returns the current value of Creator. 
@@ -2710,6 +2729,8 @@ sub _CoreAccessible {
         {read => 1, write => 1, sql_type => 12, length => 255,  is_blob => 0,  is_numeric => 0,  type => 'varchar(255)', default => ''},
         EntryHint =>
         {read => 1, write => 1, sql_type => 12, length => 255,  is_blob => 0, is_numeric => 0,  type => 'varchar(255)', default => undef },
+        ValidationHint =>
+        {read => 1, write => 1, sql_type => 12, length => 255,  is_blob => 0, is_numeric => 0,  type => 'varchar(255)', default => undef },
         UniqueValues =>
         {read => 1, write => 1, sql_type => 5, length => 6,  is_blob => 0,  is_numeric => 1,  type => 'smallint(6)', default => '0'},
         CanonicalizeClass =>
diff --git a/share/html/Elements/RT__CustomField/ColumnMap b/share/html/Elements/RT__CustomField/ColumnMap
index 4c47e106a7..cc951c58fe 100644
--- a/share/html/Elements/RT__CustomField/ColumnMap
+++ b/share/html/Elements/RT__CustomField/ColumnMap
@@ -63,7 +63,7 @@ my $COLUMN_MAP = {
             title     => $c, attribute => $c,
             value     => sub { return $_[0]->$c() },
         } }
-        qw(Name Description Type LookupType Pattern EntryHint RenderType ValuesClass CanonicalizeClass)
+        qw(Name Description Type LookupType Pattern EntryHint ValidationHint RenderType ValuesClass CanonicalizeClass)
     ),
     map(
         { my $c = $_; my $short = $c; $short =~ s/^Friendly//;

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


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list