Merge "Stop using legacy ActorMigration field "log_user""

This commit is contained in:
jenkins-bot 2021-04-29 14:37:07 +00:00 committed by Gerrit Code Review
commit 9bd53fc8a1

View file

@ -2,7 +2,6 @@
namespace MediaWiki\Extension\Thanks; namespace MediaWiki\Extension\Thanks;
use ActorMigration;
use ApiBase; use ApiBase;
use ExtensionRegistry; use ExtensionRegistry;
use ManualLogEntry; use ManualLogEntry;
@ -84,18 +83,19 @@ abstract class ApiThank extends ApiBase {
*/ */
protected function haveAlreadyThanked( User $thanker, $uniqueId ) { protected function haveAlreadyThanked( User $thanker, $uniqueId ) {
$dbw = wfGetDB( DB_MASTER ); $dbw = wfGetDB( DB_MASTER );
$logWhere = ActorMigration::newMigration()->getWhere( $dbw, 'log_user', $thanker ); $thankerActor = MediaWikiServices::getInstance()->getActorNormalization()
->acquireActorId( $thanker, $dbw );
return (bool)$dbw->selectRow( return (bool)$dbw->selectRow(
[ 'log_search', 'logging' ] + $logWhere['tables'], [ 'log_search', 'logging' ],
[ 'ls_value' ], [ 'ls_value' ],
[ [
$logWhere['conds'], 'log_actor' => $thankerActor,
'ls_field' => 'thankid', 'ls_field' => 'thankid',
'ls_value' => $uniqueId, 'ls_value' => $uniqueId,
], ],
__METHOD__, __METHOD__,
[], [],
[ 'logging' => [ 'INNER JOIN', 'ls_log_id=log_id' ] ] + $logWhere['joins'] [ 'logging' => [ 'INNER JOIN', 'ls_log_id=log_id' ] ]
); );
} }