Commit 8c8745ef authored by Son Nguyen's avatar Son Nguyen Committed by Robert Lyon

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 f8923eec
...@@ -68,7 +68,7 @@ $string['stopmonitoringsuccess'] = 'Stopped monitoring successfully'; ...@@ -68,7 +68,7 @@ $string['stopmonitoringsuccess'] = 'Stopped monitoring successfully';
$string['stopmonitoringfailed'] = 'Failed to stop monitoring'; $string['stopmonitoringfailed'] = 'Failed to stop monitoring';
$string['newwatchlistmessage'] = 'New activity on your watchlist'; $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['newviewsubject'] = 'New page created';
$string['newviewmessage'] = '%s has created a new page "%s"'; $string['newviewmessage'] = '%s has created a new page "%s"';
......
...@@ -831,7 +831,7 @@ class ActivityTypeWatchlist extends ActivityType { ...@@ -831,7 +831,7 @@ class ActivityTypeWatchlist extends ActivityType {
require_once('view.php'); require_once('view.php');
if ($this->viewinfo = new View($this->view)) { 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->ownerinfo)) {
if (!empty($this->cron)) { // probably deleted already if (!empty($this->cron)) { // probably deleted already
...@@ -888,8 +888,8 @@ class ActivityTypeWatchlist extends ActivityType { ...@@ -888,8 +888,8 @@ class ActivityTypeWatchlist extends ActivityType {
} }
public function get_message($user) { public function get_message($user) {
return get_string_from_language($user->lang, 'newwatchlistmessageview', 'activity', return get_string_from_language($user->lang, 'newwatchlistmessageview1', 'activity',
display_name($this->ownerinfo, $user), $this->viewinfo->get('title')); $this->viewinfo->get('title'), $this->ownerinfo);
} }
public function get_required_parameters() { public function get_required_parameters() {
......
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