Add function to clear mPreparedEdit, to use in cases of mutable content
authoraude <aude.wiki@gmail.com>
Sun, 17 Nov 2013 09:32:15 +0000 (10:32 +0100)
committerAaron Schulz <aschulz@wikimedia.org>
Sun, 17 Nov 2013 19:30:28 +0000 (11:30 -0800)
In Wikibase, EntityContent is mutable and needs to clear
prepared edit before performing a save.

Follow-up to I2c34baa

Change-Id: I770bf2dc960c0a67a9b8315b7cdf24f3b89b6480

includes/WikiPage.php

index 5fc01cc..d3743b5 100644 (file)
@@ -249,6 +249,15 @@ class WikiPage implements Page, IDBAccessObject {
                // Clearing it can cause extra parses on edit for no reason.
        }
 
+       /**
+        * Clear the mPreparedEdit cache field, as may be needed by mutable content types
+        * @return void
+        * @since 1.23
+        */
+       public function clearPreparedEdit() {
+               $this->mPreparedEdit = false;
+       }
+
        /**
         * Return the list of revision fields that should be selected to create
         * a new page.