diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocalePathTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocalePathTest.php index a6fb1c5..77b27c8 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocalePathTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocalePathTest.php @@ -110,13 +110,13 @@ function testPathLanguageConfiguration() { 'alias' => $custom_path, 'langcode' => Language::LANGCODE_NOT_SPECIFIED, ); - drupal_container()->get('path.crud')->save($edit['source'], $edit['alias'], $edit['langcode']); - $lookup_path = drupal_container()->get('path.alias_manager')->getPathAlias('node/' . $node->nid, 'en'); + $this->container->get('path.crud')->save($edit['source'], $edit['alias'], $edit['langcode']); + $lookup_path = $this->container->get('path.alias_manager')->getPathAlias('node/' . $node->nid, 'en'); $this->assertEqual($english_path, $lookup_path, t('English language alias has priority.')); // Same check for language 'xx'. - $lookup_path = drupal_container()->get('path.alias_manager')->getPathAlias('node/' . $node->nid, $prefix); + $lookup_path = $this->container->get('path.alias_manager')->getPathAlias('node/' . $node->nid, $prefix); $this->assertEqual($custom_language_path, $lookup_path, t('Custom language alias has priority.')); - drupal_container()->get('path.crud')->delete($edit); + $this->container->get('path.crud')->delete($edit); // Create language nodes to check priority of aliases. $first_node = $this->drupalCreateNode(array('type' => 'page', 'promote' => 1)); @@ -128,7 +128,7 @@ function testPathLanguageConfiguration() { 'alias' => $custom_path, 'langcode' => 'en', ); - drupal_container()->get('path.crud')->save($edit['source'], $edit['alias'], $edit['langcode']); + $this->container->get('path.crud')->save($edit['source'], $edit['alias'], $edit['langcode']); // Assign a custom path alias to second node with Language::LANGCODE_NOT_SPECIFIED. $edit = array( @@ -136,7 +136,7 @@ function testPathLanguageConfiguration() { 'alias' => $custom_path, 'langcode' => Language::LANGCODE_NOT_SPECIFIED, ); - drupal_container()->get('path.crud')->save($edit['source'], $edit['alias'], $edit['langcode']); + $this->container->get('path.crud')->save($edit['source'], $edit['alias'], $edit['langcode']); // Test that both node titles link to our path alias. $this->drupalGet(''); diff --git a/core/modules/locale/locale.batch.inc b/core/modules/locale/locale.batch.inc index 3709406..227e85e 100644 --- a/core/modules/locale/locale.batch.inc +++ b/core/modules/locale/locale.batch.inc @@ -176,7 +176,7 @@ function locale_translation_batch_status_finished($success, $results) { $t = get_t(); if ($success) { if (isset($results['failed_files'])) { - if (module_exists('dblog')) { + if (Drupal::moduleHandler()->moduleExists('dblog')) { $message = format_plural(count($results['failed_files']), 'One translation file could not be checked. See the log for details.', '@count translation files could not be checked. See the log for details.', array('@url' => url('admin/reports/dblog'))); } else { diff --git a/core/modules/locale/locale.bulk.inc b/core/modules/locale/locale.bulk.inc index 1f90503..b480138 100644 --- a/core/modules/locale/locale.bulk.inc +++ b/core/modules/locale/locale.bulk.inc @@ -632,7 +632,7 @@ function locale_translate_batch_finished($success, $results) { watchdog('locale', 'Translations imported: %number added, %update updated, %delete removed.', array('%number' => $additions, '%update' => $updates, '%delete' => $deletes)); if ($skips) { - if (module_exists('dblog')) { + if (Drupal::moduleHandler()->moduleExists('dblog')) { $message = format_plural($skips, 'One translation string was skipped because of disallowed or malformed HTML. See the log for details.', '@count translation strings were skipped because of disallowed or malformed HTML. See the log for details.', array('@url' => url('admin/reports/dblog'))); } else { diff --git a/core/modules/locale/locale.compare.inc b/core/modules/locale/locale.compare.inc index 0c53ec3..ece52cf 100644 --- a/core/modules/locale/locale.compare.inc +++ b/core/modules/locale/locale.compare.inc @@ -46,7 +46,7 @@ function locale_translation_flush_projects() { */ function locale_translation_build_projects() { // This function depends on Update module. We degrade gracefully. - if (!module_exists('update')) { + if (!Drupal::moduleHandler()->moduleExists('update')) { return array(); } @@ -132,7 +132,7 @@ function locale_translation_build_projects() { */ function locale_translation_project_list() { // This function depends on Update module. We degrade gracefully. - if (!module_exists('update')) { + if (!Drupal::moduleHandler()->moduleExists('update')) { return array(); } diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module index 821f40b..90be5b5 100644 --- a/core/modules/locale/locale.module +++ b/core/modules/locale/locale.module @@ -379,7 +379,7 @@ function locale($string = NULL, $context = NULL, $langcode = NULL) { // cannot be unloaded, this is typically the case in the environment that // is executing a test. if (!isset($locale_exists)) { - $locale_exists = function_exists('module_exists') && module_exists('locale'); + $locale_exists = Drupal::moduleHandler()->moduleExists('locale'); } if (!$locale_exists) { return $string; diff --git a/core/modules/locale/locale.translation.inc b/core/modules/locale/locale.translation.inc index 7d58315..99a8559 100644 --- a/core/modules/locale/locale.translation.inc +++ b/core/modules/locale/locale.translation.inc @@ -58,7 +58,7 @@ function locale_translation_get_projects($project_names = array()) { // http://drupal.org/node/1777106 is a follow-up issue to make the check for // possible out-of-date project information more robust. - if ($result->rowCount() == 0 && module_exists('update')) { + if ($result->rowCount() == 0 && Drupal::moduleHandler()->moduleExists('update')) { module_load_include('compare.inc', 'locale'); // At least the core project should be in the database, so we build the // data if none are found.