make sure revision uids are 0 in the xml if missing/0 in the db
authorAriel T. Glenn <ariel@wikimedia.org>
Mon, 27 May 2019 13:03:29 +0000 (16:03 +0300)
committerDaniel Kinzler <dkinzler@wikimedia.org>
Mon, 3 Jun 2019 15:49:11 +0000 (15:49 +0000)
Bug: T224221
Change-Id: Id9861866fd9e4d2fe8d151c9631403aa24b9a779

includes/export/XmlDumpWriter.php

index 39153cf..d3fd374 100644 (file)
@@ -252,7 +252,8 @@ class XmlDumpWriter {
                if ( isset( $row->rev_deleted ) && ( $row->rev_deleted & Revision::DELETED_USER ) ) {
                        $out .= "      " . Xml::element( 'contributor', [ 'deleted' => 'deleted' ] ) . "\n";
                } else {
-                       $out .= $this->writeContributor( $row->rev_user, $row->rev_user_text );
+                       // empty values get written out as uid 0, see T224221
+                       $out .= $this->writeContributor( $row->rev_user ?: 0, $row->rev_user_text );
                }
 
                if ( isset( $row->rev_minor_edit ) && $row->rev_minor_edit ) {