Save pages content in the default format of their content type
authorTpt <thomaspt@hotmail.fr>
Tue, 26 Aug 2014 07:22:26 +0000 (09:22 +0200)
committerTpt <thomaspt@hotmail.fr>
Mon, 15 Sep 2014 16:58:19 +0000 (18:58 +0200)
Useful in order to be sure that only the default format is saved in the database (allow to implement optional formats useful for APIs but not used in the storage)

Change-Id: Ia703319aefc8d56c377cd7766dc5985c5c3c27c1

includes/EditPage.php

index 87bdf91..f6342c5 100644 (file)
@@ -1892,8 +1892,14 @@ class EditPage {
                        ( ( $this->minoredit && !$this->isNew ) ? EDIT_MINOR : 0 ) |
                        ( $bot ? EDIT_FORCE_BOT : 0 );
 
-               $doEditStatus = $this->mArticle->doEditContent( $content, $this->summary, $flags,
-                                                                                                               false, null, $this->contentFormat );
+               $doEditStatus = $this->mArticle->doEditContent(
+                       $content,
+                       $this->summary,
+                       $flags,
+                       false,
+                       null,
+                       $content->getDefaultFormat()
+               );
 
                if ( !$doEditStatus->isOK() ) {
                        // Failure from doEdit()