Unverified Commit 898b1d76 authored by Dave Reid's avatar Dave Reid Committed by Dave Reid
Browse files

Issue #2956643 by Rade, Dave Reid: Fixed xmlsitemap_requirements()...

Issue #2956643 by Rade, Dave Reid: Fixed xmlsitemap_requirements() LogicException: Render context is empty, because render() was called outside of a renderRoot() or renderPlain() call.
parent ce9808d0
...@@ -25,14 +25,15 @@ function xmlsitemap_requirements($phase) { ...@@ -25,14 +25,15 @@ function xmlsitemap_requirements($phase) {
$missing_extensions = array_diff($required_extensions, array_filter($required_extensions, 'extension_loaded')); $missing_extensions = array_diff($required_extensions, array_filter($required_extensions, 'extension_loaded'));
if (!empty($missing_extensions)) { if (!empty($missing_extensions)) {
$items = ['#type' => 'item_list', 'items' => $missing_extensions]; $items = ['#theme' => 'item_list', '#items' => $missing_extensions];
$requirements['xmlsitemap_php_extensions'] = [ $requirements['xmlsitemap_php_extensions'] = [
'title' => $t('XML sitemap PHP extensions'), 'title' => $t('XML sitemap PHP extensions'),
'value' => $t('Disabled'), 'value' => $t('Disabled'),
'severity' => REQUIREMENT_ERROR, 'severity' => REQUIREMENT_ERROR,
'description' => $t("The XML sitemap module requires you to enable the PHP extensions in the following list (see the <a href=\"@xmlsitemap_requirements\">module's system requirements page</a> for more information):", [ 'description' => $t("The XML sitemap module requires you to enable the PHP extensions in the following list (see the <a href=\"@xmlsitemap_requirements\">module's system requirements page</a> for more information): @extensions", [
'@xmlsitemap_requirements' => 'https://www.drupal.org/documentation/modules/xmlsitemap/requirements', '@xmlsitemap_requirements' => 'https://www.drupal.org/documentation/modules/xmlsitemap/requirements',
]) . \Drupal::service('renderer')->render($items), '@extensions' => \Drupal::service('renderer')->renderPlain($items),
]),
]; ];
} }
...@@ -69,7 +70,7 @@ function xmlsitemap_requirements($phase) { ...@@ -69,7 +70,7 @@ function xmlsitemap_requirements($phase) {
$items = ['#theme' => 'item_list', '#items' => array_keys($directories)]; $items = ['#theme' => 'item_list', '#items' => array_keys($directories)];
$requirements['xmlsitemap_directory']['value'] = $t('Not found or not writable'); $requirements['xmlsitemap_directory']['value'] = $t('Not found or not writable');
$requirements['xmlsitemap_directory']['severity'] = REQUIREMENT_ERROR; $requirements['xmlsitemap_directory']['severity'] = REQUIREMENT_ERROR;
$requirements['xmlsitemap_directory']['description'] = $t('The following directories were not found or are not writable by the server. See <a href="@docpage">@docpage</a> for more information. @directories', ['@directories' => \Drupal::service('renderer')->render($items), '@docpage' => 'https://www.drupal.org/node/244924']); $requirements['xmlsitemap_directory']['description'] = $t('The following directories were not found or are not writable by the server. See <a href="@docpage">@docpage</a> for more information. @directories', ['@directories' => \Drupal::service('renderer')->renderPlain($items), '@docpage' => 'https://www.drupal.org/node/244924']);
} }
} }
$sitemaps = xmlsitemap_sitemap_load_multiple(); $sitemaps = xmlsitemap_sitemap_load_multiple();
......
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