upgrade.txt 9.23 KB
Newer Older
1
2
3
This files describes API changes in /mod/forum/*,
information provided here is intended especially for developers.

4
5
6
7
8
9
=== 4.1 ===

* The following code, previously used (exclusively) by upgrade steps is not available anymore
  because of the upgrade cleanup performed for this version. See MDL-71747 for more info:
    - \mod_forum\task\refresh_forum_post_counts adhoc task.

10
11
12
=== 4.0 ===

* The forum_count_replies() function has been removed from core.
13
* The mod_forum_get_forum_discussion_posts web service has been removed from core.
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
* Final deprecations of the following functions:
    * forum_make_mail_text
    * forum_make_mail_html
    * forum_make_mail_post
    * forum_cron_minimise_user_record
    * forum_cron
    * forum_print_discussion
    * forum_post_nesting_cache
    * forum_should_start_post_nesting
    * forum_should_end_post_nesting
    * forum_print_post_start
    * forum_print_post_end
    * forum_print_post
    * forum_print_posts_flat
    * forum_print_posts_threaded
    * forum_print_posts_nested
    * forum_print_latest_discussions
    * forum_get_user_grades
32
33
* The method forum_update_subscriptions_button() has been deprecated as it is no longer used.
  The 'Manage subscribers' button has been replaced with tertiary navigation.
34

35
36
=== 3.11 ===

37
* The get_forum_discussions_paginated web service has been deprecated in favour of get_forum_discussions.
38
39
40
41
42
43
* The forum post exporter now includes a "timemodified" field for each post, which is included in several WS methods:
    * mod_forum_get_discussion_posts
    * get_discussion_posts_by_userid
    * get_discussion_post
    * add_discussion_post

44
45
46
47
48
49
=== 3.10 ===

* Changes in external function mod_forum_external::get_discussion_posts_by_userid
  Now returns the posts of a given user checking the current user capabilities ($USER, the user who is requesting the posts).
  Previously, it returned the posts checking the capabilities of the user that created the posts.

50
51
52
53
=== 3.8 ===

* The following functions have been finally deprecated and can not be used anymore:
    * forum_scale_used()
54
55
56
57
* In order for the forum summary report to calculate word count and character count data, those details are now stored
    for each post in the database when posts are created or updated. For posts that existed prior to a Moodle 3.8 upgrade, these
    are calculated by the refresh_forum_post_counts ad-hoc task in chunks of 5000 posts by default. Site admins are able to modify this
    default, by setting $CFG->forumpostcountchunksize to the required integer value.
58

59
60
61
62
=== 3.7 ===
  * Changed the forum discussion rendering to use templates rather than print functions.
  * Added new forum entities, factories, exporters, renderers, and vaults in the local namespace to better encapsulate the forum data.
  * Deprecated all of the forum_print_* functions in lib.php.
63
  * The forum_print_latest_discussions function has been deprecated and will not be replaced.
64
  * The get_forum_discussion_posts web service has been deprecated in favour of get_discussion_posts.
65
66
  * The forum_count_replies function has been deprecated in favour of get_reply_count_for_post_id_in_discussion_id in
    the Post vault.
67
  * External function get_forums_by_courses now returns two additional fields "duedate" and "cutoffdate" containing the due date and the cutoff date for posting to the forums respectively.
68
  * External function get_forum_discussion_posts now returns an additional field "tags" returning the post tags.
69
70
  * New external function mod_forum_external::get_forum_discussions returns a list of forum discussions optionally sorted and paginated.
    Use mod_forum_external::get_forum_discussions instead.
71
  * External function mod_forum_external::add_discussion_post() has a new 'messageformat' param to be able to handle other formats different from FORMAT_HTML (that continues being the default one). Also a new 'topreferredformat' option enables the automatic conversion between any format and the preferred format (given the editor preference) before contents are saved.
72

Damyon Wiese's avatar
Damyon Wiese committed
73
=== 3.6 ===
74

Damyon Wiese's avatar
Damyon Wiese committed
75
76
  * forum_print_post should be surrounded with calls to forum_print_post_start and forum_print_post_end to create the proper HTML structure for the post.

77
78
79
=== 3.4 ===
  * External function get_forum_discussion_posts now returns an additional field "ratinginfo" containing rating information.

80
81
82
=== 3.3 ===
  * External function get_forums_by_courses now returns and additional field "istracked" that indicates if the user
   is tracking the related forum.
83
  * The legacy forum.js file has been removed, this includes the js functions:
84
85
    forum_produce_subscribe_link, forum_produce_tracking_link, lockoptions_timetoitems,
    lockoptions_timefromitems, lockoptions, lockoption, unlockoption
86
87
88
  * External function can_add_discussion now returns two additional fields:
   "canpindiscussions" that indicates if the user can add pinned discussions.
   "cancreateattachment" that indicates if the user can add attachments to the discussion.
89

90
=== 3.2 ===
91
 * The setting $CFG->forum_replytouser has been removed in favour of a centralized noreplyaddress setting.
92
   Please use $CFG->noreplyaddress setting instead.
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
 * The following functions have been finally deprecated and should no longer be used.
  - forum_count_unrated_posts
  - forum_tp_count_discussion_read_records
  - forum_get_user_discussions
  - forum_tp_count_forum_posts
  - forum_tp_count_forum_read_records
  - forum_get_open_modes
  - forum_get_child_posts
  - forum_get_discussion_posts
  - forum_get_ratings
  - forum_get_tracking_link
  - forum_tp_count_discussion_unread_posts
  - forum_convert_to_roles
  - forum_tp_get_read_records
  - forum_tp_get_discussion_read_records
  - forum_user_enrolled
  - forum_user_can_view_post
  - forum_shorten_post
  - forum_is_subscribed
  - forum_subscribe
  - forum_unsubscribe
  - forum_subscribed_users
  - forum_is_forcesubscribed
  - forum_forcesubscribe
  - forum_get_forcesubscribed
  - forum_get_subscribed_forums
  - forum_get_optional_subscribed_forums
  - forum_get_potential_subscribers
121
122
123
 * External functions that were returning file information now return the following file fields:
   filename, filepath, mimetype, filesize, timemodified and fileurl.
   Those fields are now marked as VALUE_OPTIONAL for backwards compatibility.
124

125
126
127
=== 3.1 ===
 * The inteface to forum_get_email_message_id() has changed and no longer needs the $host argument.

128
129
130
=== 3.0 ===
 * External function get_forums_by_courses now returns and additional field "cancreatediscussions" that indicates if the user
   can create discussions in the forum.
131
132
133
 * A new optional parameter (groupid) has been added to get_forum_discussions.
   This parameter can override the automatically calculated current group.
 * New constant FORUM_POSTS_ALL_USER_GROUPS, to be used as parameter in functions where we'd need to retrieve all the user posts.
134

135
136
=== 2.8 ===
 * The following functions have all been marked as deprecated. Many of
137
   these have not been supported in many releases and should not be relied
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
   upon:
     forum_count_unrated_posts
     forum_tp_count_discussion_read_records
     forum_get_user_discussions
     forum_tp_count_forum_posts
     forum_tp_count_forum_read_records
     forum_get_open_modes
     forum_get_child_posts
     forum_get_discussion_posts
     forum_get_ratings
     forum_get_tracking_link
     forum_tp_count_discussion_unread_posts
     forum_convert_to_roles
     forum_tp_get_read_records
     forum_tp_get_discussion_read_records
     forum_user_enrolled
     forum_user_can_view_post
155
156
157
158
159
160
161
162
163
164
165
 * The following functions have been deprecated and replaced. Please see the phpdoc for each on the new function to use instead:
   * forum_is_subscribed
   * forum_subscribe
   * forum_unsubscribe
   * forum_subscribed_users
   * forum_is_forcesubscribed
   * forum_forcesubscribe
   * forum_get_forcesubscribed
   * forum_get_subscribed_forums
   * forum_get_optional_subscribed_forums
   * forum_get_potential_subscribers
166
167
 * External function mod_forum_external::get_forum_discussions has been deprecated.
   Use mod_forum_external::get_forum_discussions_paginated instead.
168

169
170
171
172
=== 2.6 ===

* The file post_form.php should not be included, the class it contained has
  been moved so that it can benefit from autoloading.
173
174
175
* The function forum_shorten_post() has been deprecated. It was doing a poor
  job of shortening forum post text and the shorten_text() function does a
  much better job.
176
* The constant FORUM_TRACKING_ON has been deprecated and replaced by
177
178
  FORUM_TRACKING_FORCED. The value between them is maintained, so they are
  interchangeable, but code should migrate to the new name.
179

180
181
182
183
184
=== 2.5 ===

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
'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
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.
185
186

=== 2.3.5, 2.4.2 ===
187

188
189
* mod/forum:allowforcesubscribe capability will be forcefully assigned to frontpage role, as it was mistakenly missed off
when the capability was initially created. If you don't want users with frontpage role to get forum (with forcesubscribe) emails,
190
then please remove this capability for frontpage role.