Commit 0866ac93 authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1794370: Use correct owner for watchlist message



When sending watchlist notification for block changes in a view

behatnotneeded

Change-Id: Ieeb89c6662acabd8438486702e10433ea6feab70
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent a9e89149
...@@ -1250,8 +1250,8 @@ class ActivityTypeWatchlist extends ActivityType { ...@@ -1250,8 +1250,8 @@ class ActivityTypeWatchlist extends ActivityType {
protected $view; protected $view;
private $ownerinfo; protected $ownerinfo;
private $viewinfo; protected $viewinfo;
/** /**
* @param array $data Parameters: * @param array $data Parameters:
...@@ -1333,7 +1333,6 @@ class ActivityTypeWatchlist extends ActivityType { ...@@ -1333,7 +1333,6 @@ class ActivityTypeWatchlist extends ActivityType {
*/ */
class ActivityTypeWatchlistnotification extends ActivityTypeWatchlist{ class ActivityTypeWatchlistnotification extends ActivityTypeWatchlist{
protected $view; protected $view;
protected $viewinfo;
protected $blocktitles = array(); protected $blocktitles = array();
protected $usr; protected $usr;
...@@ -1350,7 +1349,6 @@ class ActivityTypeWatchlistnotification extends ActivityTypeWatchlist{ ...@@ -1350,7 +1349,6 @@ class ActivityTypeWatchlistnotification extends ActivityTypeWatchlist{
$this->usr = $data->usr; $this->usr = $data->usr;
$this->unsubscribelink = get_config('wwwroot') . 'view/unsubscribe.php?a=watchlist&t='; $this->unsubscribelink = get_config('wwwroot') . 'view/unsubscribe.php?a=watchlist&t=';
$this->unsubscribetype = 'watchlist'; $this->unsubscribetype = 'watchlist';
$this->viewinfo = new View($this->view);
} }
/** /**
...@@ -1362,7 +1360,7 @@ class ActivityTypeWatchlistnotification extends ActivityTypeWatchlist{ ...@@ -1362,7 +1360,7 @@ class ActivityTypeWatchlistnotification extends ActivityTypeWatchlist{
*/ */
public function get_message($user) { public function get_message($user) {
$message = get_string_from_language($user->lang, 'newwatchlistmessageview1', 'activity', $message = get_string_from_language($user->lang, 'newwatchlistmessageview1', 'activity',
$this->viewinfo->get('title'), display_name($this->usr, $user)); $this->viewinfo->get('title'), $this->ownerinfo);
try { try {
foreach ($this->blocktitles as $blocktitle) { foreach ($this->blocktitles as $blocktitle) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment