Merge "Remove parameter 'options' from hook 'SkinEditSectionLinks'"
[lhc/web/wiklou.git] / includes / specialpage / ChangesListSpecialPage.php
index 1b43a42..f4b574b 100644 (file)
  * @file
  * @ingroup SpecialPage
  */
+
 use MediaWiki\Logger\LoggerFactory;
+use MediaWiki\MediaWikiServices;
 use Wikimedia\Rdbms\DBQueryTimeoutError;
 use Wikimedia\Rdbms\IResultWrapper;
 use Wikimedia\Rdbms\FakeResultWrapper;
 use Wikimedia\Rdbms\IDatabase;
-use MediaWiki\MediaWikiServices;
 
 /**
  * Special page which uses a ChangesList to show query results.
@@ -1451,7 +1452,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                        if ( $opts[ 'associated' ] ) {
                                $associatedNamespaces = array_map(
                                        function ( $ns ) {
-                                               return MWNamespace::getAssociated( $ns );
+                                               return MediaWikiServices::getInstance()->getNamespaceInfo()->
+                                                       getAssociated( $ns );
                                        },
                                        $namespaces
                                );
@@ -1847,21 +1849,21 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                        return true;
                }
 
-               return static::checkStructuredFilterUiEnabled(
-                       $this->getConfig(),
-                       $this->getUser()
-               );
+               return static::checkStructuredFilterUiEnabled( $this->getUser() );
        }
 
        /**
         * Static method to check whether StructuredFilter UI is enabled for the given user
         *
         * @since 1.31
-        * @param Config $config
         * @param User $user
         * @return bool
         */
-       public static function checkStructuredFilterUiEnabled( Config $config, User $user ) {
+       public static function checkStructuredFilterUiEnabled( $user ) {
+               if ( $user instanceof Config ) {
+                       wfDeprecated( __METHOD__ . ' with Config argument', '1.34' );
+                       $user = func_get_arg( 1 );
+               }
                return !$user->getOption( 'rcenhancedfilters-disable' );
        }