Merge branch 'MDL-80706' of https://github.com/marinaglancy/moodle
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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]]);
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user