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

Implement lastmod for custom links that are entities

parent d4a92f8c
......@@ -259,7 +259,7 @@ class Batch {
// Load entity object if this is an entity route.
$route_parameters = $url_object->getRouteParameters();
$entity = !empty(key($route_parameters))
$entity = !empty($route_parameters)
? \Drupal::entityTypeManager()->getStorage(key($route_parameters))->load($route_parameters[key($route_parameters)])
: NULL;
......@@ -283,6 +283,7 @@ class Batch {
$context['results']['generate'][] = [
'path' => $path,
'urls' => $urls,
'lastmod' => method_exists($entity, 'getChangedTime') ? date_iso8601($entity->getChangedTime()) : NULL,
'priority' => isset($custom_path['priority']) ? $custom_path['priority'] : NULL,
];
}
......
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