This commit is contained in:
Huong Nguyen
2024-02-01 10:43:37 +07:00
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -652,7 +652,7 @@ abstract class handler {
}
$data->instance_form_definition($mform);
$field = $data->get_field()->to_record();
if (strlen($field->description)) {
if (strlen((string)$field->description)) {
// Add field description.
$context = $this->get_configuration_context();
$value = file_rewrite_pluginfile_urls($field->description, 'pluginfile.php',
+1 -1
View File
@@ -47,7 +47,7 @@ class plugin_test extends \advanced_testcase {
$this->cfields[1] = $this->get_generator()->create_field(
['categoryid' => $this->cfcat->get('id'), 'shortname' => 'myfield1', 'type' => 'text',
'configdata' => ['maxlength' => 30, 'displaysize' => 50]]);
'configdata' => ['maxlength' => 30, 'displaysize' => 50], 'description' => null]);
$this->cfields[2] = $this->get_generator()->create_field(
['categoryid' => $this->cfcat->get('id'), 'shortname' => 'myfield2', 'type' => 'text',
'configdata' => ['required' => 1, 'maxlength' => 30, 'displaysize' => 50]]);
+1 -1
View File
@@ -97,7 +97,7 @@ class core_customfield_generator extends component_generator_base {
if (!isset($record->shortname)) {
$record->shortname = "fld$i";
}
if (!isset($record->description)) {
if (!property_exists($record, 'description')) {
$record->description = "Field $i description";
}
if (!isset($record->descriptionformat)) {