From 5c374733f5a727204a1135998a1f86662a6e0af8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mat=C4=9Bj=20Such=C3=A1nek?= Date: Thu, 2 Aug 2018 11:41:46 +0200 Subject: [PATCH] Fix import logging LogEntry::setAssociatedRevId needs to be called before inserting, otherwise log_params and log_search won't contain it. Also, set change tags before inserting as well. Bug: T191271 Change-Id: I190e58b015df90929d161d0def148851098a2542 --- includes/specials/helpers/ImportReporter.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/includes/specials/helpers/ImportReporter.php b/includes/specials/helpers/ImportReporter.php index 63addb8772..c79e87c36e 100644 --- a/includes/specials/helpers/ImportReporter.php +++ b/includes/specials/helpers/ImportReporter.php @@ -158,15 +158,13 @@ class ImportReporter extends ContextSource { $logEntry->setComment( $this->reason ); $logEntry->setPerformer( $this->getUser() ); $logEntry->setParameters( $logParams ); - $logid = $logEntry->insert(); + // Make sure the null revision will be tagged as well + $logEntry->setAssociatedRevId( $nullRevId ); if ( count( $this->logTags ) ) { $logEntry->setTags( $this->logTags ); } - // Make sure the null revision will be tagged as well - $logEntry->setAssociatedRevId( $nullRevId ); - + $logid = $logEntry->insert(); $logEntry->publish( $logid ); - } else { $this->getOutput()->addHTML( "
  • " . $linkRenderer->makeKnownLink( $title ) . " " . $this->msg( 'import-nonewrevisions' )->escaped() . "
  • \n" ); -- 2.20.1