*/
use MediaWiki\MediaWikiServices;
+use MediaWiki\Storage\RevisionRecord;
/**
* Abstract base class for a list of deletable items. The list class
* 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 ) {
$status->failCount++;
continue;
// Cannot just "hide from Sysops" without hiding any fields
- } elseif ( $newBits == Revision::DELETED_RESTRICTED ) {
+ } elseif ( $newBits == RevisionRecord::DELETED_RESTRICTED ) {
$itemStatus->warning(
'revdelete-only-restricted', $item->formatDate(), $item->formatTime() );
$status->failCount++;
} elseif ( IP::isIPAddress( $item->getAuthorName() ) ) {
$authorIPs[] = $item->getAuthorName();
}
- }
- if ( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_WRITE_NEW ) {
+ 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();
}
}
$logEntry->setRelations( $relations );
// Apply change tags to the log entry
- $logEntry->setTags( $params['tags'] );
+ $logEntry->addTags( $params['tags'] );
$logId = $logEntry->insert();
$logEntry->publish( $logId );
}