Problem/Motivation
A Warning is thrown when the translation is enabled for a config form and one of the form elements key contains the string "title" or "label"
Steps to reproduce
- Create a custom config form with the following element :
$form['section_title'] = [ '#type' => 'text_format', '#title' => 'Section Title', '#allowed_formats' => ['title_html'], '#format' => 'title_html', '#description' => $this->t('Enter the title here.'), '#description_display' => 'before', '#default_value' => $config->get("section_title")['value'] ?? '', '#required' => TRUE, ];
- Add Schema file for the same
mapping: section_title: type: text_format label: 'Section Title'
- Now try to submit the translation form you'll see the warning above the form elements
Proposed resolution
Add a check if "#markup" exists in the source of the element before assigning to title.