mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-32112 horrible hack that ignores invalid size for XMLDB_TYPE_NUMBER in numerical question type
The easies fix could be to use VARCHAR instead because this field is used only for reading and writing, no selects on this field it seems.
This commit is contained in:
parent
d3232735ee
commit
7fd31fe86c
@ -726,8 +726,13 @@ class xmldb_field extends xmldb_object {
|
||||
break;
|
||||
|
||||
case XMLDB_TYPE_NUMBER:
|
||||
$maxlength = 20;
|
||||
if ($xmldb_table->getName() === 'question_numerical_units' and $name === 'multiplier') {
|
||||
//TODO: remove after MDL-32113 is resolved
|
||||
$maxlength = 40;
|
||||
}
|
||||
$length = $this->getLength();
|
||||
if (!is_number($length) or $length <= 0 or $length > 20) {
|
||||
if (!is_number($length) or $length <= 0 or $length > $maxlength) {
|
||||
return 'Invalid field definition in table {'.$xmldb_table->getName(). '}: XMLDB_TYPE_NUMBER field "'.$this->getName().'" has invalid length';
|
||||
}
|
||||
$decimals = $this->getDecimals();
|
||||
|
Loading…
x
Reference in New Issue
Block a user