[MediaWiki-commits] [Gerrit] mediawiki...FanBoxes[master]: Replace deprecated Article::doEdit()

2016-12-31 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/329788 )

Change subject: Replace deprecated Article::doEdit()
..


Replace deprecated Article::doEdit()

Article::doEdit() has been deprecated since MW 1.21. This patch replaces the 
"Article" class with "WikiPage" and "doEdit" with "doEditContent".

Bug: T151973
Change-Id: Iba294e14ba00c836fe5451654a7a3e15028a6c8e
---
M FanBoxClass.php
1 file changed, 15 insertions(+), 10 deletions(-)

Approvals:
  Reedy: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/FanBoxClass.php b/FanBoxClass.php
index c03c898..bfb4f02 100644
--- a/FanBoxClass.php
+++ b/FanBoxClass.php
@@ -88,11 +88,7 @@
trim( $category ) . "]]\n";
}
}
-   $article = new Article( $this->title );
-
-   $article_content = $this->buildWikiText() . "\n\n" .
-   $this->getBaseCategories() . "\n" . $categories_wiki .
-   "\n__NOEDITSECTION__";
+   $page = WikiPage::factory( $this->title );
 
if ( $descTitle->exists() ) {
# Invalidate the cache for the description page
@@ -100,7 +96,13 @@
$descTitle->purgeSquid();
} else {
// New fantag; create the description page.
-   $article->doEdit( $this->buildWikiText() . "\n\n" . 
$article_content, $desc );
+   $pageContent = ContentHandler::makeContent(
+   $this->buildWikiText() . "\n\n" .
+   $this->getBaseCategories() . "\n" . 
$categories_wiki .
+   "\n__NOEDITSECTION__",
+   $page->getTitle()
+   );
+   $page->doEditContent( $pageContent, $desc );
}
 
# Test to see if the row exists using INSERT IGNORE
@@ -215,13 +217,16 @@
':' . trim( $category ) . "]]\n";
}
}
-   $article = new Article( $this->title );
+   $page = WikiPage::factory( $this->title );
 
-   $article_content = $this->buildWikiText() . "\n" .
+   $pageContent = ContentHandler::makeContent(
+   $this->buildWikiText() . "\n" .
$this->getBaseCategories() . "\n" . $categories_wiki .
-   "\n__NOEDITSECTION__";
+   "\n__NOEDITSECTION__",
+   $page->getTitle()
+   );
 
-   $article->doEdit( $article_content, wfMessage( 
'fanbox-summary-update' )->inContentLanguage()->parse() );
+   $page->doEditContent( $pageContent, wfMessage( 
'fanbox-summary-update' )->inContentLanguage()->parse() );
}
 
/**

-- 
To view, visit https://gerrit.wikimedia.org/r/329788
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iba294e14ba00c836fe5451654a7a3e15028a6c8e
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/FanBoxes
Gerrit-Branch: master
Gerrit-Owner: MtDu 
Gerrit-Reviewer: Filip 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...FanBoxes[master]: Replace deprecated Article::doEdit()

2016-12-31 Thread MtDu (Code Review)
MtDu has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329788 )

Change subject: Replace deprecated Article::doEdit()
..

Replace deprecated Article::doEdit()

Article::doEdit() has been deprecated since MW 1.21. This patch replaces the 
"Article" class with "WikiPage" and "doEdit" with "doEditContent".

Bug: T151973
Change-Id: Iba294e14ba00c836fe5451654a7a3e15028a6c8e
---
M FanBoxClass.php
1 file changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/FanBoxes 
refs/changes/88/329788/1

diff --git a/FanBoxClass.php b/FanBoxClass.php
index c03c898..215ffe5 100644
--- a/FanBoxClass.php
+++ b/FanBoxClass.php
@@ -88,9 +88,9 @@
trim( $category ) . "]]\n";
}
}
-   $article = new Article( $this->title );
+   $page = WikiPage::factory( $this->title );
 
-   $article_content = $this->buildWikiText() . "\n\n" .
+   $pageContent = $this->buildWikiText() . "\n\n" .
$this->getBaseCategories() . "\n" . $categories_wiki .
"\n__NOEDITSECTION__";
 
@@ -100,7 +100,7 @@
$descTitle->purgeSquid();
} else {
// New fantag; create the description page.
-   $article->doEdit( $this->buildWikiText() . "\n\n" . 
$article_content, $desc );
+   $page->doEditContent( $this->buildWikiText() . "\n\n" . 
$pageContent, $desc );
}
 
# Test to see if the row exists using INSERT IGNORE
@@ -215,13 +215,13 @@
':' . trim( $category ) . "]]\n";
}
}
-   $article = new Article( $this->title );
+   $page = WikiPage::factory( $this->title );
 
-   $article_content = $this->buildWikiText() . "\n" .
+   $pageContent = $this->buildWikiText() . "\n" .
$this->getBaseCategories() . "\n" . $categories_wiki .
"\n__NOEDITSECTION__";
 
-   $article->doEdit( $article_content, wfMessage( 
'fanbox-summary-update' )->inContentLanguage()->parse() );
+   $page->doEditContent( $pageContent, wfMessage( 
'fanbox-summary-update' )->inContentLanguage()->parse() );
}
 
/**

-- 
To view, visit https://gerrit.wikimedia.org/r/329788
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iba294e14ba00c836fe5451654a7a3e15028a6c8e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/FanBoxes
Gerrit-Branch: master
Gerrit-Owner: MtDu 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits