Problem/Motivation
Subissue of #2952037: Add constraints to all simple configuration
Open question:
How do we do apply non validation logic in validate? Example:
// Check for empty front page path.
if ($form_state->isValueEmpty('site_frontpage')) {
// Set to default "user/login".
$form_state->setValueForElement($form['front_page']['site_frontpage'], '/user/login');
}
else {
// Get the normal path of the front page.
$form_state->setValueForElement($form['front_page']['site_frontpage'], $this->aliasManager->getPathByAlias($form_state->getValue('site_frontpage')));
}
// Get the normal paths of both error pages.
if (!$form_state->isValueEmpty('site_403')) {
$form_state->setValueForElement($form['error_page']['site_403'], $this->aliasManager->getPathByAlias($form_state->getValue('site_403')));
}
if (!$form_state->isValueEmpty('site_404')) {
$form_state->setValueForElement($form['error_page']['site_404'], $this->aliasManager->getPathByAlias($form_state->getValue('site_404')));
}