Skip to content

Commit

Permalink
MDL-59460 mod_forum: Ensure CFG->forum_subscription is set
Browse files Browse the repository at this point in the history
  • Loading branch information
dmonllao committed Jul 18, 2017
1 parent 58affdc commit 3f6e42b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion mod/forum/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -6813,7 +6813,7 @@ function forum_get_view_actions() {
*
* @return array
*/
function forum_get_subscriptionmode_opions() {
function forum_get_subscriptionmode_options() {
$options = array();
$options[FORUM_CHOOSESUBSCRIBE] = get_string('subscriptionoptional', 'forum');
$options[FORUM_FORCESUBSCRIBE] = get_string('subscriptionforced', 'forum');
Expand Down
9 changes: 7 additions & 2 deletions mod/forum/mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,15 @@ function definition() {
// Subscription and tracking.
$mform->addElement('header', 'subscriptionandtrackinghdr', get_string('subscriptionandtracking', 'forum'));

$options = forum_get_subscriptionmode_opions();
$options = forum_get_subscriptionmode_options();
$mform->addElement('select', 'forcesubscribe', get_string('subscriptionmode', 'forum'), $options);
$mform->addHelpButton('forcesubscribe', 'subscriptionmode', 'forum');
$mform->setDefault('forcesubscribe', $CFG->forum_subscription);
if (isset($CFG->forum_subscription)) {
$defaultforumsubscription = $CFG->forum_subscription;
} else {
$defaultforumsubscription = FORUM_CHOOSESUBSCRIBE;
}
$mform->setDefault('forcesubscribe', $defaultforumsubscription);

$options = array();
$options[FORUM_TRACKING_OPTIONAL] = get_string('trackingoptional', 'forum');
Expand Down
2 changes: 1 addition & 1 deletion mod/forum/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
get_string('configmaxattachments', 'forum'), 9, PARAM_INT));

// Default Subscription mode setting.
$options = forum_get_subscriptionmode_opions();
$options = forum_get_subscriptionmode_options();
$settings->add(new admin_setting_configselect('forum_subscription', get_string('subscriptionmode', 'forum'),
get_string('configsubscriptiontype', 'forum'), FORUM_CHOOSESUBSCRIBE, $options));

Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

defined('MOODLE_INTERNAL') || die();

$version = 2017071400.00; // YYYYMMDD = weekly release date of this DEV branch.
$version = 2017071400.01; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.

Expand Down

0 comments on commit 3f6e42b

Please sign in to comment.