mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-82481 reportbuilder: re-use existing method for field options.
This commit is contained in:
parent
fd487cd3f2
commit
c2d73d6e53
@ -237,12 +237,7 @@ class custom_fields {
|
||||
// Options are stored inside configdata json string and we need to convert it to array.
|
||||
if ($field->get('type') === 'select') {
|
||||
$filter->set_options_callback(static function() use ($field): array {
|
||||
$options = explode("\r\n", $field->get_configdata_property('options'));
|
||||
// Method set_options starts using array at index 1. we shift one position on this array.
|
||||
// In course settings this menu has an empty option and we need to respect that.
|
||||
array_unshift($options, " ");
|
||||
unset($options[0]);
|
||||
return $options;
|
||||
return $field->get_options();
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user