- Issue created by @steven jones
- Status changed to Closed: won't fix
10 months ago 2:18pm 27 January 2024 - πΊπΈUnited States jrockowitz Brooklyn, NY
New features should be handled in a dedicated contribute module or custom code.
- π¬π§United Kingdom steven jones
@jrockowitz oh, that's news to me! Is webform no longer being enhanced then? Is it bug fixes only?
Would you accept a patch that provides this extension to webforms currently closed messaging functionality at all? (I'm fairly happy to write one!)
- π¬π§United Kingdom altcom_neil
Hi, we have had exactly the same problem with the closed message having the wrong message type 'status' instead of 'type'.
Attached is patch that adds a config "Message Type overrides" in the Webforms: Advanced configuration > User interface settings.
$form['ui']['message_types'] = [ '#type' => 'webform_codemirror', '#mode' => 'yaml', '#title' => $this->t('Message Type overrides'), '#description' => $this->t('Override the message types from their default values in code. Use Yaml, one per line e.g. <code>form_close_message: warning
'),
'#default_value' => $config->get('ui.message_types'),
];
In Drupal\webform\WebformMessageManager::apply Drupal\webform\WebformMessageManager::display the config is then retrieved and allows you to replace the hardcoded message type:
$webform_message_types = Yaml::decode($this->configFactory->get('webform.settings')->get('ui.message_types') ?: '') ?: []; if (!empty($webform_message_types[$key])) { $type = $webform_message_types[$key]; }