Commit 8f5d2d00 authored by andrei.dincu's avatar andrei.dincu

Issue #2249723 by andrei.dincu: Replace module_exists() and drupal_alter() with D8 code

parent 97dc5c68
......@@ -34,7 +34,6 @@ class XmlSitemapRobotsTxtIntegrationTest extends XmlSitemapTestBase {
public function testRobotsTxt() {
// Request the un-clean robots.txt path so this will work in case there is
// still the robots.txt file in the root directory.
//$this->drupalGet('', array('query' => array('q' => 'robots.txt')));
$this->drupalGet('/robots.txt');
$this->assertRaw('Sitemap: ' . url('sitemap.xml', array('absolute' => TRUE)));
}
......
......@@ -229,7 +229,7 @@ abstract class XmlSitemapTestBase extends WebTestBase {
protected function getWatchdogMessages(array $conditions = array(), $reset = FALSE) {
static $seen_ids = array();
if (!module_exists('dblog') || $reset) {
if (!\Drupal::moduleHandler()->moduleExists('dblog') || $reset) {
$seen_ids = array();
return array();
}
......
......@@ -34,7 +34,7 @@ class XmlSitemapLinkStorage {
);
// Allow other modules to alter the link before saving.
drupal_alter('xmlsitemap_link', $link);
\Drupal::moduleHandler()->alter('xmlsitemap_link', $link);
// Temporary validation checks.
// @todo Remove in final?
......
......@@ -595,7 +595,7 @@ function xmlsitemap_link_save(array $link) {
);
// Allow other modules to alter the link before saving.
drupal_alter('xmlsitemap_link', $link);
\Drupal::moduleHandler()->alter('xmlsitemap_link', $link);
// Temporary validation checks.
// @todo Remove in final?
......@@ -980,7 +980,6 @@ function xmlsitemap_get_link_info($type = NULL, $reset = FALSE) {
$bundle_info['xmlsitemap'] += xmlsitemap_link_bundle_load($key, $bundle, FALSE);
}
}
//drupal_alter('xmlsitemap_link_info', $link_info);
\Drupal::moduleHandler()->alter('xmlsitemap_link_info', $link_info);
ksort($link_info);
// Cache by language since this info contains translated strings.
......@@ -1632,7 +1631,7 @@ function xmlsitemap_get_current_context() {
if (!isset($context)) {
$context = \Drupal::moduleHandler()->invokeAll('xmlsitemap_context');
drupal_alter('xmlsitemap_context', $context);
\Drupal::moduleHandler()->alter('xmlsitemap_context', $context);
asort($context);
}
......
......@@ -193,7 +193,7 @@ function xmlsitemap_engines_get_engine_info($engine = NULL) {
// Fetch the results of all hook_xmlsitemap_engine_info() implementations.
$engines = \Drupal::moduleHandler()->invokeAll('xmlsitemap_engine_info');
// Allow other modulse to alter the engine info.
drupal_alter('xmlsitemap_engine_info', $engines);
\Drupal::moduleHandler()->alter('xmlsitemap_engine_info', $engines);
// Cache by language since engine names are translated.
\Drupal::cache()->set('xmlsitemap:engines:' . $language->getId(), $engines);
}
......
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