MDL-65071 forum: Error handling in web service when forum does not exist

This commit is contained in:
Mihail Geshoski
2019-05-02 13:51:14 +08:00
parent b4a1bbbb6a
commit 2a80ecb543
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -830,6 +830,9 @@ class mod_forum_external extends external_api {
$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);
+1 -1
View File
@@ -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.