1 This files describes API changes in /mod/forum/*,
2 information provided here is intended especially for developers.
5 * External function get_forum_discussion_posts now returns an additional field "ratinginfo" containing rating information.
8 * External function get_forums_by_courses now returns and additional field "istracked" that indicates if the user
9 is tracking the related forum.
10 * The legacy forum.js file has been removed, this includes the js functions:
11 forum_produce_subscribe_link, forum_produce_tracking_link, lockoptions_timetoitems,
12 lockoptions_timefromitems, lockoptions, lockoption, unlockoption
13 * External function can_add_discussion now returns two additional fields:
14 "canpindiscussions" that indicates if the user can add pinned discussions.
15 "cancreateattachment" that indicates if the user can add attachments to the discussion.
18 * The setting $CFG->forum_replytouser has been removed in favour of a centralized noreplyaddress setting.
19 Please use $CFG->noreplyaddress setting instead.
20 * The following functions have been finally deprecated and should no longer be used.
21 - forum_count_unrated_posts
22 - forum_tp_count_discussion_read_records
23 - forum_get_user_discussions
24 - forum_tp_count_forum_posts
25 - forum_tp_count_forum_read_records
26 - forum_get_open_modes
27 - forum_get_child_posts
28 - forum_get_discussion_posts
30 - forum_get_tracking_link
31 - forum_tp_count_discussion_unread_posts
32 - forum_convert_to_roles
33 - forum_tp_get_read_records
34 - forum_tp_get_discussion_read_records
36 - forum_user_can_view_post
41 - forum_subscribed_users
42 - forum_is_forcesubscribed
43 - forum_forcesubscribe
44 - forum_get_forcesubscribed
45 - forum_get_subscribed_forums
46 - forum_get_optional_subscribed_forums
47 - forum_get_potential_subscribers
48 * External functions that were returning file information now return the following file fields:
49 filename, filepath, mimetype, filesize, timemodified and fileurl.
50 Those fields are now marked as VALUE_OPTIONAL for backwards compatibility.
53 * The inteface to forum_get_email_message_id() has changed and no longer needs the $host argument.
56 * External function get_forums_by_courses now returns and additional field "cancreatediscussions" that indicates if the user
57 can create discussions in the forum.
58 * A new optional parameter (groupid) has been added to get_forum_discussions.
59 This parameter can override the automatically calculated current group.
60 * New constant FORUM_POSTS_ALL_USER_GROUPS, to be used as parameter in functions where we'd need to retrieve all the user posts.
63 * The following functions have all been marked as deprecated. Many of
64 these have not been supported in many releases and should not be relied
66 forum_count_unrated_posts
67 forum_tp_count_discussion_read_records
68 forum_get_user_discussions
69 forum_tp_count_forum_posts
70 forum_tp_count_forum_read_records
73 forum_get_discussion_posts
75 forum_get_tracking_link
76 forum_tp_count_discussion_unread_posts
77 forum_convert_to_roles
78 forum_tp_get_read_records
79 forum_tp_get_discussion_read_records
81 forum_user_can_view_post
82 * The following functions have been deprecated and replaced. Please see the phpdoc for each on the new function to use instead:
86 * forum_subscribed_users
87 * forum_is_forcesubscribed
88 * forum_forcesubscribe
89 * forum_get_forcesubscribed
90 * forum_get_subscribed_forums
91 * forum_get_optional_subscribed_forums
92 * forum_get_potential_subscribers
93 * External function mod_forum_external::get_forum_discussions has been deprecated.
94 Use mod_forum_external::get_forum_discussions_paginated instead.
98 * The file post_form.php should not be included, the class it contained has
99 been moved so that it can benefit from autoloading.
100 * The function forum_shorten_post() has been deprecated. It was doing a poor
101 job of shortening forum post text and the shorten_text() function does a
103 * The constant FORUM_TRACKING_ON has been deprecated and replaced by
104 FORUM_TRACKING_FORCED. The value between them is maintained, so they are
105 interchangeable, but code should migrate to the new name.
109 The function forum_check_throttling has been changed so that a warning object is returned when a user has reached the 'Post threshold for warning' or
110 'Post threshold for blocking' setting, rather than echoing this on screen. This allows the warning to be moved inside the post form as it can be added
111 as a HTML element, where it is more noticeable. False is returned if there is no need to warn, or restrict the user from posting - see MDL-39182.
115 * mod/forum:allowforcesubscribe capability will be forcefully assigned to frontpage role, as it was mistakenly missed off
116 when the capability was initially created. If you don't want users with frontpage role to get forum (with forcesubscribe) emails,
117 then please remove this capability for frontpage role.