X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fimport%2FWikiRevision.php;h=edb0c9af1c7523ea112e2f10802d89a0dad3968d;hp=f6becb9c927fc1d65e71ce3400eb94792ad9c74e;hb=2480aae0c97d822e10b50619e7b48b25c45af073;hpb=2c8f7978df47f338ee6e245e3efba6175ba425e9 diff --git a/includes/import/WikiRevision.php b/includes/import/WikiRevision.php index f6becb9c92..edb0c9af1c 100644 --- a/includes/import/WikiRevision.php +++ b/includes/import/WikiRevision.php @@ -607,11 +607,12 @@ class WikiRevision { $pageId = $page->getId(); $created = false; + // Note: sha1 has been in XML dumps since 2012. If you have an + // older dump, the duplicate detection here won't work. $prior = $dbw->selectField( 'revision', '1', [ 'rev_page' => $pageId, 'rev_timestamp' => $dbw->timestamp( $this->timestamp ), - 'rev_user_text' => $userText, - 'rev_comment' => $this->getComment() ], + 'rev_sha1' => $this->sha1base36 ], __METHOD__ ); if ( $prior ) { @@ -708,7 +709,6 @@ class WikiRevision { 'log_timestamp' => $dbw->timestamp( $this->timestamp ), 'log_namespace' => $this->getTitle()->getNamespace(), 'log_title' => $this->getTitle()->getDBkey(), - 'log_comment' => $this->getComment(), # 'log_user_text' => $this->user_text, 'log_params' => $this->params ], __METHOD__ @@ -720,9 +720,7 @@ class WikiRevision { . $this->timestamp . "\n" ); return false; } - $log_id = $dbw->nextSequenceValue( 'logging_log_id_seq' ); $data = [ - 'log_id' => $log_id, 'log_type' => $this->type, 'log_action' => $this->action, 'log_timestamp' => $dbw->timestamp( $this->timestamp ), @@ -730,9 +728,8 @@ class WikiRevision { 'log_user_text' => $userText, 'log_namespace' => $this->getTitle()->getNamespace(), 'log_title' => $this->getTitle()->getDBkey(), - 'log_comment' => $this->getComment(), 'log_params' => $this->params - ]; + ] + CommentStore::newKey( 'log_comment' )->insert( $dbw, $this->getComment() ); $dbw->insert( 'logging', $data, __METHOD__ ); return true;