From: daniel Date: Sun, 29 Apr 2012 19:41:03 +0000 (+0200) Subject: merged from master X-Git-Tag: 1.31.0-rc.0~22097^2^2~185 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/supprimer.php?a=commitdiff_plain;h=af28c6f55abdf3d00b18cc44af8ca41e22955491;p=lhc%2Fweb%2Fwiklou.git merged from master --- af28c6f55abdf3d00b18cc44af8ca41e22955491 diff --cc includes/EditPage.php index 1cceee0420,015099a5f6..105590f6f4 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@@ -1090,14 -985,8 +1085,13 @@@ class EditPage return true; case self::AS_HOOK_ERROR: - case self::AS_FILTERING: return false; + case self::AS_PARSE_ERROR: + $wgOut->addWikiText( '
' . $status->getWikiText() . '
'); + #FIXME: cause editform to be shown again, not just an error! + return false; + case self::AS_SUCCESS_NEW_ARTICLE: $query = $resultDetails['redirect'] ? 'redirect=no' : ''; $anchor = isset ( $resultDetails['sectionanchor'] ) ? $resultDetails['sectionanchor'] : ''; diff --cc includes/api/ApiParse.php index bb079dd58b,c2bdeb1f5c..b85f0ffdc8 --- a/includes/api/ApiParse.php +++ b/includes/api/ApiParse.php @@@ -328,9 -328,11 +328,12 @@@ class ApiParse extends ApiBase // Try the parser cache first // getParserOutput will save to Parser cache if able $pout = $page->getParserOutput( $popts ); + if ( !$pout ) { + $this->dieUsage( "There is no revision ID {$page->getLatest()}", 'missingrev' ); + } if ( $getWikitext ) { - $this->text = $page->getRawText(); + $this->content = $page->getContent( Revision::RAW ); #FIXME: use $this->content everywhere + $this->text = ContentHandler::getContentText( $this->content ); #FIXME: serialize, get format from params; or use object structure in result? } return $pout; } diff --cc maintenance/refreshLinks.php index 20a80431c9,26d7e29f28..2de851a100 --- a/maintenance/refreshLinks.php +++ b/maintenance/refreshLinks.php @@@ -212,8 -210,8 +210,8 @@@ class RefreshLinks extends Maintenance return; } - $revision = Revision::newFromTitle( $title ); - if ( !$revision ) { - $text = $page->getRawText(); - if ( $text === false ) { ++ $content = $page->getContent( REVISION::RAW ); ++ if ( null === false ) { return; } @@@ -220,15 -219,10 +219,13 @@@ $dbw->begin( __METHOD__ ); $options = ParserOptions::newFromUserAndLang( new User, $wgContLang ); - $parserOutput = $wgParser->parse( $revision->getText(), $title, $options, true, true, $revision->getId() ); - $parserOutput = $wgParser->parse( $text, $page->getTitle(), $options, true, true, $page->getLatest() ); - $update = new LinksUpdate( $page->getTitle(), $parserOutput, false ); - $update->doUpdate(); ++ $context = RequestContext::getMain(); ++ ++ $parserOutput = $content->getParserOutput( $context, $page->getLatest(), $options, false ); + - $updates = $parserOutput->getSecondaryDataUpdates( $title, false ); - SecondaryDataUpdate::runUpdates( $updates ); ++ $updates = $parserOutput->getSecondaryDataUpdates( $page->getTitle(), false ); ++ SecondaryDataUpdate::runUpdates( $updates ); - $dbw->commit(); - // TODO: We don't know what happens here. - $update = new LinksUpdate( $title, $parserOutput, false ); - $update->doUpdate(); $dbw->commit( __METHOD__ ); } diff --cc tests/phpunit/phpunit.php index d18b33b8ec,e3f780bfdd..e3f780bfdd mode 100644,100755..100644 --- a/tests/phpunit/phpunit.php +++ b/tests/phpunit/phpunit.php