r114155 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r114154‎ | r114155 | r114156 >
Date:17:10, 19 March 2012
Author:daniel
Status:deferred
Tags:
Comment:
messing with replaceSection()
Modified paths:
  • /branches/Wikidata/phase3/includes/Content.php (modified) (history)
  • /branches/Wikidata/phase3/includes/ContentHandler.php (modified) (history)
  • /branches/Wikidata/phase3/includes/EditPage.php (modified) (history)
  • /branches/Wikidata/phase3/includes/WikiPage.php (modified) (history)

Diff [purge]

Index: branches/Wikidata/phase3/includes/Content.php
@@ -2,47 +2,33 @@
33
44 /**
55 * A content object represents page content, e.g. the text to show on a page.
 6+ * Content objects have no knowledge about how they relate to Wiki pages.
 7+ * Content objects are imutable.
68 *
79 */
810 abstract class Content {
911
10 - public function __construct( Title $title = null, $revId = null, $modelName = null ) { #FIXME: really need revId? annoying! #FIXME: really $title? or just when parsing, every time?
 12+ public function __construct( $modelName = null ) { #FIXME: really need revId? annoying! #FIXME: really $title? or just when parsing, every time?
1113 $this->mModelName = $modelName;
12 - $this->mTitle = $title;
13 - $this->mRevId = $revId;
1414 }
1515
1616 public function getModelName() {
1717 return $this->mModelName;
1818 }
1919
20 - public function getTitle() {
21 - return $this->mTitle;
22 - }
 20+ public abstract function getSearchText( );
2321
24 - public function getRevId() {
25 - return $this->mRevId;
26 - }
 22+ public abstract function getWikitextForTransclusion( );
2723
28 - public abstract function getSearchText( $obj );
29 -
30 - public abstract function getWikitextForTransclusion( $obj );
31 -
32 - public abstract function getParserOutput( ParserOptions $options = NULL );
33 -
 24+ /**
 25+ * Returns native represenation of the data. Interpretation depends on the data model used,
 26+ * as given by getDataModel().
 27+ *
 28+ */
3429 public abstract function getRawData( );
3530
36 - public function getHtml( ParserOptions $options ) {
37 - $po = $this->getParserOutput( $options );
38 - return $po->getText();
39 - }
 31+ public abstract function getParserOutput( Title $title = null, $revId = null, ParserOptions $options = NULL );
4032
41 - public function getIndexUpdateJobs( ParserOptions $options , $recursive = true ) {
42 - $po = $this->getParserOutput( $options );
43 - $update = new LinksUpdate( $this->mTitle, $po, $recursive );
44 - return $update;
45 - }
46 -
4733 public function getRedirectChain() {
4834 return null;
4935 }
@@ -60,20 +46,20 @@
6147 }
6248
6349 /**
64 - * Replaces the section with the given id.
 50+ * Replaces a section of the content.
6551 *
66 - * The default implementation returns $this.
67 - *
68 - * @param String $sectionId the section's id
69 - * @param Content $with the section's new content
70 - * @return Content a new content object with the section replaced, or this content object if the section couldn't be replaced.
 52+ * @param $section empty/null/false or a section number (0, 1, 2, T1, T2...), or "new"
 53+ * @param $with Content: new content of the section
 54+ * @param $sectionTitle String: new section's subject, only if $section is 'new'
 55+ * @return string Complete article text, or null if error
7156 */
72 - public function replaceSection( $sectionId ) {
 57+ public function replaceSection( $section, Content $with, $sectionTitle = '' ) {
 58+ return $this;
7359 }
7460
75 - #XXX: is the native model for wikitext a string or the parser output? parse early or parse late?
 61+ #TODO: implement specialized ParserOutput for Wikidata model
 62+ #TODO: provide addToParserOutput fule Multipart... somehow.
7663
77 -
7864 # TODO: EditPage::mergeChanges( Content $a, Content $b )
7965 # TODO: Wikipage::isCountable(Content $a)
8066 # TODO: Title::newFromRedirectRecurse( $this->getRawText() );
@@ -82,7 +68,6 @@
8369 # TODO: getSize( )
8470
8571 # TODO: WikiPage::getUndoText( Revision $undo, Revision $undoafter = null )
86 - # TODO: WikiPage::replaceSection( $section, $text, $sectionTitle = '', $edittime = null )
8772 # TODO: WikiPage::getAutosummary( $oldtext, $text, $flags )
8873
8974 # TODO: EditPage::getPreloadedText( $preload ) // $wgParser->getPreloadText
@@ -94,23 +79,50 @@
9580
9681 }
9782
98 -class TextContent extends Content {
99 - public function __construct( $text, Title $title = null, $revId = null, $modelName = null ) {
100 - parent::__construct($title, $revId, $modelName);
 83+/**
 84+ * Content object implementation for representing flat text. The
 85+ */
 86+abstract class TextContent extends Content {
 87+ public function __construct( $text, $modelName = null ) {
 88+ parent::__construct($modelName);
10189
10290 $this->mText = $text;
10391 }
10492
105 - public function getSearchText( $obj ) {
 93+ /**
 94+ * Returns the text represented by this Content object, as a string.
 95+ *
 96+ * @return String the raw text
 97+ */
 98+ public function getRawData( ) {
 99+ $text = $this->mText;
 100+ return $text;
 101+ }
 102+
 103+ /**
 104+ * Returns the text represented by this Content object, as a string.
 105+ *
 106+ * @return String the raw text
 107+ */
 108+ public function getSearchText( ) { #FIXME: use!
106109 return $this->getRawData();
107110 }
108111
109 - public function getWikitextForTransclusion( $obj ) {
 112+ /**
 113+ * Returns the text represented by this Content object, as a string.
 114+ *
 115+ * @return String the raw text
 116+ */
 117+ public function getWikitextForTransclusion( ) { #FIXME: use!
110118 return $this->getRawData();
111119 }
112120
113 -
114 - public function getParserOutput( ParserOptions $options = null ) {
 121+ /**
 122+ * Returns a generic ParserOutput object, wrapping the HTML returned by getHtml().
 123+ *
 124+ * @return ParserOutput representing the HTML form of the text
 125+ */
 126+ public function getParserOutput( Title $title = null, $revId = null, ParserOptions $options = null ) {
115127 # generic implementation, relying on $this->getHtml()
116128
117129 $html = $this->getHtml( $options );
@@ -123,53 +135,39 @@
124136 return $po;
125137 }
126138
127 - public function getHtml( ParserOptions $options ) {
128 - $html = "";
129 - $html .= "<pre class=\"mw-code\" dir=\"ltr\">\n";
130 - $html .= htmlspecialchars( $this->getRawData() );
131 - $html .= "\n</pre>\n";
 139+ protected abstract function getHtml( );
132140
133 - return $html;
134 - }
135 -
136 -
137 - public function getRawData( ) {
138 - $text = $this->mText;
139 - return $text;
140 - }
141 -
142 - public function getRedirectChain() {
143 - #XXX: really do this for all text, or just in WikitextContent?
144 - $text = $this->getRawData();
145 - return Title::newFromRedirectArray( $text );
146 - }
147141 }
148142
149143 class WikitextContent extends TextContent {
150 - public function __construct( $text, Title $title, $revId = null) {
151 - parent::__construct($text, $title, $revId, CONTENT_MODEL_WIKITEXT);
 144+ public function __construct( $text ) {
 145+ parent::__construct($text, CONTENT_MODEL_WIKITEXT);
152146
153 - $this->mDefaultParserOptions = null;
 147+ $this->mDefaultParserOptions = null; #TODO: use per-class static member?!
154148 }
155149
 150+ protected function getHtml( ) {
 151+ throw new MWException( "getHtml() not implemented for wikitext. Use getParserOutput()->getText()." );
 152+ }
 153+
156154 public function getDefaultParserOptions() {
157155 global $wgUser, $wgContLang;
158156
159 - if ( !$this->mDefaultParserOptions ) {
160 - #TODO: use static member?!
 157+ if ( !$this->mDefaultParserOptions ) { #TODO: use per-class static member?!
161158 $this->mDefaultParserOptions = ParserOptions::newFromUserAndLang( $wgUser, $wgContLang );
162159 }
163160
164161 return $this->mDefaultParserOptions;
165162 }
166163
167 - public function getParserOutput( ParserOptions $options = null ) {
 164+ /**
 165+ * Returns a ParserOutput object reesulting from parsing the content's text using $wgParser
 166+ *
 167+ * @return ParserOutput representing the HTML form of the text
 168+ */
 169+ public function getParserOutput( Title $title = null, $revId = null, ParserOptions $options = null ) {
168170 global $wgParser;
169171
170 - #TODO: quick local cache: if $options is NULL, use ->mParserOutput!
171 - #FIXME: need setParserOutput, so we can use stuff from the parser cache??
172 - #FIXME: ...or we somehow need to know the parser cache key??
173 -
174172 if ( !$options ) {
175173 $options = $this->getDefaultParserOptions();
176174 }
@@ -190,80 +188,64 @@
191189
192190 $text = $this->getRawData();
193191 $sect = $wgParser->getSection( $text, $section, false );
194 - $title = Title::newFromDBkey( $this->mTitle->getText() . '#' . $section, $this->mTitle->getNamespace() ); #FIXME: get rid of titles here
195192
196 - return new WikitextContent( $sect, $title );
 193+ return new WikitextContent( $sect );
197194 }
198195
199196 /**
200 - * Replaces the section with the given id.
 197+ * Replaces a section in the wikitext
201198 *
202 - * @param String $sectionId the section's id
203 - * @param Content $with the section's new content
204 - * @return Boolean true if te section was replaced sucessfully, false otherwise
205 - */
206 - #FIXME: implement replaceSection(), use in WikiPage
207 -
208 - /**
209 - * @param $section empty/null/false or a section number (0, 1, 2, T1, T2...)
210 - * @param $text String: new text of the section
 199+ * @param $section empty/null/false or a section number (0, 1, 2, T1, T2...), or "new"
 200+ * @param $with Content: new content of the section
211201 * @param $sectionTitle String: new section's subject, only if $section is 'new'
212 - * @param $edittime String: revision timestamp or null to use the current revision
213202 * @return string Complete article text, or null if error
214203 */
215 - /*public function replaceSection( $section, $text, $sectionTitle = '', $edittime = null ) { #FIXME: adopt this!
 204+ public function replaceSection( $section, Content $with, $sectionTitle = '' ) {
 205+ global $wgParser;
 206+
216207 wfProfileIn( __METHOD__ );
217208
218 - if ( strval( $section ) == '' ) {
219 - // Whole-page edit; let the whole text through
220 - } else {
221 - // Bug 30711: always use current version when adding a new section
222 - if ( is_null( $edittime ) || $section == 'new' ) {
223 - $oldtext = $this->getRawText();
224 - if ( $oldtext === false ) {
225 - wfDebug( __METHOD__ . ": no page text\n" );
226 - wfProfileOut( __METHOD__ );
227 - return null;
228 - }
229 - } else {
230 - $dbw = wfGetDB( DB_MASTER );
231 - $rev = Revision::loadFromTimestamp( $dbw, $this->mTitle, $edittime );
 209+ $myModelName = $this->getModelName();
 210+ $sectionModelName = $with->getModelName();
232211
233 - if ( !$rev ) {
234 - wfDebug( "WikiPage::replaceSection asked for bogus section (page: " .
235 - $this->getId() . "; section: $section; edittime: $edittime)\n" );
236 - wfProfileOut( __METHOD__ );
237 - return null;
238 - }
 212+ if ( $sectionModelName != $myModelName ) {
 213+ throw new MWException( "Incompatible content model for section: document uses $myModelName, section uses $sectionModelName." );
 214+ }
239215
240 - $oldtext = $rev->getText();
241 - }
 216+ $oldtext = $this->getRawData();
 217+ $text = $with->getRawData();
242218
243 - if ( $section == 'new' ) {
244 - # Inserting a new section
245 - $subject = $sectionTitle ? wfMsgForContent( 'newsectionheaderdefaultlevel', $sectionTitle ) . "\n\n" : '';
246 - if ( wfRunHooks( 'PlaceNewSection', array( $this, $oldtext, $subject, &$text ) ) ) {
247 - $text = strlen( trim( $oldtext ) ) > 0
248 - ? "{$oldtext}\n\n{$subject}{$text}"
249 - : "{$subject}{$text}";
250 - }
251 - } else {
252 - # Replacing an existing section; roll out the big guns
253 - global $wgParser;
254 -
255 - $text = $wgParser->replaceSection( $oldtext, $section, $text );
 219+ if ( $section == 'new' ) {
 220+ # Inserting a new section
 221+ $subject = $sectionTitle ? wfMsgForContent( 'newsectionheaderdefaultlevel', $sectionTitle ) . "\n\n" : '';
 222+ if ( wfRunHooks( 'PlaceNewSection', array( $this, $oldtext, $subject, &$text ) ) ) {
 223+ $text = strlen( trim( $oldtext ) ) > 0
 224+ ? "{$oldtext}\n\n{$subject}{$text}"
 225+ : "{$subject}{$text}";
256226 }
 227+ } else {
 228+ # Replacing an existing section; roll out the big guns
 229+ global $wgParser;
 230+
 231+ $text = $wgParser->replaceSection( $oldtext, $section, $text );
257232 }
258233
 234+ $newContent = new WikitextContent( $text );
 235+
259236 wfProfileOut( __METHOD__ );
260 - return $text;
261 - } */
 237+ return $newContent;
 238+ }
262239
 240+ public function getRedirectChain() {
 241+ $text = $this->getRawData();
 242+ return Title::newFromRedirectArray( $text );
 243+ }
 244+
263245 }
264246
265247 class MessageContent extends TextContent {
266248 public function __construct( $msg_key, $params = null, $options = null ) {
267 - parent::__construct(null, null, null, CONTENT_MODEL_WIKITEXT);
 249+ parent::__construct(null, CONTENT_MODEL_WIKITEXT);
268250
269251 $this->mMessageKey = $msg_key;
270252
@@ -275,13 +257,19 @@
276258 $this->mHtmlOptions = null;
277259 }
278260
279 -
280 - public function getHtml( ParserOptions $options ) {
 261+ /**
 262+ * Returns the message as rendered HTML, using the options supplied to the constructor plus "parse".
 263+ */
 264+ protected function getHtml( ) {
281265 $opt = array_merge( $this->mOptions, array('parse') );
 266+
282267 return wfMsgExt( $this->mMessageKey, $this->mParameters, $opt );
283268 }
284269
285270
 271+ /**
 272+ * Returns the message as raw text, using the options supplied to the constructor minus "parse" and "parseinline".
 273+ */
286274 public function getRawData( ) {
287275 $opt = array_diff( $this->mOptions, array('parse', 'parseinline') );
288276
@@ -292,11 +280,11 @@
293281
294282
295283 class JavaScriptContent extends TextContent {
296 - public function __construct( $text, Title $title, $revId = null ) {
297 - parent::__construct($text, $title, $revId, CONTENT_MODEL_JAVASCRIPT);
 284+ public function __construct( $text ) {
 285+ parent::__construct($text, CONTENT_MODEL_JAVASCRIPT);
298286 }
299287
300 - public function getHtml( ParserOptions $options ) {
 288+ protected function getHtml( ) {
301289 $html = "";
302290 $html .= "<pre class=\"mw-code mw-js\" dir=\"ltr\">\n";
303291 $html .= htmlspecialchars( $this->getRawData() );
@@ -308,11 +296,11 @@
309297 }
310298
311299 class CssContent extends TextContent {
312 - public function __construct( $text, Title $title, $revId = null ) {
313 - parent::__construct($text, $title, $revId, CONTENT_MODEL_CSS);
 300+ public function __construct( $text ) {
 301+ parent::__construct($text, CONTENT_MODEL_CSS);
314302 }
315303
316 - public function getHtml( ParserOptions $options ) {
 304+ protected function getHtml( ) {
317305 $html = "";
318306 $html .= "<pre class=\"mw-code mw-css\" dir=\"ltr\">\n";
319307 $html .= htmlspecialchars( $this->getRawData() );
@@ -322,10 +310,8 @@
323311 }
324312 }
325313
326 -#FIXME: special type for redirects?!
327 -#FIXME: special type for message-based pseudo-content? with raw html?
328 -
329 -#TODO: MultipartMultipart < WikipageContent (Main + Links + X)
330 -#TODO: LinksContent < LanguageLinksContent, CategoriesContent
 314+#FUTURE: special type for redirects?!
 315+#FUTURE: MultipartMultipart < WikipageContent (Main + Links + X)
 316+#FUTURE: LinksContent < LanguageLinksContent, CategoriesContent
331317 #EXAMPLE: CoordinatesContent
332318 #EXAMPLE: WikidataContent
Index: branches/Wikidata/phase3/includes/ContentHandler.php
@@ -29,11 +29,13 @@
3030 return null;
3131 }
3232
33 - public static function makeContent( $text, Title $title, $format = null, $revId = null ) {
34 - $handler = ContentHandler::getForTitle( $title );
 33+ public static function makeContent( $text, Title $title, $modelName = null, $format = null ) {
 34+ if ( !$modelName ) {
 35+ $modelName = $title->getContentModelName();
 36+ }
3537
36 - #FIXME: pass revid?
37 - return $handler->unserialize( $text, $title, $format );
 38+ $handler = ContentHandler::getForModelName( $modelName );
 39+ return $handler->unserialize( $text, $format );
3840 }
3941
4042 public static function getDefaultModelFor( Title $title ) {
@@ -141,11 +143,11 @@
142144 return $this->mSupportedFormats[0];
143145 }
144146
145 - public abstract function serialize( Content $content, Title $title, $format = null );
 147+ public abstract function serialize( Content $content, $format = null );
146148
147 - public abstract function unserialize( $blob, Title $title, $format = null ); #FIXME: ...and revId?
 149+ public abstract function unserialize( $blob, $format = null );
148150
149 - public abstract function newContent( Title $title );
 151+ public abstract function emptyContent();
150152
151153 # public abstract function doPreSaveTransform( $title, $obj ); #TODO...
152154
@@ -199,13 +201,6 @@
200202 return $de;
201203 }
202204
203 - public function getIndexUpdateJobs( Title $title, ParserOutput $parserOutput, $recursive = true ) {
204 - # for wikitext, create a LinksUpdate object
205 - # for wikidata: serialize arrays to json
206 - $update = new LinksUpdate( $title, $parserOutput, $recursive );
207 - return $update;
208 - }
209 -
210205 #XXX: is the native model for wikitext a string or the parser output? parse early or parse late?
211206
212207 #TODO: how to handle extra message for JS/CSS previews??
@@ -221,7 +216,8 @@
222217 parent::__construct( $modelName, $formats );
223218 }
224219
225 - public function serialize( Content $content, Title $title, $format = null ) {
 220+ public function serialize( Content $content, $format = null ) {
 221+ #FIXME: assert format
226222 return $content->getRawData();
227223 }
228224
@@ -232,12 +228,13 @@
233229 parent::__construct( $modelName, array( 'application/x-wikitext' ) ); #FIXME: mime
234230 }
235231
236 - public function unserialize( $text, Title $title, $format = null ) {
237 - return new WikitextContent($text, $title);
 232+ public function unserialize( $text, $format = null ) {
 233+ #FIXME: assert format
 234+ return new WikitextContent($text);
238235 }
239236
240 - public function newContent( Title $title) {
241 - return new WikitextContent("", $title);
 237+ public function emptyContent() {
 238+ return new WikitextContent("");
242239 }
243240
244241 }
@@ -248,12 +245,12 @@
249246 parent::__construct( $modelName, array( 'text/javascript' ) );
250247 }
251248
252 - public function unserialize( $text, Title $title, $format = null ) {
253 - return new JavaScriptContent($text, $title);
 249+ public function unserialize( $text, $format = null ) {
 250+ return new JavaScriptContent($text);
254251 }
255252
256 - public function newContent( Title $title) {
257 - return new JavaScriptContent("", $title);
 253+ public function emptyContent() {
 254+ return new JavaScriptContent("");
258255 }
259256 }
260257
@@ -263,12 +260,12 @@
264261 parent::__construct( $modelName, array( 'text/css' ) );
265262 }
266263
267 - public function unserialize( $text, Title $title, $format = null ) {
268 - return new CssContent($text, $title);
 264+ public function unserialize( $text, $format = null ) {
 265+ return new CssContent($text);
269266 }
270267
271 - public function newContent( Title $title) {
272 - return new CssContent("", $title);
 268+ public function emptyContent() {
 269+ return new CssContent("");
273270 }
274271
275272 }
Index: branches/Wikidata/phase3/includes/EditPage.php
@@ -1299,10 +1299,12 @@
13001300
13011301 if ( $this->isConflict ) {
13021302 wfDebug( __METHOD__ . ": conflict! getting section '$this->section' for time '$this->edittime' (article time '{$timestamp}')\n" );
1303 - $text = $this->mArticle->replaceSection( $this->section, $this->textbox1, $sectionTitle, $this->edittime );
 1303+ $cnt = $this->mArticle->replaceSection( $this->section, $this->textbox1, $sectionTitle, $this->edittime );
 1304+ $text = ContentHandler::getContentText($cnt); #FIXME: use Content object throughout, make edit form aware of content model and serialization format
13041305 } else {
13051306 wfDebug( __METHOD__ . ": getting section '$this->section'\n" );
1306 - $text = $this->mArticle->replaceSection( $this->section, $this->textbox1, $sectionTitle );
 1307+ $cnt = $this->mArticle->replaceSection( $this->section, $this->textbox1, $sectionTitle );
 1308+ $text = ContentHandler::getContentText($cnt); #FIXME: use Content object throughout, make edit form aware of content model and serialization format
13071309 }
13081310 if ( is_null( $text ) ) {
13091311 wfDebug( __METHOD__ . ": activating conflict; section replace failed.\n" );
Index: branches/Wikidata/phase3/includes/WikiPage.php
@@ -1127,18 +1127,21 @@
11281128 * @param $text String: new text of the section
11291129 * @param $sectionTitle String: new section's subject, only if $section is 'new'
11301130 * @param $edittime String: revision timestamp or null to use the current revision
1131 - * @return string Complete article text, or null if error
 1131+ * @return Content new complete article content, or null if error
11321132 */
1133 - public function replaceSection( $section, $text, $sectionTitle = '', $edittime = null ) { #FIXME: move to Content object!
 1133+ public function replaceSection( $section, $text, $sectionTitle = '', $edittime = null ) {
11341134 wfProfileIn( __METHOD__ );
11351135
 1136+ $sectionContent = ContentHandler::makeContent( $text, $this->getTitle() ); #XXX: could make section title, but that's not required.
 1137+
11361138 if ( strval( $section ) == '' ) {
11371139 // Whole-page edit; let the whole text through
 1140+ $newContent = $sectionContent;
11381141 } else {
11391142 // Bug 30711: always use current version when adding a new section
11401143 if ( is_null( $edittime ) || $section == 'new' ) {
1141 - $oldtext = $this->getRawText();
1142 - if ( $oldtext === false ) {
 1144+ $oldContent = $this->getContent();
 1145+ if ( ! $oldContent ) {
11431146 wfDebug( __METHOD__ . ": no page text\n" );
11441147 wfProfileOut( __METHOD__ );
11451148 return null;
@@ -1154,27 +1157,14 @@
11551158 return null;
11561159 }
11571160
1158 - $oldtext = $rev->getText();
 1161+ $oldContent = $rev->getContent();
11591162 }
11601163
1161 - if ( $section == 'new' ) {
1162 - # Inserting a new section
1163 - $subject = $sectionTitle ? wfMsgForContent( 'newsectionheaderdefaultlevel', $sectionTitle ) . "\n\n" : '';
1164 - if ( wfRunHooks( 'PlaceNewSection', array( $this, $oldtext, $subject, &$text ) ) ) {
1165 - $text = strlen( trim( $oldtext ) ) > 0
1166 - ? "{$oldtext}\n\n{$subject}{$text}"
1167 - : "{$subject}{$text}";
1168 - }
1169 - } else {
1170 - # Replacing an existing section; roll out the big guns
1171 - global $wgParser;
1172 -
1173 - $text = $wgParser->replaceSection( $oldtext, $section, $text );
1174 - }
 1164+ $newContent = $oldContent->replaceSection( $section, $sectionContent, $sectionTitle );
11751165 }
11761166
11771167 wfProfileOut( __METHOD__ );
1178 - return $text;
 1168+ return $newContent;
11791169 }
11801170
11811171 /**
@@ -2831,7 +2821,9 @@
28322822 */
28332823 function __construct( Page $page, ParserOptions $parserOptions, $revid, $useParserCache, $content = null ) {
28342824 if ( is_string($content) ) { #BC: old style call
2835 - $content = ContentHandler::makeContent( $content, $page->getTitle(), null, $this->revid ); #FIXME: format? from revision?
 2825+ $modelName = $page->getRevision()->getContentModelName();
 2826+ $format = $page->getRevision()->getContentFormat();
 2827+ $content = ContentHandler::makeContent( $content, $page->getTitle(), $modelName, $format );
28362828 }
28372829
28382830 $this->page = $page;

Status & tagging log