public function WebformElementBase::validateConfigurationForm in Webform 8.5
Same name and namespace in other branches
- 6.x src/Plugin/WebformElementBase.php \Drupal\webform\Plugin\WebformElementBase::validateConfigurationForm()
Form validation handler.
Parameters
array $form: An associative array containing the structure of the plugin form as built by static::buildConfigurationForm().
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form. Calling code should pass on a subform state created through \Drupal\Core\Form\SubformState::createForSubform().
Overrides PluginFormInterface::validateConfigurationForm
5 calls to WebformElementBase::validateConfigurationForm()
- Address::validateConfigurationForm in src/
Plugin/ WebformElement/ Address.php - Form validation handler.
- DateBase::validateConfigurationForm in src/
Plugin/ WebformElement/ DateBase.php - Form validation handler.
- NumericBase::validateConfigurationForm in src/
Plugin/ WebformElement/ NumericBase.php - Form validation handler.
- TextBase::validateConfigurationForm in src/
Plugin/ WebformElement/ TextBase.php - Form validation handler.
- TextFormat::validateConfigurationForm in src/
Plugin/ WebformElement/ TextFormat.php - Form validation handler.
6 methods override WebformElementBase::validateConfigurationForm()
- Address::validateConfigurationForm in src/
Plugin/ WebformElement/ Address.php - Form validation handler.
- DateBase::validateConfigurationForm in src/
Plugin/ WebformElement/ DateBase.php - Form validation handler.
- NumericBase::validateConfigurationForm in src/
Plugin/ WebformElement/ NumericBase.php - Form validation handler.
- TextBase::validateConfigurationForm in src/
Plugin/ WebformElement/ TextBase.php - Form validation handler.
- TextFormat::validateConfigurationForm in src/
Plugin/ WebformElement/ TextFormat.php - Form validation handler.
File
- src/
Plugin/ WebformElementBase.php, line 3669
Class
- WebformElementBase
- Provides a base class for a webform element.
Namespace
Drupal\webform\PluginCode
public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
$properties = $this
->getConfigurationFormProperties($form, $form_state);
$ignored_properties = WebformElementHelper::getIgnoredProperties($properties);
foreach ($ignored_properties as $ignored_property => $ignored_message) {
// Display custom messages.
if ($ignored_property !== $ignored_message) {
unset($ignored_properties[$ignored_property]);
$form_state
->setErrorByName('custom', $ignored_message);
}
}
// Display ignored properties message.
if ($ignored_properties) {
$t_args = [
'@properties' => WebformArrayHelper::toString($ignored_properties),
];
$form_state
->setErrorByName('custom', $this
->t('Element contains ignored/unsupported properties: @properties', $t_args));
}
}