Commit 8caa994d authored by gbyte.co's avatar gbyte.co

Fixing reports/status page to display the correct sitemap status.

parent 1ea54b1d
...@@ -104,13 +104,13 @@ class SimplesitemapSettingsForm extends ConfigFormBase { ...@@ -104,13 +104,13 @@ class SimplesitemapSettingsForm extends ConfigFormBase {
$max_links = $form_state->getValue('max_links'); $max_links = $form_state->getValue('max_links');
if ($max_links != '') { if ($max_links != '') {
if (!is_numeric($max_links) || $max_links < 1 || $max_links != round($max_links)) { if (!is_numeric($max_links) || $max_links < 1 || $max_links != round($max_links)) {
$form_state->setErrorByName('', t("The value of the max links field must be a positive integer greater than 1.")); $form_state->setErrorByName('', t("The value of the max links field must be a positive integer greater than 0."));
} }
} }
$batch_process_limit = $form_state->getValue('batch_process_limit'); $batch_process_limit = $form_state->getValue('batch_process_limit');
if (!is_numeric($batch_process_limit) || $batch_process_limit < 1 || $batch_process_limit != round($batch_process_limit)) { if (!is_numeric($batch_process_limit) || $batch_process_limit < 1 || $batch_process_limit != round($batch_process_limit)) {
$form_state->setErrorByName('', t("The value of the batch refresh rate field must be a positive integer greater than 1.")); $form_state->setErrorByName('', t("The value of the batch refresh rate field must be a positive integer greater than 0."));
} }
} }
......
...@@ -233,9 +233,9 @@ class Simplesitemap { ...@@ -233,9 +233,9 @@ class Simplesitemap {
* Formatted timestamp of last sitemap generation, otherwise FALSE. * Formatted timestamp of last sitemap generation, otherwise FALSE.
*/ */
public function get_generated_ago() { public function get_generated_ago() {
if (isset($this->sitemap[0]->sitemap_created)) { if (isset($this->sitemap[1]->sitemap_created)) {
return \Drupal::service('date.formatter') return \Drupal::service('date.formatter')
->formatInterval(REQUEST_TIME - $this->sitemap[0]->sitemap_created); ->formatInterval(REQUEST_TIME - $this->sitemap[1]->sitemap_created);
} }
return FALSE; return FALSE;
} }
......
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