[Rt-commit] rt branch, 4.2/remove-extra-parsedate, created. rt-4.2.3-88-g059489b

Alex Vandiver alexmv at bestpractical.com
Tue Apr 22 14:46:31 EDT 2014


The branch, 4.2/remove-extra-parsedate has been created
        at  059489b6b195bc434d2692c1e02f4d6bbdddfe17 (commit)

- Log -----------------------------------------------------------------
commit ae2000dd8fe5069bdf3317b534a97d85806e15fd
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Tue Apr 22 14:42:03 2014 -0400

    Remove an extraneous direct use of Time::ParseDate in Articles
    
    When datetime searching was introduced in RTFM 2.0, it could not rely on
    RT's core RT::Date field to parse arbitrary times, and took the long way
    around, calling Time::ParseDate itself.  This is unnecessary; switch to
    the standard ->Set(Format => 'unknown', Value => ...) phrasing.
    
    Fixes I#24498.

diff --git a/lib/RT/Articles.pm b/lib/RT/Articles.pm
index 410578a..97a4708 100644
--- a/lib/RT/Articles.pm
+++ b/lib/RT/Articles.pm
@@ -595,16 +595,10 @@ sub Search {
     }
 
 
-    require Time::ParseDate;
     foreach my $date (qw(Created< Created> LastUpdated< LastUpdated>)) {
         next unless ( $args{$date} );
-        my ($seconds, $error) = Time::ParseDate::parsedate( $args{$date}, FUZZY => 1, PREFER_PAST => 1 );
-        unless ( defined $seconds ) {
-            $RT::Logger->warning(
-                "Couldn't parse date '$args{$date}' by Time::ParseDate" );
-        }
         my $date_obj = RT::Date->new( $self->CurrentUser );
-        $date_obj->Set( Format => 'unix', Value => $seconds );
+        $date_obj->Set( Format => 'unknown', Value => $args{$date} );
         $dates->{$date} = $date_obj;
 
         if ( $date =~ /^(.*?)<$/i ) {

commit 059489b6b195bc434d2692c1e02f4d6bbdddfe17
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Tue Apr 22 14:44:53 2014 -0400

    Remove an extraneous "use Time::ParseDate"
    
    This came in during 7d367769, which moved it from within the
    HTML::Mason::Commands package to the RT::Interface::Web package.  This
    had previously made "parsedate" available to Mason elements, but as of
    7d367769 it no longer was -- nor is it used in RT::Interface::Web
    directly.  Remove it.

diff --git a/lib/RT/Interface/Web/Handler.pm b/lib/RT/Interface/Web/Handler.pm
index 81baaf5..aa4767c 100644
--- a/lib/RT/Interface/Web/Handler.pm
+++ b/lib/RT/Interface/Web/Handler.pm
@@ -54,7 +54,6 @@ use CGI qw/-private_tempfiles/;
 use MIME::Entity;
 use Text::Wrapper;
 use CGI::Cookie;
-use Time::ParseDate;
 use Time::HiRes;
 use HTML::Scrubber;
 use RT::Interface::Web;

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


More information about the rt-commit mailing list