Commit 569f65eb authored by andrei.dincu's avatar andrei.dincu

Issue #2249723 by andrei.dincu: Replace module_invoke_all() with...

Issue #2249723 by andrei.dincu: Replace module_invoke_all() with \Drupal::moduleHandler()->invokeAll() in xmlsitemap.module, xmlsitemap.admin.inc and xmlsitemap_engines.module
parent f08e740a
......@@ -14,7 +14,7 @@ function xmlsitemap_sitemap_list_form() {
$destination = drupal_get_destination();
// Build the 'Update options' form.
$form['#operations'] = module_invoke_all('xmlsitemap_sitemap_operations');
$form['#operations'] = \Drupal::moduleHandler()->invokeAll('xmlsitemap_sitemap_operations');
$operations = array();
foreach ($form['#operations'] as $operation => $operation_info) {
$operations[$operation] = $operation_info['label'];
......
......@@ -471,7 +471,7 @@ function xmlsitemap_sitemap_delete_multiple(array $smids) {
foreach ($sitemaps as $sitemap) {
xmlsitemap_clear_directory($sitemap, TRUE);
$sitemap->delete();
module_invoke_all('xmlsitemap_sitemap_delete', $sitemap);
\Drupal::moduleHandler()->invokeAll('xmlsitemap_sitemap_delete', $sitemap);
}
}
}
......@@ -519,7 +519,7 @@ function xmlsitemap_sitemap_get_context_hash(array &$context) {
*/
function xmlsitemap_sitemap_uri(XmlSitemapInterface $sitemap) {
$uri['path'] = 'sitemap.xml';
$uri['options'] = module_invoke_all('xmlsitemap_context_url_options', $sitemap->getContext());
$uri['options'] = \Drupal::moduleHandler()->invokeAll('xmlsitemap_context_url_options', $sitemap->getContext());
$context = $sitemap->getContext();
\Drupal::moduleHandler()->alter('xmlsitemap_context_url_options', $uri['options'], $context);
$uri['options'] += array(
......@@ -953,7 +953,7 @@ function xmlsitemap_get_link_info($type = NULL, $reset = FALSE) {
unset($entity_types[$key]);
unset($link_info[$key]);
}
$link_info = array_merge($link_info, module_invoke_all('xmlsitemap_link_info'));
$link_info = array_merge($link_info, \Drupal::moduleHandler()->invokeAll('xmlsitemap_link_info'));
foreach ($link_info as $key => &$info) {
$info += array(
'type' => $key,
......@@ -1444,7 +1444,7 @@ function xmlsitemap_get_context_info($context = NULL, $reset = FALSE) {
}
if (!isset($info)) {
$info = module_invoke_all('xmlsitemap_context_info');
$info = \Drupal::moduleHandler()->invokeAll('xmlsitemap_context_info');
drupal_alter('xmlsitemap_context_info', $info);
ksort($info);
// Cache by language since this info contains translated strings.
......@@ -1465,7 +1465,7 @@ function xmlsitemap_get_current_context() {
$context = &drupal_static(__FUNCTION__);
if (!isset($context)) {
$context = module_invoke_all('xmlsitemap_context');
$context = \Drupal::moduleHandler()->invokeAll('xmlsitemap_context');
drupal_alter('xmlsitemap_context', $context);
asort($context);
}
......
<?php
in<?php
use GuzzleHttp\Exception\RequestException;
......@@ -191,7 +191,7 @@ function xmlsitemap_engines_get_engine_info($engine = NULL) {
}
else {
// Fetch the results of all hook_xmlsitemap_engine_info() implementations.
$engines = module_invoke_all('xmlsitemap_engine_info');
$engines = \Drupal::moduleHandler()->invokeAll('xmlsitemap_engine_info');
// Allow other modulse to alter the engine info.
drupal_alter('xmlsitemap_engine_info', $engines);
// Cache by language since engine names are translated.
......
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