Merge "objectcache: fix cache warmup bug in getMultiWithSetCallback()"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 26 May 2017 22:14:01 +0000 (22:14 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 26 May 2017 22:14:01 +0000 (22:14 +0000)
15 files changed:
includes/OutputPage.php
includes/WebStart.php
includes/libs/rdbms/database/DatabasePostgres.php
includes/page/WikiPage.php
languages/i18n/en.json
languages/i18n/qqq.json
maintenance/backupPrefetch.inc
maintenance/dumpTextPass.php
resources/Resources.php
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.SavedLinksListItemWidget.less
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.SavedLinksListWidget.less
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.SavedLinksListItemWidget.js
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.SavedLinksListWidget.js
tests/phpunit/includes/OutputPageTest.php
tests/phpunit/maintenance/backupTextPassTest.php

index c739b30..e22f42c 100644 (file)
@@ -3644,10 +3644,21 @@ class OutputPage extends ContextSource {
                        [ 'name' => 'ResourceLoaderDynamicStyles', 'content' => '' ]
                );
 
+               $separateReq = [ 'site.styles', 'user.styles' ];
                foreach ( $this->rlExemptStyleModules as $group => $moduleNames ) {
-                       $chunks[] = $this->makeResourceLoaderLink( $moduleNames,
+                       // Combinable modules
+                       $chunks[] = $this->makeResourceLoaderLink(
+                               array_diff( $moduleNames, $separateReq ),
                                ResourceLoaderModule::TYPE_STYLES
                        );
+
+                       foreach ( array_intersect( $moduleNames, $separateReq ) as $name ) {
+                               // These require their own dedicated request in order to support "@import"
+                               // syntax, which is incompatible with concatenation. (T147667, T37562)
+                               $chunks[] = $this->makeResourceLoaderLink( $name,
+                                       ResourceLoaderModule::TYPE_STYLES
+                               );
+                       }
                }
 
                return self::combineWrappedStrings( array_merge( $chunks, $append ) );
index 15804c7..e281b6f 100644 (file)
@@ -1,12 +1,11 @@
 <?php
 /**
  * This does the initial set up for a web request.
- * It does some security checks, starts the profiler and loads the
- * configuration, and optionally loads Setup.php depending on whether
- * MW_NO_SETUP is defined.
  *
- * Setup.php (if loaded) then sets up GlobalFunctions, the AutoLoader,
- * and the configuration globals.
+ * It does some security checks, loads autoloaders, constants, and
+ * global functions, starts the profiler, loads the configuration,
+ * and loads Setup.php, which loads extensions using the extension
+ * registration system and initializes the application's global state.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
index f84ffa9..2fe275b 100644 (file)
@@ -776,7 +776,7 @@ __INDEXATTR__;
                $safeseq = str_replace( "'", "''", $seqName );
                $res = $this->query( "SELECT nextval('$safeseq')" );
                $row = $this->fetchRow( $res );
-               $this->mInsertId = $row[0];
+               $this->mInsertId = is_null( $row[0] ) ? null : (int)$row[0];
 
                return $this->mInsertId;
        }
index a687900..5f8da15 100644 (file)
@@ -1177,7 +1177,7 @@ class WikiPage implements Page, IDBAccessObject {
                );
 
                if ( $dbw->affectedRows() > 0 ) {
-                       $newid = $pageId ?: $dbw->insertId();
+                       $newid = $pageId ? (int)$pageId : $dbw->insertId();
                        $this->mId = $newid;
                        $this->mTitle->resetArticleID( $newid );
 
index cc60432..22f2745 100644 (file)
        "recentchanges-submit": "Show",
        "rcfilters-activefilters": "Active filters",
        "rcfilters-quickfilters": "Quick links",
-       "rcfilters-quickfilters-placeholder": "Save your favorite tool settings to re-use them later.",
+       "rcfilters-quickfilters-placeholder-title": "No links saved yet",
+       "rcfilters-quickfilters-placeholder-description": "To save your filter settings and reuse them later, click the bookmark icon in the Active Filter area, below.",
        "rcfilters-savedqueries-defaultlabel": "Saved filters",
        "rcfilters-savedqueries-rename": "Rename",
        "rcfilters-savedqueries-setdefault": "Set as default",
index 694ef74..3c9791e 100644 (file)
        "recentchanges-submit": "Label for submit button in [[Special:RecentChanges]]\n{{Identical|Show}}",
        "rcfilters-activefilters": "Title for the filters selection showing the active filters.",
        "rcfilters-quickfilters": "Label for the button that opens the quick filters menu in [[Special:RecentChanges]]",
-       "rcfilters-quickfilters-placeholder": "Text shown in the quick filters menu on [[Special:RecentChanges]] if the user has not saved any quick filters.",
+       "rcfilters-quickfilters-placeholder-title": "Title for the text shown in the quick filters menu on [[Special:RecentChanges]] if the user has not saved any quick filters.",
+       "rcfilters-quickfilters-placeholder-description": "Description for the text shown in the quick filters menu on [[Special:RecentChanges]] if the user has not saved any quick filters.",
        "rcfilters-savedqueries-defaultlabel": "Default name for saving a new set of quick filters [[Special:RecentChanges]]",
        "rcfilters-savedqueries-rename": "Label for the menu option that edits a quick filter in [[Special:RecentChanges]]\n{{Identical|Rename}}",
        "rcfilters-savedqueries-setdefault": "Label for the menu option that sets a quick filter as default in [[Special:RecentChanges]]",
index 265800e..6a2d3bf 100644 (file)
@@ -40,6 +40,7 @@
  * @ingroup Maintenance
  */
 class BaseDump {
+       /** @var XMLReader */
        protected $reader = null;
        protected $atEnd = false;
        protected $atPageEnd = false;
index 581f0d7..c6e9aad 100644 (file)
@@ -33,7 +33,12 @@ use Wikimedia\Rdbms\IMaintainableDatabase;
  * @ingroup Maintenance
  */
 class TextPassDumper extends BackupDumper {
+       /** @var BaseDump */
        public $prefetch = null;
+       /** @var string|bool */
+       private $thisPage;
+       /** @var string|bool */
+       private $thisRev;
 
        // when we spend more than maxTimeAllowed seconds on this run, we continue
        // processing until we write out the next complete page, then save output file(s),
@@ -583,8 +588,7 @@ TEXT
                                if ( $text === false && isset( $this->prefetch ) && $prefetchNotTried ) {
                                        $prefetchNotTried = false;
                                        $tryIsPrefetch = true;
-                                       $text = $this->prefetch->prefetch( intval( $this->thisPage ),
-                                               intval( $this->thisRev ) );
+                                       $text = $this->prefetch->prefetch( (int)$this->thisPage, (int)$this->thisRev );
 
                                        if ( $text === null ) {
                                                $text = false;
index 5a75e5a..d100078 100644 (file)
@@ -1805,7 +1805,8 @@ return [
                'messages' => [
                        'rcfilters-activefilters',
                        'rcfilters-quickfilters',
-                       'rcfilters-quickfilters-placeholder',
+                       'rcfilters-quickfilters-placeholder-title',
+                       'rcfilters-quickfilters-placeholder-description',
                        'rcfilters-savedqueries-defaultlabel',
                        'rcfilters-savedqueries-rename',
                        'rcfilters-savedqueries-setdefault',
index 66ceb64..fb0b93b 100644 (file)
@@ -1,5 +1,5 @@
 .mw-rcfilters-ui-savedLinksListItemWidget {
-       padding: 0.5em;
+       padding: 0.2em 0.7em;
 
        &:hover {
                // Mimicking optionWidget styles
                vertical-align: middle;
        }
 
-       &:not( .oo-ui-iconElement ) .oo-ui-iconElement-icon {
-               // The iconElement-icon class still appears when we
-               // have an empty icon, and we need it to pretend to
-               // be there so the text has the same alignment as
-               // text next to a visible icon. #ThanksOOUI
-               width: 1.875em;
-               height: 1.875em;
+       .oo-ui-iconElement-icon {
+               // Since we made the rows narrower (height smaller than usual)
+               // then the icon needs to be slightly smaller as well, so that
+               // when we toggle 'default' the icon doesn't bounce the option
+               // height up a little
+               width: 1.7em;
+               height: 1.7em;
        }
 
        &-icon span {
@@ -38,6 +38,7 @@
                overflow: hidden;
                cursor: pointer;
                margin-left: 0.5px;
+               color: #36c; // Accent50;
        }
 
        &-icon,
index 5bda034..716ed03 100644 (file)
@@ -6,6 +6,11 @@
        }
 
        &-placeholder {
+               &-title {
+                       font-weight: bold;
+                       margin-bottom: 1em;
+               }
+
                // Extra specificity needed to override OOUI rule that sets white-space: nowrap;
                // on labels inside options
                &.oo-ui-optionWidget .oo-ui-labelElement-label {
 
                .oo-ui-iconElement-icon {
                        opacity: 0.5;
+                       // Override OOUI option widget rules for icons
+                       // we want the icon to appear at the top near the
+                       // title, not in the middle of the multiline option
+                       top: 0.7em !important; /* stylelint-disable-line declaration-no-important */
+                       height: inherit !important; /* stylelint-disable-line declaration-no-important */
                }
        }
 }
index 44b48b8..acda29e 100644 (file)
                                                $( '<div>' )
                                                        .addClass( 'mw-rcfilters-ui-row' )
                                                        .append(
-                                                               $( '<div>' )
-                                                                       .addClass( 'mw-rcfilters-ui-cell' )
-                                                                       .addClass( 'mw-rcfilters-ui-savedLinksListItemWidget-icon' )
-                                                                       .append( this.$icon ),
                                                                $( '<div>' )
                                                                        .addClass( 'mw-rcfilters-ui-cell' )
                                                                        .addClass( 'mw-rcfilters-ui-savedLinksListItemWidget-content' )
                                                                                this.editInput.$element,
                                                                                this.saveButton.$element
                                                                        ),
+                                                               $( '<div>' )
+                                                                       .addClass( 'mw-rcfilters-ui-cell' )
+                                                                       .addClass( 'mw-rcfilters-ui-savedLinksListItemWidget-icon' )
+                                                                       .append( this.$icon ),
                                                                this.popupButton.$element
                                                                        .addClass( 'mw-rcfilters-ui-cell' )
                                                        )
 
                        this.editInput.toggle( isEdit );
                        this.$label.toggleClass( 'oo-ui-element-hidden', isEdit );
+                       this.$icon.toggleClass( 'oo-ui-element-hidden', isEdit );
                        this.popupButton.toggle( !isEdit );
                        this.saveButton.toggle( isEdit );
 
index 91c05b2..8c021d0 100644 (file)
         * @cfg {jQuery} [$overlay] A jQuery object serving as overlay for popups
         */
        mw.rcfilters.ui.SavedLinksListWidget = function MwRcfiltersUiSavedLinksListWidget( controller, model, config ) {
+               var $labelNoEntries = $( '<div>' )
+                       .append(
+                               $( '<div>' )
+                                       .addClass( 'mw-rcfilters-ui-savedLinksListWidget-placeholder-title' )
+                                       .text( mw.msg( 'rcfilters-quickfilters-placeholder-title' ) ),
+                               $( '<div>' )
+                                       .addClass( 'mw-rcfilters-ui-savedLinksListWidget-placeholder-description' )
+                                       .text( mw.msg( 'rcfilters-quickfilters-placeholder-description' ) )
+                       );
+
                config = config || {};
 
                // Parent
@@ -22,7 +32,7 @@
 
                this.placeholderItem = new OO.ui.DecoratedOptionWidget( {
                        classes: [ 'mw-rcfilters-ui-savedLinksListWidget-placeholder' ],
-                       label: mw.msg( 'rcfilters-quickfilters-placeholder' ),
+                       label: $labelNoEntries,
                        icon: 'unClip'
                } );
                // The only reason we're using "ButtonGroupWidget" here is that
index cedb623..32fa468 100644 (file)
@@ -372,8 +372,10 @@ class OutputPageTest extends MediaWikiTestCase {
                                        'user' => [ 'user.styles', 'example.user' ],
                                ],
                                '<meta name="ResourceLoaderDynamicStyles" content=""/>' . "\n" .
-                               '<link rel="stylesheet" href="/w/load.php?debug=false&amp;lang=en&amp;modules=example.site.a%2Cb%7Csite.styles&amp;only=styles&amp;skin=fallback"/>' . "\n" .
-                               '<link rel="stylesheet" href="/w/load.php?debug=false&amp;lang=en&amp;modules=example.user%7Cuser.styles&amp;only=styles&amp;skin=fallback&amp;version=17f1vjw"/>',
+                               '<link rel="stylesheet" href="/w/load.php?debug=false&amp;lang=en&amp;modules=example.site.a%2Cb&amp;only=styles&amp;skin=fallback"/>' . "\n" .
+                               '<link rel="stylesheet" href="/w/load.php?debug=false&amp;lang=en&amp;modules=site.styles&amp;only=styles&amp;skin=fallback"/>' . "\n" .
+                               '<link rel="stylesheet" href="/w/load.php?debug=false&amp;lang=en&amp;modules=example.user&amp;only=styles&amp;skin=fallback&amp;version=0a56zyi"/>' . "\n" .
+                               '<link rel="stylesheet" href="/w/load.php?debug=false&amp;lang=en&amp;modules=user.styles&amp;only=styles&amp;skin=fallback&amp;version=1e9z0ox"/>',
                        ],
                        // @codingStandardsIgnoreEnd Generic.Files.LineLength
                ];
index d460401..ea5ca8d 100644 (file)
@@ -103,7 +103,7 @@ class TextPassDumperDatabaseTest extends DumpTestCase {
                // increasing
                $this->assertEquals(
                        [ $this->pageId2, $this->pageId3, $this->pageId4 ],
-                       [ $this->pageId1 + 1, $this->pageId2 + 1, $this->pageId3 + 1 ],
+                       [ $this->pageId1 + 1, $this->pageId1 + 2, $this->pageId1 + 3 ],
                        "Page ids increasing without holes" );
        }