Skip to content

Commit

Permalink
MDL-65505 forum: handle deleted users with no context in render
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanwyllie committed May 6, 2019
1 parent a411b49 commit b616395
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions mod/forum/classes/local/exporters/author.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
class author extends exporter {
/** @var author_entity $author Author entity */
private $author;
/** @var int $authorcontextid The context id for the author entity */
/** @var int|null $authorcontextid The context id for the author entity */
private $authorcontextid;
/** @var array $authorgroups List of groups that the author belongs to */
private $authorgroups;
Expand All @@ -53,14 +53,14 @@ class author extends exporter {
* Constructor.
*
* @param author_entity $author The author entity to export
* @param int $authorcontextid The context id for the author entity to export
* @param int|null $authorcontextid The context id for the author entity to export (null if the user doesn't have one)
* @param stdClass[] $authorgroups The list of groups that the author belongs to
* @param bool $canview Can the requesting user view this author or should it be anonymised?
* @param array $related The related data for the export.
*/
public function __construct(
author_entity $author,
int $authorcontextid,
?int $authorcontextid,
array $authorgroups = [],
bool $canview = true,
array $related = []
Expand Down
12 changes: 6 additions & 6 deletions mod/forum/classes/local/exporters/discussion_summary.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ class discussion_summary extends exporter {
/** @var int The latest post id in the discussion */
private $latestpostid;

/** @var int The context id for the author of the first post */
/** @var int|null The context id for the author of the first post */
private $firstpostauthorcontextid;

/** @var int The context id for the author of the latest post */
/** @var int|null The context id for the author of the latest post */
private $latestpostauthorcontextid;

/**
Expand All @@ -70,8 +70,8 @@ class discussion_summary extends exporter {
* @param int $replycount The number of replies to the discussion
* @param int $unreadcount number of unread posts if the user is tracking these
* @param int $latestpostid The latest post id in the discussion
* @param int $firstpostauthorcontextid The context id for the author of the first post
* @param int $latestpostauthorcontextid The context id for the author of the latest post
* @param int|null $firstpostauthorcontextid The context id for the author of the first post
* @param int|null $latestpostauthorcontextid The context id for the author of the latest post
* @param array $related The related objects
*/
public function __construct(
Expand All @@ -81,8 +81,8 @@ public function __construct(
int $replycount,
int $unreadcount,
int $latestpostid,
int $firstpostauthorcontextid,
int $latestpostauthorcontextid,
?int $firstpostauthorcontextid,
?int $latestpostauthorcontextid,
array $related = []
) {
$this->summary = $summary;
Expand Down

0 comments on commit b616395

Please sign in to comment.