Merge branch 'MDL-32543-26' of https://github.com/danielneis/moodle into MOODLE_26_STABLE

This commit is contained in:
Damyon Wiese
2014-05-19 12:55:31 +08:00
2 changed files with 30 additions and 1 deletions
+29
View File
@@ -2955,5 +2955,34 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2013111802.10);
}
// MDL-32543 Make sure that the log table has correct length for action and url fields.
if ($oldversion < 2013111803.01) {
$table = new xmldb_table('log');
$columns = $DB->get_columns('log');
if ($columns['action']->max_length < 40) {
$index1 = new xmldb_index('course-module-action', XMLDB_INDEX_NOTUNIQUE, array('course', 'module', 'action'));
if ($dbman->index_exists($table, $index1)) {
$dbman->drop_index($table, $index1);
}
$index2 = new xmldb_index('action', XMLDB_INDEX_NOTUNIQUE, array('action'));
if ($dbman->index_exists($table, $index2)) {
$dbman->drop_index($table, $index2);
}
$field = new xmldb_field('action', XMLDB_TYPE_CHAR, '40', null, XMLDB_NOTNULL, null, null, 'cmid');
$dbman->change_field_precision($table, $field);
$dbman->add_index($table, $index1);
$dbman->add_index($table, $index2);
}
if ($columns['url']->max_length < 100) {
$field = new xmldb_field('url', XMLDB_TYPE_CHAR, '100', null, XMLDB_NOTNULL, null, null, 'action');
$dbman->change_field_precision($table, $field);
}
upgrade_main_savepoint(true, 2013111803.01);
}
return true;
}
+1 -1
View File
@@ -1350,7 +1350,7 @@ class html_writer {
if (empty($attributes['id'])) {
$attributes['id'] = self::random_id('ts_');
}
$timerselector = self::select($timeunits, $name, $currentdate[$userdatetype], null, array('id'=>$attributes['id']));
$timerselector = self::select($timeunits, $name, $currentdate[$userdatetype], null, $attributes);
$label = self::tag('label', get_string(substr($type, 0, -1), 'form'), array('for'=>$attributes['id'], 'class'=>'accesshide'));
return $label.$timerselector;