Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
simple_sitemap
Commits
8caa994d
Commit
8caa994d
authored
Feb 23, 2016
by
Pawel G
Browse files
Fixing reports/status page to display the correct sitemap status.
parent
1ea54b1d
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Form/SimplesitemapSettingsForm.php
View file @
8caa994d
...
...
@@ -104,13 +104,13 @@ class SimplesitemapSettingsForm extends ConfigFormBase {
$max_links
=
$form_state
->
getValue
(
'max_links'
);
if
(
$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'
);
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
."
));
}
}
...
...
src/Simplesitemap.php
View file @
8caa994d
...
...
@@ -233,9 +233,9 @@ class Simplesitemap {
* Formatted timestamp of last sitemap generation, otherwise FALSE.
*/
public
function
get_generated_ago
()
{
if
(
isset
(
$this
->
sitemap
[
0
]
->
sitemap_created
))
{
if
(
isset
(
$this
->
sitemap
[
1
]
->
sitemap_created
))
{
return
\
Drupal
::
service
(
'date.formatter'
)
->
formatInterval
(
REQUEST_TIME
-
$this
->
sitemap
[
0
]
->
sitemap_created
);
->
formatInterval
(
REQUEST_TIME
-
$this
->
sitemap
[
1
]
->
sitemap_created
);
}
return
FALSE
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment