Merge branch 'master_MDL-69848' of https://github.com/golenkovm/moodle
[moodle.git] / mod / forum / upgrade.txt
CommitLineData
afd5e85c
RT
1This files describes API changes in /mod/forum/*,
2information provided here is intended especially for developers.
3
c0375ba7
AA
4=== 3.8 ===
5
6* The following functions have been finally deprecated and can not be used anymore:
7 * forum_scale_used()
d21d6baa
MH
8* In order for the forum summary report to calculate word count and character count data, those details are now stored
9 for each post in the database when posts are created or updated. For posts that existed prior to a Moodle 3.8 upgrade, these
10 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
11 default, by setting $CFG->forumpostcountchunksize to the required integer value.
c0375ba7 12
f30f46db
RW
13=== 3.7 ===
14 * Changed the forum discussion rendering to use templates rather than print functions.
15 * Added new forum entities, factories, exporters, renderers, and vaults in the local namespace to better encapsulate the forum data.
16 * Deprecated all of the forum_print_* functions in lib.php.
a79c2c92 17 * The forum_print_latest_discussions function has been deprecated and will not be replaced.
bc4c7337 18 * The get_forum_discussion_posts web service has been deprecated in favour of get_discussion_posts.
15dc885a
AN
19 * The forum_count_replies function has been deprecated in favour of get_reply_count_for_post_id_in_discussion_id in
20 the Post vault.
ff3c8c0e 21 * 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.
6c344ff2 22 * External function get_forum_discussion_posts now returns an additional field "tags" returning the post tags.
1a9c60e9
MG
23 * New external function mod_forum_external::get_forum_discussions returns a list of forum discussions optionally sorted and paginated.
24 * External function mod_forum_external::get_forum_discussions_paginated has been deprecated.
25 Use mod_forum_external::get_forum_discussions instead.
117e4bd4 26 * 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.
f30f46db 27
2015327b 28=== 3.6 ===
bc4c7337 29
2015327b
DW
30 * 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.
31
b7ce46df
JL
32=== 3.4 ===
33 * External function get_forum_discussion_posts now returns an additional field "ratinginfo" containing rating information.
34
4669389d
PFO
35=== 3.3 ===
36 * External function get_forums_by_courses now returns and additional field "istracked" that indicates if the user
37 is tracking the related forum.
581e75bf 38 * The legacy forum.js file has been removed, this includes the js functions:
56882be6
DP
39 forum_produce_subscribe_link, forum_produce_tracking_link, lockoptions_timetoitems,
40 lockoptions_timefromitems, lockoptions, lockoption, unlockoption
581e75bf
JL
41 * External function can_add_discussion now returns two additional fields:
42 "canpindiscussions" that indicates if the user can add pinned discussions.
43 "cancreateattachment" that indicates if the user can add attachments to the discussion.
4669389d 44
d16185fd 45=== 3.2 ===
9715f61a 46 * The setting $CFG->forum_replytouser has been removed in favour of a centralized noreplyaddress setting.
253ae230 47 Please use $CFG->noreplyaddress setting instead.
d16185fd
AN
48 * The following functions have been finally deprecated and should no longer be used.
49 - forum_count_unrated_posts
50 - forum_tp_count_discussion_read_records
51 - forum_get_user_discussions
52 - forum_tp_count_forum_posts
53 - forum_tp_count_forum_read_records
54 - forum_get_open_modes
55 - forum_get_child_posts
56 - forum_get_discussion_posts
57 - forum_get_ratings
58 - forum_get_tracking_link
59 - forum_tp_count_discussion_unread_posts
60 - forum_convert_to_roles
61 - forum_tp_get_read_records
62 - forum_tp_get_discussion_read_records
63 - forum_user_enrolled
64 - forum_user_can_view_post
65 - forum_shorten_post
66 - forum_is_subscribed
67 - forum_subscribe
68 - forum_unsubscribe
69 - forum_subscribed_users
70 - forum_is_forcesubscribed
71 - forum_forcesubscribe
72 - forum_get_forcesubscribed
73 - forum_get_subscribed_forums
74 - forum_get_optional_subscribed_forums
75 - forum_get_potential_subscribers
14590070
JL
76 * External functions that were returning file information now return the following file fields:
77 filename, filepath, mimetype, filesize, timemodified and fileurl.
78 Those fields are now marked as VALUE_OPTIONAL for backwards compatibility.
d16185fd 79
54dceeed
BH
80=== 3.1 ===
81 * The inteface to forum_get_email_message_id() has changed and no longer needs the $host argument.
82
ea5b910b
JL
83=== 3.0 ===
84 * External function get_forums_by_courses now returns and additional field "cancreatediscussions" that indicates if the user
85 can create discussions in the forum.
4f3a2d21
JL
86 * A new optional parameter (groupid) has been added to get_forum_discussions.
87 This parameter can override the automatically calculated current group.
88 * New constant FORUM_POSTS_ALL_USER_GROUPS, to be used as parameter in functions where we'd need to retrieve all the user posts.
ea5b910b 89
39de876c
AN
90=== 2.8 ===
91 * The following functions have all been marked as deprecated. Many of
df7a4d65 92 these have not been supported in many releases and should not be relied
39de876c
AN
93 upon:
94 forum_count_unrated_posts
95 forum_tp_count_discussion_read_records
96 forum_get_user_discussions
97 forum_tp_count_forum_posts
98 forum_tp_count_forum_read_records
99 forum_get_open_modes
100 forum_get_child_posts
101 forum_get_discussion_posts
102 forum_get_ratings
103 forum_get_tracking_link
104 forum_tp_count_discussion_unread_posts
105 forum_convert_to_roles
106 forum_tp_get_read_records
107 forum_tp_get_discussion_read_records
108 forum_user_enrolled
109 forum_user_can_view_post
59075a43
AN
110 * The following functions have been deprecated and replaced. Please see the phpdoc for each on the new function to use instead:
111 * forum_is_subscribed
112 * forum_subscribe
113 * forum_unsubscribe
114 * forum_subscribed_users
115 * forum_is_forcesubscribed
116 * forum_forcesubscribe
117 * forum_get_forcesubscribed
118 * forum_get_subscribed_forums
119 * forum_get_optional_subscribed_forums
120 * forum_get_potential_subscribers
b235aef0
JL
121 * External function mod_forum_external::get_forum_discussions has been deprecated.
122 Use mod_forum_external::get_forum_discussions_paginated instead.
39de876c 123
2ecd2847
FM
124=== 2.6 ===
125
126* The file post_form.php should not be included, the class it contained has
127 been moved so that it can benefit from autoloading.
02d10ca0
MR
128* The function forum_shorten_post() has been deprecated. It was doing a poor
129 job of shortening forum post text and the shorten_text() function does a
130 much better job.
90b735b1 131* The constant FORUM_TRACKING_ON has been deprecated and replaced by
bd8f5d45
EM
132 FORUM_TRACKING_FORCED. The value between them is maintained, so they are
133 interchangeable, but code should migrate to the new name.
2ecd2847 134
f5ad424b
MN
135=== 2.5 ===
136
137The 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
138'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
139as 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.
afd5e85c
RT
140
141=== 2.3.5, 2.4.2 ===
f5ad424b 142
afd5e85c
RT
143* mod/forum:allowforcesubscribe capability will be forcefully assigned to frontpage role, as it was mistakenly missed off
144when the capability was initially created. If you don't want users with frontpage role to get forum (with forcesubscribe) emails,
2ecd2847 145then please remove this capability for frontpage role.