Skip to content

Commit

Permalink
Merge branch 'MDL-80706' of https://github.com/marinaglancy/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
HuongNV13 committed Feb 1, 2024
2 parents 3606eba + 610f4a5 commit c35f04c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion customfield/classes/handler.php
Expand Up @@ -652,7 +652,7 @@ public function instance_form_definition(\MoodleQuickForm $mform, int $instancei
}
$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',
Expand Down
2 changes: 1 addition & 1 deletion customfield/field/text/tests/plugin_test.php
Expand Up @@ -47,7 +47,7 @@ public function setUp(): void {

$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]]);
Expand Down
2 changes: 1 addition & 1 deletion customfield/tests/generator/lib.php
Expand Up @@ -97,7 +97,7 @@ public function create_field($record) : field_controller {
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)) {
Expand Down

0 comments on commit c35f04c

Please sign in to comment.