[Rt-devel] RT 3.6 PATCH: Always show CF pattern helper text

Todd Chapman todd at chaka.net
Fri Jun 23 00:55:15 EDT 2006


The ticket creation page shows the helper text for
custom fields. But if the Pattern can match an
empty string, the helper text is not displayed. This
happens when you pattern checks that the value is
the right format, but an empty string is valid too.
For example: (?#Optional Digits)^([\d.]+)?$

This patch allows the helper text to display under
these conditions.

-------------- next part --------------
==== Patch <showhelp> level 1
Source: [No source]
Target: e417ac7c-1bcc-0310-8ffa-8f5827389a85:/rt/branches/3.6-RELEASE/html/Elements:5408
        (svn://svn.bestpractical.com)
Log:
The ticket creation page shows the helper text for
custom fields. But if the Pattern can match an 
empty string, the helper text is not displayed. This
happens when you pattern checks that the value is
the right format, but an empty string is valid too.
For example: (?#Optional Digits)^([\d.]+)?$

This patch allows the helper text to display under
these conditions.
=== ValidateCustomFields
==================================================================
--- ValidateCustomFields	(revision 5408)
+++ ValidateCustomFields	(patch showhelp level 1)
@@ -62,7 +62,7 @@
     }
 
     $m->notes(('Field-' . $CF->Id) => $value);
-    next if $CF->MatchPattern($value);
+    next if $CF->MatchPattern($value) and ( !$CF->MatchPattern('') or !$CF->Pattern );
     $m->notes(
         ('InvalidField-' . $CF->Id)
             => (loc("Input must match [_1]", $CF->FriendlyPattern))

==== BEGIN SVK PATCH BLOCK ====
Version: svk 1.07 (linux)

eJxtU9tuEzEQzXPERxixpalokl3vNUEKgZK8cBUNfaEQOd7ZrFXHXtlO2kh+4hcq+A1+EXubSJXg
YS3NzsyZc449c7V4OY3sZBLaIArt5dW78fgzMbQ+cVGQWSiZkSpILYcd8CC2XK6DxAqyAZc1RK3B
TCaRay4emmdtwxEk8RgrYqTQwagFWxoFEEQWT2M7xdadLohcUjYglkpK4+DzKE1dcukpUS41LH2r
L099OT6WV4xDgEN7RTgriYGLrTZyM2fAS93CHqBiD5UeoEqmgDqOe1/xgNlmSdPw/dLAnSmBG9LO
ibHFEayI+9KwSHJCIIowTpIIZzkUAGQUZF75x07n1/XvJ91h5z7v/On8fH6fISJK1ENPg4t5f/LB
2+E8MaBE7/T0DEl1yBx+omnyWG+r7MAgizHkIzqiWVlG5Sgr8wRwHFUVTmhYJbhVGme5XdSADKM3
YBBVQAyTAjVkDUjX8lYj49I18AYU8ipRJVWXto6hqrVsgN5sDWJVW3nkRYlAG8/e6UFd2DRmj7RR
TKzP/0FkGglpUMl0w8keygFa1Ex3a2ctCI1uaxBoL7eO1AG7BnrjiRHTYu0I34JD6fpAsXXdknTT
z9HKMXMEHs/343b+5pGRctCdO0vhjmwaDmPUe/XsU+MNIBy9ZWtm9NmP3rfrcvD9xdmroNv1vDwN
L4vz/7lj5FEH2ooSlOekAVEp3FN0wHoQFNYb65smE2wDjB9WYNFuxXj8VbAdKE34SWbdS3TTardA
CnYu2G5ZGcSFHSozXCkinBN6GA+y/pfZ+9nry9mwNhs+nHHYgDDaNaRJWLhLtpBEOaE57UcrSvth
HIX9oqqIO9IC53ExIkX6F3dzRcE=
==== END SVK PATCH BLOCK ====


More information about the Rt-devel mailing list