* @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() );
+ }
}
/**
'import-error-interwiki' => 'Page "$1" is not imported because its name is reserved for external linking (interwiki).',
'import-error-special' => 'Page "$1" is not imported because it belongs to a special namespace that does not allow pages.',
'import-error-invalid' => 'Page "$1" is not imported because its name is invalid.',
+'import-error-unserialize' => 'Revision $2 of page "$1" could not be unserialized. The revision was reported to use content model $3 serialized as $4.',
'import-options-wrong' => 'Wrong {{PLURAL:$2|option|options}}: <nowiki>$1</nowiki>',
'import-rootpage-invalid' => 'Given root page is an invalid title.',
'import-rootpage-nosubpage' => 'Namespace "$1" of the root page does not allow subpages.',
* $1 is a page name.
See also:
* {{msg-mw|import-error-edit}}',
+'import-error-unserialize' => 'Import error message displayed when a revision could not be unserialized.
+This may happen if the content got corrupted or the serialization format is mis-reported. Parameters:
+* $1 is the name of the page the offending revision belongs to.
+* $2 is the ID of the offending revision, as reported in the dump that is being imported.
+* $3 is the content model reported for the offending revision in the dump that is being imported.
+* $4 is the serialization format reported for the offending revision in the dump that is being imported.',
'import-options-wrong' => 'Used on [[Special:Import]], when one of the options has an error.',
'import-rootpage-invalid' => 'Used on [[Special:Import]], when the root page is invalid.',
'import-rootpage-nosubpage' => 'Used on [[Special:Import]], when the import namespace does not support subpages. Parameters: