Here is the code in question:
// Add a new field to a specific group
$data_type = trim($_POST['newdatatype']);
$max_length = $data_type == 3 ? 3 : 255;
$listval = $data_type == 34 ? trim($_POST['contextName']) : trim($_POST['newlistid']);
sqlStatement("INSERT INTO layout_options (" .
" form_id, source, field_id, title, group_id, seq, uor, fld_length, fld_rows" .
", titlecols, datacols, data_type, edit_options, default_value, codes, description" .
", max_length, list_id, list_backup_id " .
") VALUES ( " .
"'" . add_escape_custom(trim($_POST['layout_id'])) . "'" .
",'" . add_escape_custom(trim($_POST['newsource'])) . "'" .
",'" . add_escape_custom(trim($_POST['newid'])) . "'" .
",'" . add_escape_custom($_POST['newtitle']) . "'" .
",'" . add_escape_custom(trim($_POST['newfieldgroupid'])) . "'" .
",'" . add_escape_custom(trim($_POST['newseq'])) . "'" .
",'" . add_escape_custom(trim($_POST['newuor'])) . "'" .
",'" . add_escape_custom(trim($_POST['newlengthWidth'])) . "'" .
",'" . add_escape_custom(trim($_POST['newlengthHeight'])) . "'" .
",'" . add_escape_custom(trim($_POST['newtitlecols'])) . "'" .
",'" . add_escape_custom(trim($_POST['newdatacols'])) . "'" .
",'" . add_escape_custom($data_type) . "'" .
",'" . add_escape_custom(encodeModifier($_POST['newedit_options'] ?? null)) . "'" .
",'" . add_escape_custom(trim($_POST['newdefault'])) . "'" .
",'" . add_escape_custom(trim($_POST['newcodes'])) . "'" .
",'" . add_escape_custom(trim($_POST['newdesc'])) . "'" .
",'" . add_escape_custom(trim($_POST['newmaxSize'])) . "'" .
",'" . add_escape_custom($listval) . "'" .
",'" . add_escape_custom(trim($_POST['newbackuplistid'])) . "'" .
" )");
Obviously, the form fields are filled out. But after clicking Save New Field, something is getting lost to cause the value that was attempted to be inserted to be an empty string ''
.
VALUES ( 'DEM','','','','','','','','','','','','','','','','','','' )
The system is running 6.1.0(1), but looking at the github, I do not see any difference in the current code.