Commit 5988b7de authored by Robert Lyon's avatar Robert Lyon

Bug 1816311: Showing correct journal entry poster's name

When adding comment to the entry and the journal is owned by
group/institution

behatnotneeded

Change-Id: Id492c04e3facdbf00a5dfdc4d714c3c5103ff3a2
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 9f031671
......@@ -114,7 +114,8 @@ class PluginBlocktypeTaggedposts extends MaharaCoreBlocktype {
$sqlvalues = array($view);
$typecast = is_postgres() ? '::varchar' : '';
$sql =
"SELECT a.title, p.title AS parenttitle, a.id, a.parent, a.owner, a.description, a.allowcomments, at.tag, a.ctime, a.mtime
"SELECT a.title, p.title AS parenttitle, a.id, a.parent, a.owner, a.author, a.authorname,
a.description, a.allowcomments, at.tag, a.ctime, a.mtime
FROM {artefact} a
JOIN {artefact} p ON a.parent = p.id
JOIN {artefact_blog_blogpost} ab ON (ab.blogpost = a.id AND ab.published = 1)
......@@ -222,7 +223,8 @@ class PluginBlocktypeTaggedposts extends MaharaCoreBlocktype {
foreach ($results as $result) {
$dataobject["artefact"] = $result->parent;
$result->displaydate= format_date(strtotime($result->ctime));
$result->postedbyon = ArtefactTypeBlog::display_postedby($result->ctime, display_default_name($result->owner));
$by = $result->author ? display_default_name($result->author) : $result->authorname;
$result->postedbyon = ArtefactTypeBlog::display_postedby($result->ctime, $by);
if ($result->ctime != $result->mtime) {
$result->updateddate= format_date(strtotime($result->mtime));
......
......@@ -923,7 +923,8 @@ class ArtefactTypeBlogPost extends ArtefactType {
}
$smarty->assign('postid', $this->get('id'));
}
$smarty->assign('postedbyon', ArtefactTypeBlog::display_postedby($this->ctime, display_name($this->owner)));
$by = $this->author ? display_default_name($this->author) : $this->authorname;
$smarty->assign('postedbyon', ArtefactTypeBlog::display_postedby($this->ctime, $by));
if ($this->ctime != $this->mtime) {
$smarty->assign('updatedon', get_string('updatedon', 'artefact.blog') . ' ' . format_date($this->mtime));
}
......
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