Skip to content
Snippets Groups Projects
Commit e43de870 authored by John Voskuilen's avatar John Voskuilen
Browse files

Issue #3508157: New transition - Labels for field_name

parent 410474a7
No related branches found
No related tags found
No related merge requests found
Pipeline #441934 passed with warnings
......@@ -178,7 +178,7 @@ function workflow_access_node_access_records(NodeInterface $node) {
$grants = [];
// Only relevant for content with Workflow.
if (!$workflow_field_names = workflow_allowed_field_names($node, $node->getEntityTypeId())) {
if (!$workflow_field_names = workflow_allowed_field_names($node)) {
return $grants;
}
......
......@@ -415,8 +415,10 @@ function workflow_allowed_field_names(?EntityInterface $entity = NULL, $entity_t
$result = [];
foreach (_workflow_info_fields($entity, $entity_type, $entity_bundle, $field_name) as $definition) {
$field_name = $definition->getName();
// @todo Return field label, not name.
$result[$field_name] = $field_name;
$label = $entity
? $entity->{$field_name}->getFieldDefinition()->getLabel()
: $field_name;
$result[$field_name] = $label;
}
return $result;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment