Merge "LogPager: Add backwards-compatibility for hide_[type]_log URL params"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 23 Jul 2018 20:55:21 +0000 (20:55 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 23 Jul 2018 20:55:21 +0000 (20:55 +0000)
1  2 
includes/logging/LogEventsList.php

@@@ -170,9 -170,7 +170,9 @@@ class LogEventsList extends ContextSour
                        $formDescriptor['subtype'] = $this->getActionSelectorDesc( $types, $action );
                }
  
 -              $htmlForm = new HTMLForm( $formDescriptor, $this->getContext() );
 +              $context = new DerivativeContext( $this->getContext() );
 +              $context->setTitle( $title ); // Remove subpage
 +              $htmlForm = new HTMLForm( $formDescriptor, $context );
                $htmlForm
                        ->setSubmitText( $this->msg( 'logeventslist-submit' )->text() )
                        ->setMethod( 'get' )
                $options = [];
                $default = [];
                foreach ( $filter as $type => $val ) {
 -                      $options[ $this->msg( "logeventslist-{$type}-log" )->text() ] = $type;
 +                      $message = $this->msg( "logeventslist-{$type}-log" );
 +                      // FIXME: Remove this check once T199657 is fully resolved.
 +                      if ( !$message->exists() ) {
 +                              $message = $this->msg( "log-show-hide-{$type}" )->params( $this->msg( 'show' )->text() );
 +                      }
 +                      $options[ $message->text() ] = $type;
  
-                       if ( $val === 0 ) {
+                       if ( $val === false ) {
                                $default[] = $type;
                        }
                }
  
                // Let extensions add data
                Hooks::run( 'LogEventsListLineEnding', [ $this, &$ret, $entry, &$classes, &$attribs ] );
 -              $attribs = wfArrayFilterByKey( $attribs, [ Sanitizer::class, 'isReservedDataAttribute' ] );
 +              $attribs = array_filter( $attribs,
 +                      [ Sanitizer::class, 'isReservedDataAttribute' ],
 +                      ARRAY_FILTER_USE_KEY
 +              );
                $attribs['class'] = implode( ' ', $classes );
  
                return Html::rawElement( 'li', $attribs, $ret ) . "\n";