Addshore has submitted this change and it was merged. Change subject: Ensure mPreparedEdit in WikiPage gets cleared if set. ......................................................................
Ensure mPreparedEdit in WikiPage gets cleared if set. Depends on I770bf2d in core and fixes breakage in Wikibase due to I2c34baa Change-Id: I4f7ea1d9a162ed99870144023ceb8cde2affae22 --- M repo/includes/content/EntityContent.php 1 file changed, 6 insertions(+), 6 deletions(-) Approvals: Addshore: Looks good to me, approved jenkins-bot: Verified diff --git a/repo/includes/content/EntityContent.php b/repo/includes/content/EntityContent.php index e6b97a6..b8eb33f 100644 --- a/repo/includes/content/EntityContent.php +++ b/repo/includes/content/EntityContent.php @@ -508,17 +508,17 @@ // database transactions, we could simply check here. $this->editEntity = $editEntity; - // NOTE: make sure we start saving from a clean slate. Calling WikiPage::clear may cause the old content - // to be loaded from the database again. This may be necessary, because EntityContent is mutable, - // so the cached object might have changed. + // NOTE: make sure we start saving from a clean slate. Calling WikiPage::clearPreparedEdit + // may cause the old content to be loaded from the database again. This may be + // necessary, because EntityContent is mutable, so the cached object might have changed. // - // The relevant test case is ItemContentTest::restRepeatedSave + // The relevant test case is ItemContentTest::testRepeatedSave // - // We may be able to optimize this by only calling WikiPage::clear if - // $this->getWikiPage()->getContent() == $this, but that needs further investigation. + // TODO: might be able to further optimize handling of prepared edit in WikiPage. $page = $this->getWikiPage(); $page->clear(); + $page->clearPreparedEdit(); $status = $page->doEditContent( $this, -- To view, visit https://gerrit.wikimedia.org/r/95855 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4f7ea1d9a162ed99870144023ceb8cde2affae22 Gerrit-PatchSet: 6 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Aude <aude.w...@gmail.com> Gerrit-Reviewer: Addshore <addshorew...@gmail.com> Gerrit-Reviewer: Aude <aude.w...@gmail.com> Gerrit-Reviewer: Daniel Kinzler <daniel.kinz...@wikimedia.de> Gerrit-Reviewer: Hoo man <h...@online.de> Gerrit-Reviewer: Jeroen De Dauw <jeroended...@gmail.com> Gerrit-Reviewer: Tobias Gritschacher <tobias.gritschac...@wikimedia.de> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits