Merge "Handle hidden revision in more places"

This commit is contained in:
jenkins-bot 2024-11-04 22:58:30 +00:00 committed by Gerrit Code Review
commit 98e1b4a34d
2 changed files with 15 additions and 5 deletions

View file

@ -48,4 +48,18 @@ class PlaintextEchoPresentationModelSection extends EchoPresentationModelSection
}
return $title;
}
/**
* Get truncated section title, according to user's language
* or a placeholder text if the section title is not available.
*
* @return string
*/
public function getTruncatedSectionTitle() {
if ( $this->exists() ) {
return parent::getTruncatedSectionTitle();
}
return wfMessage( 'discussiontools-notification-topic-hidden' )->inLanguage( $this->language )->text();
}
}

View file

@ -90,15 +90,11 @@ class SubscribedNewCommentPresentationModel extends EchoEventPresentationModel {
$msg = $this->msg( $this->getHeaderMessageKey() );
// Repeat is B/C until unused parameter is removed from translations
$msg->numParams( $count, $count );
$msg->plaintextParams( $this->section->getTruncatedSectionTitle() );
} else {
$msg = parent::getHeaderMessage();
$msg->params( $this->getTruncatedTitleText( $this->event->getTitle(), true ) );
}
if ( $this->section->exists() ) {
$msg->plaintextParams( $this->section->getTruncatedSectionTitle() );
} else {
$msg->plaintextParams( $this->msg( 'discussiontools-notification-topic-hidden' )->text() );
}
return $msg;