jenkins-bot has submitted this change and it was merged.
Change subject: Remove backwards compatibility code
......................................................................
Remove backwards compatibility code
Not useful anymore as this extension is already not working
with MW version < 1.25.
Change also some called method names to match the case of the core methods.
Change-Id: I2a5ce1cb63f4e9aa47e3595f24d9b9c8e42c10f3
---
M ApiQueryProofread.php
M ApiQueryProofreadInfo.php
M ProofreadPage.body.php
3 files changed, 11 insertions(+), 68 deletions(-)
Approvals:
Tpt: Looks good to me, approved
Dereckson: Looks good to me, but someone else must approve
jenkins-bot: Verified
diff --git a/ApiQueryProofread.php b/ApiQueryProofread.php
index 45ad0b2..81ba545 100644
--- a/ApiQueryProofread.php
+++ b/ApiQueryProofread.php
@@ -64,15 +64,10 @@
$api = new ApiMain( $params );
$api->execute();
- if ( defined( 'ApiResult::META_CONTENT' ) ) {
- $data = $api->getResult()->getResultData();
- $pages = ApiResult::stripMetadataNonRecursive(
- (array)$data['query']['pages']
- );
- } else {
- $data = $api->getResultData();
- $pages = $data['query']['pages'];
- }
+ $data = $api->getResult()->getResultData();
+ $pages = ApiResult::stripMetadataNonRecursive(
+ (array)$data['query']['pages']
+ );
unset( $api );
if ( array_key_exists( 'error', $data ) ) {
@@ -105,22 +100,6 @@
public function getAllowedParams() {
return [];
- }
-
- /**
- * @deprecated since MediaWiki core 1.25
- */
- public function getDescription() {
- return 'Returns information about the current proofread status
of the given pages.';
- }
-
- /**
- * @deprecated since MediaWiki core 1.25
- */
- public function getExamples() {
- return [
- 'api.php?action=query&generator=allpages&gapnamespace='
. ProofreadPage::getPageNamespaceId() . '&prop=proofread'
- ];
}
/**
diff --git a/ApiQueryProofreadInfo.php b/ApiQueryProofreadInfo.php
index 1184379..0d8d81e 100644
--- a/ApiQueryProofreadInfo.php
+++ b/ApiQueryProofreadInfo.php
@@ -87,37 +87,6 @@
}
/**
- * @deprecated since MediaWiki core 1.25
- */
- public function getParamDescription() {
- return [
- 'prop' => [
- 'Which proofread properties to get:',
- ' namespaces - Information about
Page and Index namespaces',
- ' qualitylevels - List of proofread
quality levels'
- ]
- ];
- }
-
- /**
- * @deprecated since MediaWiki core 1.25
- */
- public function getDescription() {
- return 'Return information about configuration of ProofreadPage
extension';
- }
-
- /**
- * @deprecated since MediaWiki core 1.25
- */
- public function getExamples() {
- return [
- 'api.php?action=query&meta=proofreadinfo',
-
'api.php?action=query&meta=proofreadinfo&piprop=namespaces|qualitylevels',
-
'api.php?action=query&meta=proofreadinfo&piprop=namespaces',
- ];
- }
-
- /**
* @see ApiBase::getExamplesMessages()
*/
protected function getExamplesMessages() {
diff --git a/ProofreadPage.body.php b/ProofreadPage.body.php
index fd71335..201cf92 100644
--- a/ProofreadPage.body.php
+++ b/ProofreadPage.body.php
@@ -448,7 +448,7 @@
*/
public static function updatePrIndex( $index, $deletedPage = null ) {
$indexTitle = $index->getTitle();
- $indexId = $index->getID();
+ $indexId = $index->getId();
// read the list of pages
$pages = [];
@@ -457,7 +457,7 @@
);
foreach ( $pagination as $page ) {
if ( $deletedPage === null ||
!$page->getTitle()->equals( $deletedPage ) ) {
- array_push( $pages,
$page->getTitle()->getDBKey() );
+ array_push( $pages,
$page->getTitle()->getDBkey() );
}
}
@@ -694,7 +694,7 @@
$dir = __DIR__ . '/sql/';
- $updater->addExtensionTable( 'pr_index', $dir .
'ProofreadIndex.sql', true );
+ $updater->addExtensionTable( 'pr_index', $dir .
'ProofreadIndex.sql' );
// fix issue with content type hardcoded in database
if ( isset( $wgContentHandlerUseDB ) && $wgContentHandlerUseDB
) {
@@ -795,7 +795,7 @@
$links['namespaces']['proofreadPageIndexLink'] = [
'class' => ( $skin->skinname === 'vector' ) ?
'icon' : '',
- 'href' => $indexPage->getTitle()->getLinkUrl(),
+ 'href' => $indexPage->getTitle()->getLinkURL(),
'text' => wfMessage( 'proofreadpage_index'
)->plain()
];
}
@@ -827,12 +827,7 @@
$api = new ApiMain( $params );
$api->execute();
- if ( defined( 'ApiResult::META_CONTENT' ) ) {
- $data = $api->getResult()->getResultData();
- } else {
- $data = $api->getResultData();
- }
- unset( $api );
+ $data = $api->getResult()->getResultData();
if ( array_key_exists( 'error', $data ) ) {
return true;
@@ -851,9 +846,9 @@
protected static function getLinkUrlForTitle( Title $title ) {
if ( $title->exists() ) {
- return $title->getLinkUrl();
+ return $title->getLinkURL();
} else {
- return $title->getLinkUrl( 'action=edit&redlink=1' );
+ return $title->getLinkURL( 'action=edit&redlink=1' );
}
}
--
To view, visit https://gerrit.wikimedia.org/r/302299
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I2a5ce1cb63f4e9aa47e3595f24d9b9c8e42c10f3
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/ProofreadPage
Gerrit-Branch: master
Gerrit-Owner: Tpt <[email protected]>
Gerrit-Reviewer: Dereckson <[email protected]>
Gerrit-Reviewer: Tpt <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits