$logEntry->setPerformer( $user );
$logEntry->setTarget( $title );
$logEntry->setComment( $logComment );
- $logEntry->setTags( $tags );
+ $logEntry->addTags( $tags );
$logid = $logEntry->insert();
$logEntry->publish( $logid );
$logEntry->setPerformer( $user );
$logEntry->setTarget( clone $title );
$logEntry->setComment( $reason );
- $logEntry->setTags( $tags );
+ $logEntry->addTags( $tags );
$logid = $logEntry->insert();
$dbw->onTransactionPreCommitOrIdle(
function () use ( $logEntry, $logid ) {
'4::oldtitle' => $this->oldTitle->getPrefixedText(),
] );
$logEntry->setRelations( [ 'pr_id' => $logRelationsValues ] );
- $logEntry->setTags( $changeTags );
+ $logEntry->addTags( $changeTags );
$logId = $logEntry->insert();
$logEntry->publish( $logId );
}
# Log the move
$logid = $logEntry->insert();
- $logEntry->setTags( $changeTags );
+ $logEntry->addTags( $changeTags );
$logEntry->publish( $logid );
return $nullRevision;
}
$logEntry->setParameters( $params );
$logEntry->setRelations( [ 'Tag' => $tag ] );
- $logEntry->setTags( $logEntryTags );
+ $logEntry->addTags( $logEntryTags );
$logId = $logEntry->insert( $dbw );
$logEntry->publish( $logId );
# Add change tags, if any
if ( $tags ) {
- $logEntry->setTags( $tags );
+ $logEntry->addTags( $tags );
}
# Uploads can be patrolled
wfDebug( 'Overwriting existing ManualLogEntry tags' );
}
$this->tags = [];
- if ( $tags !== null ) {
- $this->addTags( $tags );
- }
+ $this->addTags( $tags );
}
/**
* Add change tags for the log entry
*
* @since 1.33
- * @param string|string[] $tags Tags to apply
+ * @param string|string[]|null $tags Tags to apply
*/
public function addTags( $tags ) {
+ if ( $tags === null ) {
+ return;
+ }
+
if ( is_string( $tags ) ) {
$tags = [ $tags ];
}
$entry->setTarget( $rc->getTitle() );
$entry->setParameters( self::buildParams( $rc, $auto ) );
$entry->setPerformer( $user );
- $entry->setTags( $tags );
+ $entry->addTags( $tags );
$logid = $entry->insert();
if ( !$auto ) {
$entry->publish( $logid, 'udp' );
$logEntry->setPerformer( $user );
$logEntry->setTarget( $this->title );
$logEntry->setComment( $comment );
- $logEntry->setTags( $tags );
+ $logEntry->addTags( $tags );
$logEntry->setParameters( [
':assoc:count' => [
'revisions' => $textRestored,
if ( !is_null( $nullRevision ) ) {
$logEntry->setAssociatedRevId( $nullRevision->getId() );
}
- $logEntry->setTags( $tags );
+ $logEntry->addTags( $tags );
if ( $logRelationsField !== null && count( $logRelationsValues ) ) {
$logEntry->setRelations( [ $logRelationsField => $logRelationsValues ] );
}
$logEntry->setPerformer( $deleter );
$logEntry->setTarget( $logTitle );
$logEntry->setComment( $reason );
- $logEntry->setTags( $tags );
+ $logEntry->addTags( $tags );
$logid = $logEntry->insert();
$dbw->onTransactionPreCommitOrIdle(
}
$logEntry->setRelations( $relations );
// Apply change tags to the log entry
- $logEntry->setTags( $params['tags'] );
+ $logEntry->addTags( $params['tags'] );
$logId = $logEntry->insert();
$logEntry->publish( $logId );
}
$logId = $logEntry->insert();
if ( !empty( $data['Tags'] ) ) {
- $logEntry->setTags( $data['Tags'] );
+ $logEntry->addTags( $data['Tags'] );
}
$logEntry->publish( $logId );
$entry->setTarget( $title );
$entry->setParameters( $logParams );
$entry->setComment( $reason );
- $entry->setTags( $tags );
+ $entry->addTags( $tags );
$logid = $entry->insert();
$entry->publish( $logid );
$logEntry->setComment( $data['Reason'] );
$logEntry->setPerformer( $performer );
if ( isset( $data['Tags'] ) ) {
- $logEntry->setTags( $data['Tags'] );
+ $logEntry->addTags( $data['Tags'] );
}
$logEntry->setRelations( [ 'ipb_id' => $block->getId() ] );
$logId = $logEntry->insert();
] );
$logid = $logEntry->insert();
if ( count( $tags ) ) {
- $logEntry->setTags( $tags );
+ $logEntry->addTags( $tags );
}
$logEntry->publish( $logid );
}
// Make sure the null revision will be tagged as well
$logEntry->setAssociatedRevId( $nullRevId );
if ( count( $this->logTags ) ) {
- $logEntry->setTags( $this->logTags );
+ $logEntry->addTags( $this->logTags );
}
$logid = $logEntry->insert();
$logEntry->publish( $logid );