mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-09-23 18:30:06 +00:00
Handle section-text being null
This was causing warnings in production: Invalid parameter for message "notification-body-edit-user-talk-with-section": a:1:{s:9:"plaintext";N;} Change-Id: Ibdea5d899caf446a8c7f811416fdabaa3dccccdd
This commit is contained in:
parent
712109fa5d
commit
d2f899d9d3
|
@ -57,10 +57,11 @@ class EchoEditUserTalkPresentationModel extends EchoEventPresentationModel {
|
|||
}
|
||||
|
||||
public function getBodyMessage() {
|
||||
if ( !$this->isBundled() && $this->hasSection() ) {
|
||||
$sectionText = $this->event->getExtraParam( 'section-text' );
|
||||
if ( !$this->isBundled() && $this->hasSection() && $sectionText !== null ) {
|
||||
$msg = $this->msg( 'notification-body-edit-user-talk-with-section' );
|
||||
// section-text is safe to use here, because hasSection() returns false if the revision is deleted
|
||||
$msg->plaintextParams( $this->event->getExtraParam( 'section-text' ) );
|
||||
$msg->plaintextParams( $sectionText );
|
||||
return $msg;
|
||||
} else {
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue