Merge "WLFilters: Fix seen/unseen filters"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 25 Aug 2017 19:56:52 +0000 (19:56 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 25 Aug 2017 19:56:52 +0000 (19:56 +0000)
.gitignore
includes/DefaultSettings.php
includes/http/MWHttpRequest.php
includes/specials/SpecialPageLanguage.php
includes/specials/SpecialWatchlist.php

index 388f354..b991e11 100644 (file)
@@ -42,6 +42,7 @@ sftp-config.json
 /StartProfiler.php
 
 # Building & testing
+npm-debug.log
 node_modules/
 /tests/phpunit/phpunit.phar
 
index d07136b..5d95964 100644 (file)
@@ -755,6 +755,8 @@ $wgCopyUploadProxy = false;
  * timeout longer than the default $wgHTTPTimeout. False means fallback
  * to default.
  *
+ * @var int|bool
+ *
  * @since 1.22
  */
 $wgCopyUploadTimeout = false;
@@ -8271,6 +8273,7 @@ $wgShellLocale = 'C.UTF-8';
 
 /**
  * Timeout for HTTP requests done internally, in seconds.
+ * @var int
  */
 $wgHTTPTimeout = 25;
 
index 88cc510..0f0118c 100644 (file)
@@ -33,8 +33,12 @@ use Psr\Log\NullLogger;
 class MWHttpRequest implements LoggerAwareInterface {
        const SUPPORTS_FILE_POSTS = false;
 
-       protected $content;
+       /**
+        * @var int|string
+        */
        protected $timeout = 'default';
+
+       protected $content;
        protected $headersOnly = null;
        protected $postData = null;
        protected $proxy = null;
index 78a453e..a68f08f 100644 (file)
@@ -49,12 +49,20 @@ class SpecialPageLanguage extends FormSpecialPage {
        protected function getFormFields() {
                // Get default from the subpage of Special page
                $defaultName = $this->par;
+               $title = $defaultName ? Title::newFromText( $defaultName ) : null;
+               if ( $title ) {
+                       $defaultPageLanguage =
+                               ContentHandler::getForTitle( $title )->getPageLanguage( $title );
+                       $hasCustomLanguageSet = !$defaultPageLanguage->equals( $title->getPageLanguage() );
+               } else {
+                       $hasCustomLanguageSet = false;
+               }
 
                $page = [];
                $page['pagename'] = [
                        'type' => 'title',
                        'label-message' => 'pagelang-name',
-                       'default' => $defaultName,
+                       'default' => $title ? $title->getPrefixedText() : $defaultName,
                        'autofocus' => $defaultName === null,
                        'exists' => true,
                ];
@@ -68,7 +76,7 @@ class SpecialPageLanguage extends FormSpecialPage {
                        'id' => 'mw-pl-options',
                        'type' => 'radio',
                        'options' => $selectoptions,
-                       'default' => 1
+                       'default' => $hasCustomLanguageSet ? 2 : 1
                ];
 
                // Building a language selector
@@ -86,7 +94,9 @@ class SpecialPageLanguage extends FormSpecialPage {
                        'type' => 'select',
                        'options' => $options,
                        'label-message' => 'pagelang-language',
-                       'default' => $this->getConfig()->get( 'LanguageCode' ),
+                       'default' => $title ?
+                               $title->getPageLanguage()->getCode() :
+                               $this->getConfig()->get( 'LanguageCode' ),
                ];
 
                // Allow user to enter a comment explaining the change
index a17f118..cecc182 100644 (file)
@@ -411,6 +411,10 @@ class SpecialWatchlist extends ChangesListSpecialPage {
 
                $this->runMainQueryHook( $tables, $fields, $conds, $query_options, $join_conds, $opts );
 
+               if ( $this->areFiltersInConflict() ) {
+                       return false;
+               }
+
                return $dbr->select(
                        $tables,
                        $fields,