mirror of
https://github.com/moodle/moodle.git
synced 2025-04-12 20:12:15 +02:00
Merge branch 'MDL-61224_master' of git://github.com/markn86/moodle
This commit is contained in:
commit
b0bb30e2e7
@ -103,6 +103,8 @@ class core_role_define_role_table_advanced extends core_role_capability_table_wi
|
||||
$this->role->shortname = core_text::strtolower(clean_param($this->role->shortname, PARAM_ALPHANUMEXT));
|
||||
if (empty($this->role->shortname)) {
|
||||
$this->errors['shortname'] = get_string('errorbadroleshortname', 'core_role');
|
||||
} else if (core_text::strlen($this->role->shortname) > 100) { // Check if it exceeds the max of 100 characters.
|
||||
$this->errors['shortname'] = get_string('errorroleshortnametoolong', 'core_role');
|
||||
}
|
||||
}
|
||||
if ($DB->record_exists_select('role', 'shortname = ? and id <> ?', array($this->role->shortname, $this->roleid))) {
|
||||
@ -496,7 +498,7 @@ class core_role_define_role_table_advanced extends core_role_capability_table_wi
|
||||
}
|
||||
|
||||
protected function get_shortname_field($id) {
|
||||
return '<input type="text" id="' . $id . '" name="' . $id . '" maxlength="254" value="' . s($this->role->shortname) . '"' .
|
||||
return '<input type="text" id="' . $id . '" name="' . $id . '" maxlength="100" value="' . s($this->role->shortname) . '"' .
|
||||
' class="form-control"/>';
|
||||
}
|
||||
|
||||
|
@ -218,6 +218,7 @@ $string['errorbadrolename'] = 'Incorrect role name';
|
||||
$string['errorbadroleshortname'] = 'Incorrect role short name';
|
||||
$string['errorexistsrolename'] = 'Role name already exists';
|
||||
$string['errorexistsroleshortname'] = 'Role name already exists';
|
||||
$string['errorroleshortnametoolong'] = 'The short name must not exceed 100 characters';
|
||||
$string['eventroleallowassignupdated'] = 'Allow role assignment';
|
||||
$string['eventroleallowoverrideupdated'] = 'Allow role override';
|
||||
$string['eventroleallowswitchupdated'] = 'Allow role switch';
|
||||
|
Loading…
x
Reference in New Issue
Block a user