return [
'posts' => $postbuilder->build($USER, [$forum], [$discussion], $posts),
+ 'forumid' => $discussion->get_forum_id(),
+ 'courseid' => $discussion->get_course_id(),
'ratinginfo' => \core_rating\external\util::get_rating_info(
$legacydatamapper->get_forum_data_mapper()->to_legacy_object($forum),
$forum->get_context(),
public static function get_discussion_posts_returns() {
return new external_single_structure([
'posts' => new external_multiple_structure(\mod_forum\local\exporters\post::get_read_structure()),
+ 'forumid' => new external_value(PARAM_INT, 'The forum id'),
+ 'courseid' => new external_value(PARAM_INT, 'The forum course id'),
'ratinginfo' => \core_rating\external\util::external_ratings_structure(),
'warnings' => new external_warnings()
]);
*
* @return array the forum post details
* @since Moodle 2.7
- * @todo MDL-65252 This will be removed in Moodle 4.1
+ * @todo MDL-65252 This will be removed in Moodle 3.11
*/
public static function get_forum_discussion_posts($discussionid, $sortby = "created", $sortdirection = "DESC") {
global $CFG, $DB, $USER, $PAGE;