diff --git a/src/Form/ConfigureMultilingualForm.php b/src/Form/ConfigureMultilingualForm.php index 7abb6837883e3ead2f7799477d33c22fc1a9af2a..f6373b62613bce5c694fd592e164668928961215 100644 --- a/src/Form/ConfigureMultilingualForm.php +++ b/src/Form/ConfigureMultilingualForm.php @@ -152,12 +152,27 @@ class ConfigureMultilingualForm extends FormBase { * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { + // Get the value of enable multilingual checkbox. $enable_multilingual = $form_state->getValue('enable_multilingual'); - $GLOBALS['install_state']['varbase']['enable_multilingual'] = $enable_multilingual; + if (isset($enable_multilingual) + && $enable_multilingual == TRUE) { + $GLOBALS['install_state']['varbase']['enable_multilingual'] = TRUE; + } + else { + $GLOBALS['install_state']['varbase']['enable_multilingual'] = FALSE; + } + // Get list of selected multilingual languages. $multilingual_languages = $form_state->getValue('multilingual_languages'); - $multilingual_languages = array_filter($multilingual_languages); + if (isset($multilingual_languages) + && count($multilingual_languages) > 0) { + $multilingual_languages = array_filter($multilingual_languages); + } + else { + $multilingual_languages = []; + } $GLOBALS['install_state']['varbase']['multilingual_languages'] = $multilingual_languages; + } }