Commit d4e33c0e authored by gbyte.co's avatar gbyte.co

Improve submission check

parent 8534366d
...@@ -152,14 +152,18 @@ class SimplesitemapEnginesForm extends ConfigFormBase { ...@@ -152,14 +152,18 @@ class SimplesitemapEnginesForm extends ConfigFormBase {
$engine->save(); $engine->save();
} }
if (empty($submit)) {
$this->messenger()->addWarning($this->t('No sitemap variants have been selected for submission.'));
}
$config = $this->config('simple_sitemap_engines.settings'); $config = $this->config('simple_sitemap_engines.settings');
$config->set('enabled', $form_state->getValue(['settings', 'enabled']));
$enabled = (bool) $form_state->getValue(['settings', 'enabled']);
$config->set('enabled', $enabled);
$config->set('submission_interval', $form_state->getValue(['settings', 'submission_interval'])); $config->set('submission_interval', $form_state->getValue(['settings', 'submission_interval']));
$config->save(); $config->save();
if ($enabled && empty($submit)) {
$this->messenger()->addWarning($this->t('No sitemap variants have been selected for submission.'));
}
parent::submitForm($form, $form_state);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment