Merge "Replace deprecated LogFormatter::newFromEntry"

This commit is contained in:
jenkins-bot 2024-07-26 18:44:33 +00:00 committed by Gerrit Code Review
commit fa8fa48ebc

View file

@ -4,7 +4,6 @@ namespace MediaWiki\Extension\Thanks;
use DatabaseLogEntry;
use LogEntry;
use LogFormatter;
use LogPage;
use MediaWiki\Extension\Notifications\Formatters\EchoEventPresentationModel;
use MediaWiki\Language\RawMessage;
@ -104,10 +103,11 @@ class EchoCoreThanksPresentationModel extends EchoEventPresentationModel {
if ( !$logEntry ) {
return '';
}
$formatter = LogFormatter::newFromEntry( $logEntry );
$services = MediaWikiServices::getInstance();
$formatter = $services->getLogFormatterFactory()->newFromEntry( $logEntry );
$excerpt = $formatter->getPlainActionText();
// Turn wikitext into plaintext
$excerpt = MediaWikiServices::getInstance()->getCommentFormatter()->format( $excerpt );
$excerpt = $services->getCommentFormatter()->format( $excerpt );
return Sanitizer::stripAllTags( $excerpt );
} else {
// Try to get edit summary.