Merge "Added Id to the input box"
[lhc/web/wiklou.git] / includes / specials / SpecialContributions.php
index f4d575a..81e2f9e 100644 (file)
@@ -21,7 +21,6 @@
  * @ingroup SpecialPage
  */
 
-use MediaWiki\MediaWikiServices;
 use MediaWiki\Widget\DateInputWidget;
 
 /**
@@ -42,6 +41,7 @@ class SpecialContributions extends IncludableSpecialPage {
                $out = $this->getOutput();
                // Modules required for viewing the list of contributions (also when included on other pages)
                $out->addModuleStyles( [
+                       'mediawiki.interface.helpers.styles',
                        'mediawiki.special',
                        'mediawiki.special.changeslist',
                ] );
@@ -152,6 +152,15 @@ class SpecialContributions extends IncludableSpecialPage {
                }
                $this->opts = ContribsPager::processDateFilter( $this->opts );
 
+               if ( $this->opts['namespace'] < NS_MAIN ) {
+                       $this->getOutput()->wrapWikiMsg(
+                               "<div class=\"mw-negative-namespace-not-supported error\">\n\$1\n</div>",
+                               [ 'negative-namespace-not-supported' ]
+                       );
+                       $out->addHTML( $this->getForm() );
+                       return;
+               }
+
                $feedType = $request->getVal( 'feed' );
 
                $feedParams = [
@@ -227,8 +236,7 @@ class SpecialContributions extends IncludableSpecialPage {
                                $out->addWikiMsg( 'nocontribs', $target );
                        } else {
                                # Show a message about replica DB lag, if applicable
-                               $lb = MediaWikiServices::getInstance()->getDBLoadBalancer();
-                               $lag = $lb->safeGetLag( $pager->getDatabase() );
+                               $lag = $pager->getDatabase()->getSessionLagStatus()['lag'];
                                if ( $lag > 0 ) {
                                        $out->showLagWarning( $lag );
                                }