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

? sunnavy sunnavy at bestpractical.com
Fri Jun 21 14:41:25 EDT 2019


The branch, 4.4/columns-as-values-in-ticket-search has been updated
       via  146ed9f4d57d28b19effb95d2c361f08c2a97382 (commit)
       via  fc72b6521bba8287546ce3fa287a6e3e5fb4745e (commit)
      from  dc1a5204c687d3d00d1f76598862311a4b49a103 (commit)

Summary of changes:
 lib/RT/Tickets.pm | 4 ++++
 1 file changed, 4 insertions(+)

- Log -----------------------------------------------------------------
commit fc72b6521bba8287546ce3fa287a6e3e5fb4745e
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Jun 21 21:52:14 2019 +0800

    Revert to the old behavior of "treating unset dates to NULL"
    
    This behavior was dropped in 528277f609, where we added support of
    columns as values in ticket search. Either behavior has pros and cons,
    but it feels more right to not break back compatibility.

diff --git a/lib/RT/Tickets.pm b/lib/RT/Tickets.pm
index 6cce1f595..aff98c3e0 100644
--- a/lib/RT/Tickets.pm
+++ b/lib/RT/Tickets.pm
@@ -671,6 +671,7 @@ sub _DateLimit {
     }
     else {
         $sb->Limit(
+            FUNCTION => $sb->NotSetDateToNullFunction,
             FIELD    => $meta->[1],
             OPERATOR => $op,
             VALUE    => $date ? $date->ISO : $value,

commit 146ed9f4d57d28b19effb95d2c361f08c2a97382
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Jun 21 21:42:18 2019 +0800

    Make date searches with 0 like "Due > 0" work as before
    
    Previously 0 was converted to epoch time "1970-01-01 00:00:00", so
    people could use "Due > 0" to search tickets with Due date set.
    
    This commit is to reserve this behavior.

diff --git a/lib/RT/Tickets.pm b/lib/RT/Tickets.pm
index aff98c3e0..a88323627 100644
--- a/lib/RT/Tickets.pm
+++ b/lib/RT/Tickets.pm
@@ -632,6 +632,9 @@ sub _DateLimit {
     }
 
     my $date;
+    # this is to make queries like "Due > 0" still work
+    $rest{QUOTEVALUE} = 1 if $value eq '0';
+
     if ( $rest{QUOTEVALUE} ) {
         $date = RT::Date->new( $sb->CurrentUser );
         $date->Set( Format => 'unknown', Value => $value );

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


More information about the rt-commit mailing list