MDL-75497 mod_data: Review Check existence of field.class.php

This commit is contained in:
raortegar
2022-10-20 09:14:48 +02:00
parent f8d28e4ca6
commit bf5cd9cf98
8 changed files with 157 additions and 37 deletions
+11 -1
View File
@@ -850,7 +850,17 @@ class template {
$errors .= $renderer->notification($notification);
}
}
$replacements[] = $errors . $field->display_add_field($entryid, $entrydata);
$fielddisplay = '';
if ($field->type === 'unknown') {
if ($this->canmanageentries) { // Display notification for users that can manage entries.
$errors .= $renderer->notification(get_string('missingfieldtype', 'data',
(object)['name' => $field->field->name]));
}
} else {
$fielddisplay = $field->display_add_field($entryid, $entrydata);
}
$replacements[] = $errors . $fielddisplay;
}
// Replace the field id tag.