Merge "SpecialWatchlist: Don't display '0' in the selector when 'all' is chosen"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 7 Dec 2015 10:17:22 +0000 (10:17 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 7 Dec 2015 10:17:22 +0000 (10:17 +0000)
1  2 
includes/specials/SpecialWatchlist.php

@@@ -476,7 -476,7 +476,7 @@@ class SpecialWatchlist extends ChangesL
                $form .= $this->msg( 'watchlist-hide' ) .
                        $this->msg( 'colon-separator' )->escaped() .
                        implode( ' ', $links );
 -              $form .= "\n<hr />\n<p>";
 +              $form .= "\n<br />\n";
                $form .= Html::namespaceSelector(
                        array(
                                'selected' => $opts['namespace'],
                        $opts['associated'],
                        array( 'title' => $this->msg( 'tooltip-namespace_association' )->text() )
                ) . "</span>\n";
 -              $form .= Xml::submitButton( $this->msg( 'allpagessubmit' )->text() ) . "</p>\n";
 +              $form .= Xml::submitButton( $this->msg( 'allpagessubmit' )->text() ) . "\n";
                foreach ( $hiddenFields as $key => $value ) {
                        $form .= Html::hidden( $key, $value ) . "\n";
                }
  
                $userWatchlistOption = (string)$this->getUser()->getOption( 'watchlistdays' );
                // add the user preference, if it isn't available already
-               if ( !in_array( $userWatchlistOption, $days ) ) {
+               if ( !in_array( $userWatchlistOption, $days ) && $userWatchlistOption !== '0' ) {
                        $days[] = $userWatchlistOption;
                }
  
                $selected = (string)$options['days'];
                // add the currently selected value, if it isn't available already
-               if ( !in_array( $selected, $days ) ) {
+               if ( !in_array( $selected, $days ) && $selected !== '0' ) {
                        $days[] = $selected;
                }
  
  
                // 'all' option
                $name = $this->msg( 'watchlistall2' )->text();
-               $value = 0;
+               $value = '0';
                $select->addOption( $name, $value );
  
                return $select->getHTML() . "\n<br />\n";