mirror of
https://github.com/moodle/moodle.git
synced 2025-05-01 22:18:03 +02:00
MDL-82488 customfield: allow for unescaped field formatted names.
Resolves double encoding of the same in Report builder editor.
This commit is contained in:
parent
072fb90384
commit
8c5d9819dc
8
.upgradenotes/MDL-82488-2024071608464009.yml
Normal file
8
.upgradenotes/MDL-82488-2024071608464009.yml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
issueNumber: MDL-82488
|
||||||
|
notes:
|
||||||
|
core_customfield:
|
||||||
|
- message: >
|
||||||
|
The field controller `get_formatted_name()` method now accepts an
|
||||||
|
optional `$escape` parameter to define whether to escape the returned
|
||||||
|
name
|
||||||
|
type: changed
|
@ -255,11 +255,15 @@ abstract class field_controller {
|
|||||||
/**
|
/**
|
||||||
* Returns the field name formatted according to configuration context.
|
* Returns the field name formatted according to configuration context.
|
||||||
*
|
*
|
||||||
|
* @param bool $escape
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function get_formatted_name(): string {
|
public function get_formatted_name(bool $escape = true): string {
|
||||||
$context = $this->get_handler()->get_configuration_context();
|
$context = $this->get_handler()->get_configuration_context();
|
||||||
return format_string($this->get('name'), true, ['context' => $context]);
|
return format_string($this->get('name'), true, [
|
||||||
|
'context' => $context,
|
||||||
|
'escape' => $escape,
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -140,7 +140,7 @@ class custom_fields {
|
|||||||
|
|
||||||
$columns[] = (new column(
|
$columns[] = (new column(
|
||||||
'customfield_' . $field->get('shortname'),
|
'customfield_' . $field->get('shortname'),
|
||||||
new lang_string('customfieldcolumn', 'core_reportbuilder', $field->get_formatted_name()),
|
new lang_string('customfieldcolumn', 'core_reportbuilder', $field->get_formatted_name(false)),
|
||||||
$this->entityname
|
$this->entityname
|
||||||
))
|
))
|
||||||
->add_joins($this->get_joins())
|
->add_joins($this->get_joins())
|
||||||
@ -251,7 +251,7 @@ class custom_fields {
|
|||||||
$filter = (new filter(
|
$filter = (new filter(
|
||||||
$this->get_filter_class_type($datacontroller),
|
$this->get_filter_class_type($datacontroller),
|
||||||
'customfield_' . $field->get('shortname'),
|
'customfield_' . $field->get('shortname'),
|
||||||
new lang_string('customfieldcolumn', 'core_reportbuilder', $field->get_formatted_name()),
|
new lang_string('customfieldcolumn', 'core_reportbuilder', $field->get_formatted_name(false)),
|
||||||
$this->entityname,
|
$this->entityname,
|
||||||
$customdatasql,
|
$customdatasql,
|
||||||
$customdataparams,
|
$customdataparams,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user