jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/329336 )

Change subject: Remove deprecated function Article::doEdit() and 
WikiPage::doEdit()
......................................................................


Remove deprecated function Article::doEdit() and WikiPage::doEdit()

Bug: T61113
Bug: T154498
Change-Id: Ie6c1bb4ee5ee45ac2db432877a7038659231c091
---
M RELEASE-NOTES-1.29
M includes/page/Article.php
M includes/page/WikiPage.php
M tests/phpunit/includes/page/WikiPageTest.php
4 files changed, 1 insertion(+), 127 deletions(-)

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



diff --git a/RELEASE-NOTES-1.29 b/RELEASE-NOTES-1.29
index bc5af86..25cb94a 100644
--- a/RELEASE-NOTES-1.29
+++ b/RELEASE-NOTES-1.29
@@ -203,6 +203,7 @@
   Use ContentHandlerDefaultModelFor instead.
 * Article::getContent() (deprecated in 1.21) was removed.
 * Revision::getText() (deprecated in 1.21) was removed.
+* Article::doEdit() and WikiPage::doEdit() (deprecated in 1.21) were removed.
 
 == Compatibility ==
 
diff --git a/includes/page/Article.php b/includes/page/Article.php
index b8be294..2052ed3 100644
--- a/includes/page/Article.php
+++ b/includes/page/Article.php
@@ -2025,17 +2025,6 @@
 
        /**
         * Call to WikiPage function for backwards compatibility.
-        * @see WikiPage::doEdit
-        *
-        * @deprecated since 1.21: use doEditContent() instead.
-        */
-       public function doEdit( $text, $summary, $flags = 0, $baseRevId = 
false, $user = null ) {
-               wfDeprecated( __METHOD__, '1.21' );
-               return $this->mPage->doEdit( $text, $summary, $flags, 
$baseRevId, $user );
-       }
-
-       /**
-        * Call to WikiPage function for backwards compatibility.
         * @see WikiPage::doEditContent
         */
        public function doEditContent( Content $content, $summary, $flags = 0, 
$baseRevId = false,
diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php
index 920ba87..f760cd1 100644
--- a/includes/page/WikiPage.php
+++ b/includes/page/WikiPage.php
@@ -1508,68 +1508,6 @@
         * Change an existing article or create a new article. Updates RC and 
all necessary caches,
         * optionally via the deferred update array.
         *
-        * @param string $text New text
-        * @param string $summary Edit summary
-        * @param int $flags Bitfield:
-        *      EDIT_NEW
-        *          Article is known or assumed to be non-existent, create a 
new one
-        *      EDIT_UPDATE
-        *          Article is known or assumed to be pre-existing, update it
-        *      EDIT_MINOR
-        *          Mark this edit minor, if the user is allowed to do so
-        *      EDIT_SUPPRESS_RC
-        *          Do not log the change in recentchanges
-        *      EDIT_FORCE_BOT
-        *          Mark the edit a "bot" edit regardless of user rights
-        *      EDIT_AUTOSUMMARY
-        *          Fill in blank summaries with generated text where possible
-        *      EDIT_INTERNAL
-        *          Signal that the page retrieve/save cycle happened entirely 
in this request.
-        *
-        * If neither EDIT_NEW nor EDIT_UPDATE is specified, the status of the
-        * article will be detected. If EDIT_UPDATE is specified and the article
-        * doesn't exist, the function will return an edit-gone-missing error. 
If
-        * EDIT_NEW is specified and the article does exist, an 
edit-already-exists
-        * error will be returned. These two conditions are also possible with
-        * auto-detection due to MediaWiki's performance-optimised locking 
strategy.
-        *
-        * @param bool|int $baseRevId The revision ID this edit was based off, 
if any.
-        *   This is not the parent revision ID, rather the revision ID for 
older
-        *   content used as the source for a rollback, for example.
-        * @param User $user The user doing the edit
-        *
-        * @throws MWException
-        * @return Status Possible errors:
-        *   edit-hook-aborted: The ArticleSave hook aborted the edit but didn't
-        *     set the fatal flag of $status
-        *   edit-gone-missing: In update mode, but the article didn't exist.
-        *   edit-conflict: In update mode, the article changed unexpectedly.
-        *   edit-no-change: Warning that the text was the same as before.
-        *   edit-already-exists: In creation mode, but the article already 
exists.
-        *
-        * Extensions may define additional errors.
-        *
-        * $return->value will contain an associative array with members as 
follows:
-        *     new: Boolean indicating if the function attempted to create a 
new article.
-        *     revision: The revision object for the inserted revision, or null.
-        *
-        * Compatibility note: this function previously returned a boolean value
-        * indicating success/failure
-        *
-        * @deprecated since 1.21: use doEditContent() instead.
-        */
-       public function doEdit( $text, $summary, $flags = 0, $baseRevId = 
false, $user = null ) {
-               wfDeprecated( __METHOD__, '1.21' );
-
-               $content = ContentHandler::makeContent( $text, 
$this->getTitle() );
-
-               return $this->doEditContent( $content, $summary, $flags, 
$baseRevId, $user );
-       }
-
-       /**
-        * Change an existing article or create a new article. Updates RC and 
all necessary caches,
-        * optionally via the deferred update array.
-        *
         * @param Content $content New content
         * @param string $summary Edit summary
         * @param int $flags Bitfield:
diff --git a/tests/phpunit/includes/page/WikiPageTest.php 
b/tests/phpunit/includes/page/WikiPageTest.php
index 6885ca3..e778270 100644
--- a/tests/phpunit/includes/page/WikiPageTest.php
+++ b/tests/phpunit/includes/page/WikiPageTest.php
@@ -156,60 +156,6 @@
        }
 
        /**
-        * @covers WikiPage::doEdit
-        * @deprecated since 1.21. Should be removed when WikiPage::doEdit() 
gets removed
-        */
-       public function testDoEdit() {
-               $this->hideDeprecated( "WikiPage::doEdit" );
-               $this->hideDeprecated( "Revision::getText" );
-
-               // NOTE: assume help namespace will default to wikitext
-               $title = Title::newFromText( "Help:WikiPageTest_testDoEdit" );
-
-               $page = $this->newPage( $title );
-
-               $text = "[[Lorem ipsum]] dolor sit amet, consetetur sadipscing 
elitr, sed diam "
-                       . " nonumy eirmod tempor invidunt ut labore et dolore 
magna aliquyam erat.";
-
-               $page->doEdit( $text, "[[testing]] 1" );
-
-               $this->assertTrue( $title->getArticleID() > 0, "Title object 
should have new page id" );
-               $this->assertTrue( $page->getId() > 0, "WikiPage should have 
new page id" );
-               $this->assertTrue( $title->exists(), "Title object should 
indicate that the page now exists" );
-               $this->assertTrue( $page->exists(), "WikiPage object should 
indicate that the page now exists" );
-
-               $id = $page->getId();
-
-               # ------------------------
-               $dbr = wfGetDB( DB_SLAVE );
-               $res = $dbr->select( 'pagelinks', '*', [ 'pl_from' => $id ] );
-               $n = $res->numRows();
-               $res->free();
-
-               $this->assertEquals( 1, $n, 'pagelinks should contain one link 
from the page' );
-
-               # ------------------------
-               $text = "At vero eos et accusam et justo duo [[dolores]] et ea 
rebum. "
-                       . "Stet clita kasd [[gubergren]], no sea takimata 
sanctus est.";
-
-               $page->doEdit( $text, "testing 2" );
-
-               # ------------------------
-               $page = new WikiPage( $title );
-
-               $retrieved = $page->getContent()->getNativeData();
-               $this->assertEquals( $text, $retrieved, 'retrieved text 
doesn\'t equal original' );
-
-               # ------------------------
-               $dbr = wfGetDB( DB_SLAVE );
-               $res = $dbr->select( 'pagelinks', '*', [ 'pl_from' => $id ] );
-               $n = $res->numRows();
-               $res->free();
-
-               $this->assertEquals( 2, $n, 'pagelinks should contain two links 
from the page' );
-       }
-
-       /**
         * @covers WikiPage::doDeleteArticle
         */
        public function testDoDeleteArticle() {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie6c1bb4ee5ee45ac2db432877a7038659231c091
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Subins2000 <subins2...@gmail.com>
Gerrit-Reviewer: Aklapper <aklap...@wikimedia.org>
Gerrit-Reviewer: D3r1ck <alangider...@gmail.com>
Gerrit-Reviewer: Daniel Kinzler <daniel.kinz...@wikimedia.de>
Gerrit-Reviewer: Jack Phoenix <j...@countervandalism.net>
Gerrit-Reviewer: Jforrester <jforres...@wikimedia.org>
Gerrit-Reviewer: McIntireEvan <mcintire.e...@gmail.com>
Gerrit-Reviewer: Reedy <re...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to