MDL-45483 mod_forum: corrects values for maxattachments in forum settings

This commit is contained in:
Kevin Wiliarty
2014-05-12 00:00:18 -04:00
parent 92ac518fdc
commit 7d80ee4455
3 changed files with 35 additions and 2 deletions
+18
View File
@@ -112,5 +112,23 @@ function xmldb_forum_upgrade($oldversion) {
// Moodle v2.6.0 release upgrade line.
// Put any upgrade step following this.
if ($oldversion < 2013110501) {
// Incorrect values that need to be replaced.
$replacements = array(
11 => 20,
12 => 50,
13 => 100
);
// Run the replacements.
foreach ($replacements as $old => $new) {
$DB->set_field('forum', 'maxattachments', $new, array('maxattachments' => $old));
}
// Forum savepoint reached.
upgrade_mod_savepoint(true, 2013110501, 'forum');
}
return true;
}
+16 -1
View File
@@ -63,7 +63,22 @@ class mod_forum_mod_form extends moodleform_mod {
$mform->addHelpButton('maxbytes', 'maxattachmentsize', 'forum');
$mform->setDefault('maxbytes', $CFG->forum_maxbytes);
$choices = array(0,1,2,3,4,5,6,7,8,9,10,20,50,100);
$choices = array(
0 => 0,
1 => 1,
2 => 2,
3 => 3,
4 => 4,
5 => 5,
6 => 6,
7 => 7,
8 => 8,
9 => 9,
10 => 10,
20 => 20,
50 => 50,
100 => 100
);
$mform->addElement('select', 'maxattachments', get_string('maxattachments', 'forum'), $choices);
$mform->addHelpButton('maxattachments', 'maxattachments', 'forum');
$mform->setDefault('maxattachments', $CFG->forum_maxattachments);
+1 -1
View File
@@ -25,7 +25,7 @@
defined('MOODLE_INTERNAL') || die();
$module->version = 2013110500; // The current module version (Date: YYYYMMDDXX)
$module->version = 2013110501; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2013110500; // Requires this Moodle version
$module->component = 'mod_forum'; // Full name of the plugin (used for diagnostics)
$module->cron = 60;