X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Flogging%2FManualLogEntry.php;h=523a2f8ea16e3984d0d9e4f9aa7a1c0e7f2b9ed2;hb=64e8987c542b5b4a6e7660dec0abf563bb252054;hp=1d0bbfd6fad596da85fe2ba9edc1c9be3dced9b0;hpb=f79c9e6ca3c02090d6d56eaecb2ab90d4198b2b9;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/logging/ManualLogEntry.php b/includes/logging/ManualLogEntry.php index 1d0bbfd6fa..523a2f8ea1 100644 --- a/includes/logging/ManualLogEntry.php +++ b/includes/logging/ManualLogEntry.php @@ -191,18 +191,20 @@ class ManualLogEntry extends LogEntryBase implements Taggable { 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 ]; } @@ -251,8 +253,6 @@ class ManualLogEntry extends LogEntryBase implements Taggable { * @throws MWException */ public function insert( IDatabase $dbw = null ) { - global $wgActorTableSchemaMigrationStage; - $dbw = $dbw ?: wfGetDB( DB_MASTER ); if ( $this->timestamp === null ) { @@ -265,31 +265,6 @@ class ManualLogEntry extends LogEntryBase implements Taggable { $params = $this->getParameters(); $relations = $this->relations; - // Ensure actor relations are set - if ( ( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_WRITE_NEW ) && - empty( $relations['target_author_actor'] ) - ) { - $actorIds = []; - if ( !empty( $relations['target_author_id'] ) ) { - foreach ( $relations['target_author_id'] as $id ) { - $actorIds[] = User::newFromId( $id )->getActorId( $dbw ); - } - } - if ( !empty( $relations['target_author_ip'] ) ) { - foreach ( $relations['target_author_ip'] as $ip ) { - $actorIds[] = User::newFromName( $ip, false )->getActorId( $dbw ); - } - } - if ( $actorIds ) { - $relations['target_author_actor'] = $actorIds; - $params['authorActors'] = $actorIds; - } - } - if ( !( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_WRITE_OLD ) ) { - unset( $relations['target_author_id'], $relations['target_author_ip'] ); - unset( $params['authorIds'], $params['authorIPs'] ); - } - // Additional fields for which there's no space in the database table schema $revId = $this->getAssociatedRevId(); if ( $revId ) {