X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FImport.php;h=bd9ce25cbca53d98d8541d8d41c1826ecd08b28c;hb=81ea9d1492c296902e9325f3b571cc4e5b39a272;hp=c9b09975fd327307c14c420335153f6e09493fb2;hpb=6bd014ce79438ee697f6d834e9d5b5a522002b6a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Import.php b/includes/Import.php index c9b09975fd..bd9ce25cbc 100644 --- a/includes/Import.php +++ b/includes/Import.php @@ -252,8 +252,16 @@ class WikiImporter { * @return bool */ public function importRevision( $revision ) { - $dbw = wfGetDB( DB_MASTER ); - return $dbw->deadlockLoop( array( $revision, 'importOldRevision' ) ); + try { + $dbw = wfGetDB( DB_MASTER ); + return $dbw->deadlockLoop( array( $revision, 'importOldRevision' ) ); + } catch ( MWContentSerializationException $ex ) { + $this->notice( 'import-error-unserialize', + $revision->getTitle()->getPrefixedText(), + $revision->getID(), + $revision->getModel(), + $revision->getFormat() ); + } } /** @@ -660,7 +668,7 @@ class WikiImporter { if ( isset( $revisionInfo['model'] ) ) { $revision->setModel( $revisionInfo['model'] ); } - if ( isset( $revisionInfo['text'] ) ) { + if ( isset( $revisionInfo['format'] ) ) { $revision->setFormat( $revisionInfo['format'] ); } $revision->setTitle( $pageInfo['_title'] ); @@ -1215,7 +1223,7 @@ class WikiRevision { * @deprecated Since 1.21, use getContent() instead. */ function getText() { - wfDeprecated( "Use getContent() instead." ); + ContentHandler::deprecated( __METHOD__, '1.21' ); return $this->text; } @@ -1397,6 +1405,7 @@ class WikiRevision { # @todo FIXME: Use original rev_id optionally (better for backups) # Insert the row $revision = new Revision( array( + 'title' => $this->title, 'page' => $pageId, 'content_model' => $this->getModel(), 'content_format' => $this->getFormat(),