-
Bug
-
Resolution: Fixed
-
Minor
-
4.1.5, 4.2.2, 4.3
When a site is configured with a custom field for courses of type `text area` - and set to be unique - courses can no longer be edited.
With postgres, this results in:
Warning: Array to string conversion in customfield/classes/data_controller.php on line 228 |
array ( 0 => 1, 1 => array ( 'text' => 'testdata', 'format' => '1', 'itemid' => 659010097, ), 2 => 1, ) |
When using mysql/mariadb this causes a more fatal error:
Exception - mysqli::real_escape_string(): Argument #1 ($string) must be of type string, array given |
|
Stack trace:
|
line 1149 of /lib/dml/mysqli_native_moodle_database.php: TypeError thrown |
line 1149 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli->real_escape_string() |
line 1216 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->emulate_bound_params() |
line 2010 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_recordset_sql() |
line 1995 of /lib/dml/moodle_database.php: call to moodle_database->record_exists_sql() |
line 248 of /customfield/classes/data_controller.php: call to moodle_database->record_exists_select() |
line 263 of /customfield/classes/data_controller.php: call to core_customfield\data_controller->is_unique() |
line 612 of /customfield/classes/handler.php: call to core_customfield\data_controller->instance_form_validation() |
line 502 of /course/edit_form.php: call to core_customfield\handler->instance_form_validation() |
line 653 of /lib/formslib.php: call to course_edit_form->validation() |
line 589 of /lib/formslib.php: call to moodleform->validate_defined_fields() |
line 699 of /lib/formslib.php: call to moodleform->is_validated() |
line 163 of /course/edit.php: call to moodleform->get_data() |
- caused a regression
-
MDL-80865 Label printed for empty textarea course custom fields
- Closed