MDL-79705 reportbuilder: remove checkbox field callback handling.
We no longer need special handling of this field type, because it now returns language strings rather than HTML markup for a checkbox element on display.
This commit is contained in:
@@ -180,9 +180,8 @@ class user_profile_fields {
|
||||
->set_type($columntype)
|
||||
->set_is_sortable($columntype !== column::TYPE_LONGTEXT)
|
||||
->add_callback(static function($value, stdClass $row, profile_field_base $field): string {
|
||||
// Special handling of checkboxes, we want to display their boolean state rather than the input element itself.
|
||||
if (is_a($field, 'profile_field_checkbox')) {
|
||||
return format::boolean_as_text($value);
|
||||
if ($value === null) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$field->data = $value;
|
||||
|
||||
@@ -240,7 +240,7 @@ class user_profile_fields_test extends core_reportbuilder_testcase {
|
||||
[
|
||||
'c0_firstname' => 'Admin',
|
||||
'c1_data' => '',
|
||||
'c2_data' => 'Not set',
|
||||
'c2_data' => '',
|
||||
'c3_data' => '',
|
||||
'c4_data' => '',
|
||||
'c5_data' => '',
|
||||
|
||||
Reference in New Issue
Block a user