Commit 03761aae authored by gbyte.co's avatar gbyte.co

Fix division by 0 on batch generate when queue empty

parent 7a33d48b
......@@ -173,7 +173,7 @@ class SimplesitemapSettingsForm extends SimplesitemapFormBase {
$form['simple_sitemap_settings']['advanced']['remove_duplicates'] = [
'#type' => 'checkbox',
'#title' => $this->t('Exclude duplicate links'),
'#description' => $this->t('Uncheck this to significantly speed up the sitemap generation process on a huge site (more than 20 000 indexed entities).'),
'#description' => $this->t('Prevent per-sitemap variant duplicate links.<br/>Uncheck this to significantly speed up the sitemap generation process on a huge site (more than 20 000 indexed entities).'),
'#default_value' => $this->generator->getSetting('remove_duplicates', TRUE),
];
......
......@@ -71,7 +71,7 @@ trait BatchTrait {
$context['message'] = t('@indexed out of @total total items have been processed.', [
'@indexed' => $processed_element_count, '@total' => $original_element_count]);
$context['finished'] = $processed_element_count / $original_element_count;
$context['finished'] = $original_element_count > 0 ? ($processed_element_count / $original_element_count) : 1;
}
/**
......
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