mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 04:52:36 +02:00
MDL-77180 customfield: allow entry of formatted category names.
Change the param type of the category name when editing to allow for entry of multilang tags, the formatting of which is already supported when returning category name. Co-authored-by: Hiroto Kagotani <hiroto.kagotani@gmail.com>
This commit is contained in:
parent
ef93325f27
commit
20280c0405
@ -254,7 +254,7 @@ class api {
|
||||
$category->get_formatted_name(),
|
||||
$category->get('name'),
|
||||
get_string('editcategoryname', 'core_customfield'),
|
||||
get_string('newvaluefor', 'core_form', format_string($category->get('name')))
|
||||
get_string('newvaluefor', 'core_form', $category->get_formatted_name())
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -638,7 +638,7 @@ abstract class handler {
|
||||
foreach ($fieldswithdata as $data) {
|
||||
$categoryid = $data->get_field()->get_category()->get('id');
|
||||
if ($categoryid != $lastcategoryid) {
|
||||
$categoryname = format_string($data->get_field()->get_category()->get('name'));
|
||||
$categoryname = $data->get_field()->get_category()->get_formatted_name();
|
||||
|
||||
// Load category header lang string if specified.
|
||||
if (!empty($headerlangidentifier)) {
|
||||
|
@ -42,7 +42,7 @@ function core_customfield_inplace_editable($itemtype, $itemid, $newvalue) {
|
||||
if (!$handler->can_configure()) {
|
||||
throw new moodle_exception('nopermissionconfigure', 'core_customfield');
|
||||
}
|
||||
$newvalue = clean_param($newvalue, PARAM_NOTAGS);
|
||||
$newvalue = clean_param($newvalue, PARAM_TEXT);
|
||||
$handler->rename_category($category, $newvalue);
|
||||
return \core_customfield\api::get_category_inplace_editable($category, true);
|
||||
}
|
||||
|
@ -1,6 +1,10 @@
|
||||
This files describes API changes in /customfield/*,
|
||||
Information provided here is intended especially for developers.
|
||||
|
||||
=== 4.3 ===
|
||||
* Field categories are now consistently of type `PARAM_TEXT`, ensure instance `get_formatted_name()` helper is used
|
||||
during output
|
||||
|
||||
=== 4.2 ===
|
||||
* The `\customfield_select\field_controller::get_options_array` method, deprecated since 3.10, has been removed, use
|
||||
the field instance `get_options` method instead
|
||||
|
Loading…
x
Reference in New Issue
Block a user