Merge "LogEventsList: Don't output '0000-00-00' as default date"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 14 Nov 2018 15:29:58 +0000 (15:29 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 14 Nov 2018 15:29:58 +0000 (15:29 +0000)
1  2 
includes/logging/LogEventsList.php

@@@ -148,7 -148,7 +148,7 @@@ class LogEventsList extends ContextSour
                $formDescriptor['date'] = [
                        'type' => 'date',
                        'label-message' => 'date',
-                       'default' => sprintf( "%04d-%02d-%02d", $year, $month, $day ),
+                       'default' => $year && $month && $day ? sprintf( "%04d-%02d-%02d", $year, $month, $day ) : '',
                ];
  
                // Tag filter
  
                $context = new DerivativeContext( $this->getContext() );
                $context->setTitle( SpecialPage::getTitleFor( 'Log' ) ); // Remove subpage
 -              $htmlForm = new HTMLForm( $formDescriptor, $context );
 +              $htmlForm = HTMLForm::factory( 'ooui', $formDescriptor, $context );
                $htmlForm
                        ->setSubmitText( $this->msg( 'logeventslist-submit' )->text() )
                        ->setMethod( 'get' )