X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Frevisiondelete%2FRevDelList.php;h=f4ea54f0a1c39e5f5ae5f2028e76d931a6d800a4;hb=f0c24143231d90ff409ddee62c853e8b6e1522bb;hp=680ae8e52f88443066b868a22b64e1384c19efc1;hpb=bd62b3562ab80c5da331fe4d4eeb9bbf336e79c3;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/revisiondelete/RevDelList.php b/includes/revisiondelete/RevDelList.php index 680ae8e52f..f4ea54f0a1 100644 --- a/includes/revisiondelete/RevDelList.php +++ b/includes/revisiondelete/RevDelList.php @@ -27,6 +27,12 @@ use MediaWiki\Storage\RevisionRecord; * needs to be able to make a query from a set of identifiers to pull * relevant rows, to return RevDelItem subclasses wrapping them, and * to wrap bulk update operations. + * + * @property RevDelItem $current + * @method RevDelItem next() + * @method RevDelItem reset() + * @method RevDelItem current() + * @phan-file-suppress PhanParamSignatureMismatch */ abstract class RevDelList extends RevisionListBase { function __construct( IContextSource $context, Title $title, array $ids ) { @@ -107,8 +113,6 @@ abstract class RevDelList extends RevisionListBase { * @since 1.23 Added 'perItemStatus' param */ public function setVisibility( array $params ) { - global $wgActorTableSchemaMigrationStage; - $status = Status::newGood(); $bitPars = $params['value']; @@ -137,7 +141,7 @@ abstract class RevDelList extends RevisionListBase { $missing = array_flip( $this->ids ); $this->clearFileOps(); $idsForLog = []; - $authorIds = $authorIPs = $authorActors = []; + $authorActors = []; if ( $perItemStatus ) { $status->itemStatuses = []; @@ -219,29 +223,7 @@ abstract class RevDelList extends RevisionListBase { $virtualOldBits |= $removedBits; $status->successCount++; - if ( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_WRITE_OLD ) { - if ( $item->getAuthorId() > 0 ) { - $authorIds[] = $item->getAuthorId(); - } elseif ( IP::isIPAddress( $item->getAuthorName() ) ) { - $authorIPs[] = $item->getAuthorName(); - } - if ( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_WRITE_NEW ) { - $actorId = $item->getAuthorActor(); - // During migration, the actor field might be empty. If so, populate - // it here. - if ( !$actorId ) { - if ( $item->getAuthorId() > 0 ) { - $user = User::newFromId( $item->getAuthorId() ); - } else { - $user = User::newFromName( $item->getAuthorName(), false ); - } - $actorId = $user->getActorId( $dbw ); - } - $authorActors[] = $actorId; - } - } elseif ( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_WRITE_NEW ) { - $authorActors[] = $item->getAuthorActor(); - } + $authorActors[] = $item->getAuthorActor(); // Save the old and new bits in $visibilityChangeMap for // later use. @@ -285,13 +267,7 @@ abstract class RevDelList extends RevisionListBase { // Log it $authorFields = []; - if ( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_WRITE_OLD ) { - $authorFields['authorIds'] = $authorIds; - $authorFields['authorIPs'] = $authorIPs; - } - if ( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_WRITE_NEW ) { - $authorFields['authorActors'] = $authorActors; - } + $authorFields['authorActors'] = $authorActors; $this->updateLog( $logType, [ @@ -357,8 +333,6 @@ abstract class RevDelList extends RevisionListBase { * title: The target title * ids: The ID list * comment: The log comment - * authorIds: The array of the user IDs of the offenders - * authorIPs: The array of the IP/anon user offenders * authorActors: The array of the actor IDs of the offenders * tags: The array of change tags to apply to the log entry * @throws MWException @@ -381,12 +355,6 @@ abstract class RevDelList extends RevisionListBase { $relations = [ $field => $params['ids'], ]; - if ( isset( $params['authorIds'] ) ) { - $relations += [ - 'target_author_id' => $params['authorIds'], - 'target_author_ip' => $params['authorIPs'], - ]; - } if ( isset( $params['authorActors'] ) ) { $relations += [ 'target_author_actor' => $params['authorActors'], @@ -394,7 +362,7 @@ abstract class RevDelList extends RevisionListBase { } $logEntry->setRelations( $relations ); // Apply change tags to the log entry - $logEntry->setTags( $params['tags'] ); + $logEntry->addTags( $params['tags'] ); $logId = $logEntry->insert(); $logEntry->publish( $logId ); }