MDL-80827 tool_xmldb: Fixed xmldb editor broken with PHP 8.1

This commit is contained in:
Stevani Andolo
2024-02-27 12:21:35 +08:00
parent 5fff172a6e
commit b60d42e92a
@@ -91,12 +91,12 @@ class edit_field_save extends XMLDBAction {
$comment = trim($comment);
$type = required_param('type', PARAM_INT);
$length = strtolower(optional_param('length', NULL, PARAM_ALPHANUM));
$length = optional_param('length', null, PARAM_INT);
$decimals = optional_param('decimals', NULL, PARAM_INT);
$notnull = optional_param('notnull', false, PARAM_BOOL);
$sequence = optional_param('sequence', false, PARAM_BOOL);
$default = optional_param('default', NULL, PARAM_PATH);
$default = trim($default);
$default = is_null($default) ? $default : trim($default);
$editeddir = $XMLDB->editeddirs[$dirpath];
$structure = $editeddir->xml_file->getStructure();