From: Matěj Suchánek Date: Thu, 2 Aug 2018 09:41:46 +0000 (+0200) Subject: Fix import logging X-Git-Tag: 1.34.0-rc.0~4530^2 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=5c374733f5a727204a1135998a1f86662a6e0af8;p=lhc%2Fweb%2Fwiklou.git 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 --- 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" );