Merge "Hard deprecate wfInitShellLocale()"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 4 Oct 2017 22:37:01 +0000 (22:37 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 4 Oct 2017 22:37:02 +0000 (22:37 +0000)
includes/libs/rdbms/database/Database.php
includes/libs/rdbms/database/IDatabase.php
resources/src/mediawiki.widgets/mw.widgets.TitleOptionWidget.js
resources/src/mediawiki.widgets/mw.widgets.TitleWidget.js

index 3c0a2ad..bc1454b 100644 (file)
@@ -3078,8 +3078,16 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
 
                $this->mTrxIdleCallbacks = []; // clear
                $this->mTrxPreCommitCallbacks = []; // clear
-               $this->runOnTransactionIdleCallbacks( self::TRIGGER_ROLLBACK );
-               $this->runTransactionListenerCallbacks( self::TRIGGER_ROLLBACK );
+               try {
+                       $this->runOnTransactionIdleCallbacks( self::TRIGGER_ROLLBACK );
+               } catch ( Exception $e ) {
+                       // already logged; finish and let LoadBalancer move on during mass-rollback
+               }
+               try {
+                       $this->runTransactionListenerCallbacks( self::TRIGGER_ROLLBACK );
+               } catch ( Exception $e ) {
+                       // already logged; let LoadBalancer move on during mass-rollback
+               }
        }
 
        /**
index 5d0e03f..67e8e85 100644 (file)
@@ -1594,6 +1594,8 @@ interface IDatabase {
         * throwing an Exception is preferrable, using a pre-installed error handler to trigger
         * rollback (in any case, failure to issue COMMIT will cause rollback server-side).
         *
+        * Query, connection, and onTransaction* callback errors will be suppressed and logged.
+        *
         * @param string $fname Calling function name
         * @param string $flush Flush flag, set to a situationally valid IDatabase::FLUSHING_*
         *   constant to disable warnings about calling rollback when no transaction is in
index 638f461..7d49a09 100644 (file)
@@ -23,6 +23,7 @@
         * @cfg {boolean} [redirect] Page is a redirect
         * @cfg {boolean} [disambiguation] Page is a disambiguation page
         * @cfg {string} [query] Matching query string to highlight
+        * @cfg {string} [compare] String comparison function for query highlighting
         */
        mw.widgets.TitleOptionWidget = function MwWidgetsTitleOptionWidget( config ) {
                var icon;
@@ -69,7 +70,7 @@
 
                // Highlight matching parts of link suggestion
                if ( config.query ) {
-                       this.setHighlightedQuery( config.data, config.query );
+                       this.setHighlightedQuery( config.data, config.query, config.compare );
                }
                this.$label.attr( 'title', config.data );
 
index 5fe094f..db56bd3 100644 (file)
                this.validateTitle = config.validateTitle !== undefined ? config.validateTitle : true;
                this.cache = config.cache;
                this.api = config.api || new mw.Api();
+               // Supports: IE10, FF28, Chrome23
+               this.compare = window.Intl && Intl.Collator ?
+                       new Intl.Collator( mw.config.get( 'wgContentLanguage' ), { sensitivity: 'base' } ).compare :
+                       null;
 
                // Initialization
                this.$element.addClass( 'mw-widget-titleWidget' );
                        missing: data.missing,
                        redirect: data.redirect,
                        disambiguation: data.disambiguation,
-                       query: this.getQueryValue()
+                       query: this.getQueryValue(),
+                       compare: this.compare
                };
        };