Skip to content

Commit

Permalink
Merge branch 'wip-MDL-45483-MOODLE_26_STABLE' of https://github.com/k…
Browse files Browse the repository at this point in the history
…wiliarty/moodle into MOODLE_26_STABLE
  • Loading branch information
marinaglancy committed May 19, 2014
2 parents 9d14dcd + 7d80ee4 commit 709f701
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
18 changes: 18 additions & 0 deletions mod/forum/db/upgrade.php
Expand Up @@ -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;
}
17 changes: 16 additions & 1 deletion mod/forum/mod_form.php
Expand Up @@ -63,7 +63,22 @@ function definition() {
$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);
Expand Down
2 changes: 1 addition & 1 deletion mod/forum/version.php
Expand Up @@ -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;

0 comments on commit 709f701

Please sign in to comment.