Closed leonstr closed 6 months ago
Maybe a slightly better fix would be updating element/coursefield/classes/element.php with
:
141c141,144
< if (!empty($data[$field])) {
---
> if ($preview && empty($data[$field]->export_value())) {
> $fields = $handler->get_fields();
> $value = $fields[$field]->get_formatted_name();
> } else if (!empty($data[$field])) {
Replaced previous proposed change with one which shows the custom field's shortname instead of customfield_shortname. This is more consistent with the way "idnumber" is shown if course's ID number isn't populated.
Hope this is clear/didn't break anything/cause too much confusion.
Cherry-picked, thanks!
Proposed fix for #579. Would need applying to all supported branches, for example, both MOODLE_402_STABLE and MOODLE_401_STABLE.