From: umherirrender Date: Tue, 29 Sep 2015 18:00:33 +0000 (+0200) Subject: Remove $wgUseLinkNamespaceDBFields X-Git-Tag: 1.31.0-rc.0~9670^2 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=26bcbd06af3866314de4ecafb43b3321fca452c2;p=lhc%2Fweb%2Fwiklou.git Remove $wgUseLinkNamespaceDBFields Marked as may removed with 1.25, 1.27 should be okay than. Change-Id: I4ccd7dfe79fa555946cab64dd1eb179a3fc8291d --- diff --git a/RELEASE-NOTES-1.27 b/RELEASE-NOTES-1.27 index 71c3dcd4ea..bf50a4740a 100644 --- a/RELEASE-NOTES-1.27 +++ b/RELEASE-NOTES-1.27 @@ -9,6 +9,7 @@ MediaWiki 1.27 is an alpha-quality branch and is not recommended for use in production. === Configuration changes in 1.27 === +* Removed $wgUseLinkNamespaceDBFields === New features in 1.27 === diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 5fd85743ec..50b664a219 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -7667,14 +7667,6 @@ $wgHKDFAlgorithm = 'sha256'; */ $wgPageLanguageUseDB = false; -/** - * Enable use of the *_namespace fields of the pagelinks, redirect, and templatelinks tables. - * Set this only if the fields are fully populated. This may be removed in 1.25. - * @var bool - * @since 1.24 - */ -$wgUseLinkNamespaceDBFields = true; - /** * Global configuration variable for Virtual REST Services. * Parameters for different services are to be declared inside diff --git a/includes/specials/SpecialWhatlinkshere.php b/includes/specials/SpecialWhatlinkshere.php index 39980d298c..0e5ffce4ff 100644 --- a/includes/specials/SpecialWhatlinkshere.php +++ b/includes/specials/SpecialWhatlinkshere.php @@ -127,20 +127,13 @@ class SpecialWhatLinksHere extends IncludableSpecialPage { 'il_to' => $target->getDBkey(), ); - $useLinkNamespaceDBFields = $this->getConfig()->get( 'UseLinkNamespaceDBFields' ); $namespace = $this->opts->getValue( 'namespace' ); $invert = $this->opts->getValue( 'invert' ); $nsComparison = ( $invert ? '!= ' : '= ' ) . $dbr->addQuotes( $namespace ); if ( is_int( $namespace ) ) { - if ( $useLinkNamespaceDBFields ) { - $conds['pagelinks'][] = "pl_from_namespace $nsComparison"; - $conds['templatelinks'][] = "tl_from_namespace $nsComparison"; - $conds['imagelinks'][] = "il_from_namespace $nsComparison"; - } else { - $conds['pagelinks'][] = "page_namespace $nsComparison"; - $conds['templatelinks'][] = "page_namespace $nsComparison"; - $conds['imagelinks'][] = "page_namespace $nsComparison"; - } + $conds['pagelinks'][] = "pl_from_namespace $nsComparison"; + $conds['templatelinks'][] = "tl_from_namespace $nsComparison"; + $conds['imagelinks'][] = "il_from_namespace $nsComparison"; } if ( $from ) { @@ -156,7 +149,7 @@ class SpecialWhatLinksHere extends IncludableSpecialPage { } $queryFunc = function ( IDatabase $dbr, $table, $fromCol ) use ( - $conds, $target, $limit, $useLinkNamespaceDBFields + $conds, $target, $limit ) { // Read an extra row as an at-end check $queryLimit = $limit + 1; @@ -165,9 +158,7 @@ class SpecialWhatLinksHere extends IncludableSpecialPage { 'rd_title' => $target->getDBkey(), 'rd_interwiki = ' . $dbr->addQuotes( '' ) . ' OR rd_interwiki IS NULL' ); - if ( $useLinkNamespaceDBFields ) { // migration check - $on['rd_namespace'] = $target->getNamespace(); - } + $on['rd_namespace'] = $target->getNamespace(); // Inner LIMIT is 2X in case of stale backlinks with wrong namespaces $subQuery = $dbr->selectSqlText( array( $table, 'redirect', 'page' ),