Skip to content
Snippets Groups Projects
Commit 5c2e0fe6 authored by catch's avatar catch
Browse files

Issue #3068067 by alexpott: Properly deprecate...

Issue #3068067 by alexpott: Properly deprecate language_negotiation_url_prefixes() and language_negotiation_url_domains()
parent 5a27c272
No related branches found
No related tags found
No related merge requests found
......@@ -98,7 +98,7 @@ public function testCommentLanguage() {
$this->drupalPostForm("node/add/article", $edit, t('Save'));
$node = $this->drupalGetNodeByTitle($title);
$prefixes = language_negotiation_url_prefixes();
$prefixes = $this->config('language.negotiation')->get('url.prefixes');
foreach ($this->container->get('language_manager')->getLanguages() as $langcode => $language) {
// Post a comment with content language $langcode.
$prefix = empty($prefixes[$langcode]) ? '' : $prefixes[$langcode] . '/';
......
......@@ -270,12 +270,13 @@ function language_get_default_langcode($entity_type, $bundle) {
/**
* Reads language prefixes and uses the langcode if no prefix is set.
*
* @deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0.
* Use \Drupal::config('language.negotiation')->get('url.prefixes') instead.
* @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use
* \Drupal::config('language.negotiation')->get('url.prefixes') instead.
*
* @see https://www.drupal.org/node/2912748
*/
function language_negotiation_url_prefixes() {
@trigger_error("language_negotiation_url_prefixes() is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal::config('language.negotiation')->get('url.prefixes') instead. See https://www.drupal.org/node/2912748", E_USER_DEPRECATED);
return \Drupal::config('language.negotiation')->get('url.prefixes');
}
......@@ -301,12 +302,13 @@ function language_negotiation_url_prefixes_update() {
/**
* Reads language domains.
*
* @deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0.
* Use \Drupal::config('language.negotiation')->get('url.domains') instead.
* @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use
* \Drupal::config('language.negotiation')->get('url.domains') instead.
*
* @see https://www.drupal.org/node/2912748
*/
function language_negotiation_url_domains() {
@trigger_error("language_negotiation_url_domains() is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal::config('language.negotiation')->get('url.domains') instead. See https://www.drupal.org/node/2912748", E_USER_DEPRECATED);
return \Drupal::config('language.negotiation')->get('url.domains');
}
......
......@@ -88,7 +88,7 @@ private function checkUrl(LanguageInterface $language, $message1, $message2) {
// If the rewritten URL has not a language prefix we pick a random prefix so
// we can always check the prefixed URL.
$prefixes = language_negotiation_url_prefixes();
$prefixes = $this->config('language.negotiation')->get('url.prefixes');
$stored_prefix = isset($prefixes[$language->getId()]) ? $prefixes[$language->getId()] : $this->randomMachineName();
$this->assertNotEqual($stored_prefix, $prefix, $message1);
$prefix = $stored_prefix;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment