Krinkle has uploaded a new change for review. https://gerrit.wikimedia.org/r/314174
Change subject: page: Remove unused WikiPage::doQuickEditContent() ...................................................................... page: Remove unused WikiPage::doQuickEditContent() This is a rather hakcy method that bypasses various cache invalidation updates. This method shouldn't (and, fortunately, isn't) called anywhere in Wikimedia Git. Change-Id: I03ede077294344c420827e4a6527d4c5fc3509b0 --- M includes/page/Article.php M includes/page/WikiPage.php M tests/phpunit/includes/page/WikiPageTest.php 3 files changed, 3 insertions(+), 71 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/74/314174/1 diff --git a/includes/page/Article.php b/includes/page/Article.php index f57df9b..338b1ae 100644 --- a/includes/page/Article.php +++ b/includes/page/Article.php @@ -2156,18 +2156,6 @@ /** * Call to WikiPage function for backwards compatibility. - * @see WikiPage::doQuickEditContent - */ - public function doQuickEditContent( - Content $content, User $user, $comment = '', $minor = false, $serialFormat = null - ) { - return $this->mPage->doQuickEditContent( - $content, $user, $comment, $minor, $serialFormat - ); - } - - /** - * Call to WikiPage function for backwards compatibility. * @see WikiPage::doViewUpdates */ public function doViewUpdates( User $user, $oldid = 0 ) { diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index 4fa042e..98428dd 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -2397,41 +2397,6 @@ } /** - * Edit an article without doing all that other stuff - * The article must already exist; link tables etc - * are not updated, caches are not flushed. - * - * @param Content $content Content submitted - * @param User $user The relevant user - * @param string $comment Comment submitted - * @param bool $minor Whereas it's a minor modification - * @param string $serialFormat Format for storing the content in the database - */ - public function doQuickEditContent( - Content $content, User $user, $comment = '', $minor = false, $serialFormat = null - ) { - - $serialized = $content->serialize( $serialFormat ); - - $dbw = wfGetDB( DB_MASTER ); - $revision = new Revision( [ - 'title' => $this->getTitle(), // for determining the default content model - 'page' => $this->getId(), - 'user_text' => $user->getName(), - 'user' => $user->getId(), - 'text' => $serialized, - 'length' => $content->getSize(), - 'comment' => $comment, - 'minor_edit' => $minor ? 1 : 0, - ] ); // XXX: set the content object? - $revision->insertOn( $dbw ); - $this->updateRevisionOn( $dbw, $revision ); - - Hooks::run( 'NewRevisionFromEditComplete', [ $this, $revision, false, $user ] ); - - } - - /** * Update the article's restriction field, and leave a log entry. * This works for protection both existing and non-existing pages. * diff --git a/tests/phpunit/includes/page/WikiPageTest.php b/tests/phpunit/includes/page/WikiPageTest.php index e55efee..4b7ebd3 100644 --- a/tests/phpunit/includes/page/WikiPageTest.php +++ b/tests/phpunit/includes/page/WikiPageTest.php @@ -92,6 +92,9 @@ /** * @covers WikiPage::doEditContent + * @covers WikiPage::doModify + * @covers WikiPage::doCreate + * @covers WikiPage::doEditUpdates */ public function testDoEditContent() { $page = $this->newPage( "WikiPageTest_testDoEditContent" ); @@ -211,30 +214,6 @@ $res->free(); $this->assertEquals( 2, $n, 'pagelinks should contain two links from the page' ); - } - - /** - * @covers WikiPage::doQuickEditContent - */ - public function testDoQuickEditContent() { - global $wgUser; - - $page = $this->createPage( - "WikiPageTest_testDoQuickEditContent", - "original text", - CONTENT_MODEL_WIKITEXT - ); - - $content = ContentHandler::makeContent( - "quick text", - $page->getTitle(), - CONTENT_MODEL_WIKITEXT - ); - $page->doQuickEditContent( $content, $wgUser, "testing q" ); - - # --------------------- - $page = new WikiPage( $page->getTitle() ); - $this->assertTrue( $content->equals( $page->getContent() ) ); } /** -- To view, visit https://gerrit.wikimedia.org/r/314174 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I03ede077294344c420827e4a6527d4c5fc3509b0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Krinkle <krinklem...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits