Index: branches/Wikidata/phase3/includes/WikiPage.php |
— | — | @@ -911,7 +911,7 @@ |
912 | 912 | |
913 | 913 | if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) { |
914 | 914 | if ( $this->mTitle->exists() ) { |
915 | | - $text = $this->getNativeData(); |
| 915 | + $text = $this->getNativeData(); #FIXME: may not be a string. check Content model! |
916 | 916 | } else { |
917 | 917 | $text = false; |
918 | 918 | } |
— | — | @@ -1265,7 +1265,7 @@ |
1266 | 1266 | $isminor = ( $flags & EDIT_MINOR ) && $user->isAllowed( 'minoredit' ); |
1267 | 1267 | $bot = $flags & EDIT_FORCE_BOT; |
1268 | 1268 | |
1269 | | - $oldtext = $this->getNativeData(); // current revision |
| 1269 | + $oldtext = $this->getNativeData(); // current revision #FIXME: may not be a string. check Content model! |
1270 | 1270 | $oldsize = strlen( $oldtext ); |
1271 | 1271 | $oldid = $this->getLatest(); |
1272 | 1272 | $oldIsRedirect = $this->isRedirect(); |
Index: branches/Wikidata/phase3/includes/api/ApiParse.php |
— | — | @@ -318,7 +318,7 @@ |
319 | 319 | |
320 | 320 | $page = WikiPage::factory( $titleObj ); |
321 | 321 | |
322 | | - if ( $this->section !== false ) { |
| 322 | + if ( $this->section !== false ) { #FIXME: get section Content, get parser output, ... |
323 | 323 | $this->text = $this->getSectionText( $page->getRawText(), !is_null( $pageId ) |
324 | 324 | ? 'page id ' . $pageId : $titleObj->getText() ); #FIXME: get section... |
325 | 325 | |
— | — | @@ -330,13 +330,13 @@ |
331 | 331 | $pout = $page->getParserOutput( $popts ); |
332 | 332 | if ( $getWikitext ) { |
333 | 333 | $this->content = $page->getContent( Revision::RAW ); #FIXME: use $this->content everywhere |
334 | | - $this->text = $this->content->getNativeData(); #FIXME: change $this->text to $this->data?! |
| 334 | + $this->text = ContentHandler::getContentText( $this->content ); #FIXME: serialize, get format from params; or use object structure in result? |
335 | 335 | } |
336 | 336 | return $pout; |
337 | 337 | } |
338 | 338 | } |
339 | 339 | |
340 | | - private function getSectionText( $text, $what ) { |
| 340 | + private function getSectionText( $text, $what ) { #FIXME: replace with Content::getSection |
341 | 341 | global $wgParser; |
342 | 342 | // Not cached (save or load) |
343 | 343 | $text = $wgParser->getSection( $text, $this->section, false ); |
Index: branches/Wikidata/phase3/includes/api/ApiEditPage.php |
— | — | @@ -112,13 +112,14 @@ |
113 | 113 | $text = ''; |
114 | 114 | } else { |
115 | 115 | $content = $articleObj->getContentObject(); |
116 | | - $text = $content->getNativeData(); |
| 116 | + $text = ContentHandler::getContentText( $content ); #FIXME: serialize?! get format from params?... |
117 | 117 | } |
118 | 118 | |
119 | 119 | if ( !is_null( $params['section'] ) ) { |
120 | 120 | // Process the content for section edits |
121 | 121 | $section = intval( $params['section'] ); |
122 | | - $text = $content->getSection( $section, false ); |
| 122 | + $sectionContent = $content->getSection( $section ); |
| 123 | + $text = ContentHandler::getContentText( $sectionContent ); #FIXME: serialize?! get format from params?... |
123 | 124 | if ( $text === false || $text === null ) { |
124 | 125 | $this->dieUsage( "There is no section {$section}.", 'nosuchsection' ); |
125 | 126 | } |
Index: branches/Wikidata/phase3/includes/EditPage.php |
— | — | @@ -866,7 +866,7 @@ |
867 | 867 | } |
868 | 868 | |
869 | 869 | $content = $this->mArticle->getContentObject(); |
870 | | - return $content->getNativeData(); # this editor is for editing the raw text. so use the raw text. |
| 870 | + return ContentHandler::getContentText( $content ); # this editor is for editing the raw text. so use the raw text. |
871 | 871 | } |
872 | 872 | |
873 | 873 | /** |