[Rt-commit] rt branch, 4.4/columns-as-values-in-ticket-search, updated. rt-4.4.4-9-g7f090c715

? sunnavy sunnavy at bestpractical.com
Tue Jun 11 17:12:16 EDT 2019


The branch, 4.4/columns-as-values-in-ticket-search has been updated
       via  7f090c7154b484f6a24127a7f008502032cf1ac9 (commit)
      from  1cad1ce87520dffaab889966870ee9b6a9da523c (commit)

Summary of changes:
 lib/RT/SearchBuilder.pm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

- Log -----------------------------------------------------------------
commit 7f090c7154b484f6a24127a7f008502032cf1ac9
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Jun 12 04:43:00 2019 +0800

    Tweak preparse logic when columns are used as custom field values in search
    
    Usually we don't need to preparse columns as they themselves are not
    real values.  An exception is Date cf: to compare date cfs with datetime
    columns(like "Created", "Due", etc), we only need to compare the date
    part.

diff --git a/lib/RT/SearchBuilder.pm b/lib/RT/SearchBuilder.pm
index 09a775ec3..72afc64e9 100644
--- a/lib/RT/SearchBuilder.pm
+++ b/lib/RT/SearchBuilder.pm
@@ -552,7 +552,13 @@ sub _LimitCustomField {
     ########## Content pre-parsing if we know things about the CF
     if ( blessed($cf) and delete $args{PREPARSE} ) {
         my $type = $cf->Type;
-        if ( $type eq 'IPAddress' ) {
+
+        if ( !$args{QUOTEVALUE} ) {
+            if ( $type eq 'Date' ) {
+                $value = "SUBSTR($value, 1,  10)";
+            }
+        }
+        elsif ( $type eq 'IPAddress' ) {
             my $parsed = RT::ObjectCustomFieldValue->ParseIP($value);
             if ($parsed) {
                 $value = $parsed;

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


More information about the rt-commit mailing list