Skip to content

Commit

Permalink
MDL-65071 forum: Error handling in web service when forum does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihail Geshoski committed May 2, 2019
1 parent b4a1bbb commit 2a80ecb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions mod/forum/externallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,9 @@ public static function get_forum_discussions(int $forumid, ?int $sortorder = -1,

$forumvault = $vaultfactory->get_forum_vault();
$forum = $forumvault->get_from_id($forumid);
if (!$forum) {
throw new \moodle_exception("Unable to find forum with id {$forumid}");
}
$forumdatamapper = $legacydatamapperfactory->get_forum_data_mapper();
$forumrecord = $forumdatamapper->to_legacy_object($forum);

Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

defined('MOODLE_INTERNAL') || die();

$version = 2019050100.00; // YYYYMMDD = weekly release date of this DEV branch.
$version = 2019050100.01; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.

Expand Down

0 comments on commit 2a80ecb

Please sign in to comment.