Problem/Motivation
When the 'Default' formatter is selected, the title of the field is not aligned according to the 'Form Display' settings.
Thisis because the function sets ['#label_display'] hardcoded.
Steps to reproduce
- select 'Default' in 'Form display' with 'in line' label.
- display a node, the field label is not according to the settings.
Proposed resolution
Let the function not set the ['#label_display'], but set it afterwards if needed.
Core code will merge the hardcoded values with configured codes, but will not overwrite the hardcoded values.
Remaining tasks
User interface changes
API changes
In some cases, you need to set the title_display afterwards:
$widget = workflow_state_formatter($entity, $field_name);
$widget['#label_display'] = 'before'; // 'above', 'hidden'.
Comments
Comment #3
johnvThis was only a problem in WorkflowTransitionElement, and is now solved by replacing call to the workflow_state_formatter() with the following code: