Commit b4d567f2 authored by Son Nguyen's avatar Son Nguyen
Browse files

Fix the watched group/institution page errors (Bug #1099811)



Get the correct owner info of a watched view in cases of group or
institution pages

Change-Id: I144f969a1cbe464892cc20a33fa6336928373278
Signed-off-by: default avatarSon Nguyen <son.nguyen@catalyst.net.nz>
parent 12fe2696
......@@ -55,7 +55,7 @@ $string['stopmonitoringsuccess'] = 'Stopped monitoring successfully';
$string['stopmonitoringfailed'] = 'Failed to stop monitoring';
$string['newwatchlistmessage'] = 'New activity on your watchlist';
$string['newwatchlistmessageview'] = '%s has changed their page "%s"';
$string['newwatchlistmessageview1'] = 'The page "%s" belonging to %s has been changed';
$string['newviewsubject'] = 'New page created';
$string['newviewmessage'] = '%s has created a new page "%s"';
......
......@@ -869,7 +869,7 @@ class ActivityTypeWatchlist extends ActivityType {
require_once('view.php');
if ($this->viewinfo = new View($this->view)) {
$this->ownerinfo = $this->viewinfo->get_owner_object();
$this->ownerinfo = hsc($this->viewinfo->formatted_owner());
}
if (empty($this->ownerinfo)) {
if (!empty($this->cron)) { // probably deleted already
......@@ -926,8 +926,8 @@ class ActivityTypeWatchlist extends ActivityType {
}
public function get_message($user) {
return get_string_from_language($user->lang, 'newwatchlistmessageview', 'activity',
display_name($this->ownerinfo, $user), $this->viewinfo->get('title'));
return get_string_from_language($user->lang, 'newwatchlistmessageview1', 'activity',
$this->viewinfo->get('title'), $this->ownerinfo);
}
public function get_required_parameters() {
......
Supports Markdown
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