Fixed default data bug in menu type.
}
function save_data_preprocess($data) {
+
if (!isset($this->options[$data])) { /// validate_data should already have caught this
return '';
} else {
function edit_validate_specific($data) {
$err = array();
-
+
+ $data->param1 = str_replace("\r", '', $data->param1);
+
/// Check that we have at least 2 options
if (($options = explode("\n", $data->param1)) === false) {
$err['param1'] = get_string('profilemenunooptions', 'admin');
}
return $err;
}
+
+ function edit_save_preprocess($data) {
+ $data->param1 = str_replace("\r", '', $data->param1);
+
+ return $data;
+ }
+
}
?>
} else {
if ($id == 0) {
- $strheading = get_string('profilecreatenewfield', 'admin');
+ $strheading = get_string('profilecreatenewfield', 'admin', $datatypes[$type]);
} else {
$strheading = get_string('profileeditfield', 'admin', $field->name);
}
$choices[2] = get_string('profilevisibleall', 'admin');
$form->addElement('select', 'visible', get_string('profilevisible', 'admin'), $choices);
$form->setType('visible', PARAM_INT);
+ $form->setDefault('visible', 2);
+ $form->setHelpButton('visible', array('profilevisible', get_string('profilevisible','admin')));
unset($choices);
$choices = profile_list_categories();