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

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: default avatarRobert Lyon <robertl@catalyst.net.nz>
parent 9f031671
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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));
+2 −1
Original line number Diff line number Diff line
@@ -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));
        }