From 7ad9996cc37a833f75fa655082a1b735d634d1ff Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Tue, 13 Oct 2015 16:53:52 -0600 Subject: [PATCH] Removed home_redirect settings (conflict with new include_default_lang setting) --- system/blueprints/config/system.yaml | 22 ---------------------- system/config/system.yaml | 3 --- system/src/Grav/Common/Uri.php | 11 ----------- 3 files changed, 36 deletions(-) diff --git a/system/blueprints/config/system.yaml b/system/blueprints/config/system.yaml index 0a4171871..8dca2b5d2 100644 --- a/system/blueprints/config/system.yaml +++ b/system/blueprints/config/system.yaml @@ -243,28 +243,6 @@ form: validate: type: bool - languages.home_redirect.include_lang: - type: toggle - label: PLUGIN_ADMIN.HOME_REDIRECT_INCLUDE_LANGUAGE - help: PLUGIN_ADMIN.HOME_REDIRECT_INCLUDE_LANGUAGE_HELP - highlight: 1 - options: - 1: PLUGIN_ADMIN.YES - 0: PLUGIN_ADMIN.NO - validate: - type: bool - - languages.home_redirect.include_route: - type: toggle - label: PLUGIN_ADMIN.HOME_REDIRECT_INCLUDE_ROUTE - help: PLUGIN_ADMIN.HOME_REDIRECT_INCLUDE_ROUTE_HELP - highlight: 0 - options: - 1: PLUGIN_ADMIN.YES - 0: PLUGIN_ADMIN.NO - validate: - type: bool - languages.http_accept_language: type: toggle label: PLUGIN_ADMIN.HTTP_ACCEPT_LANGUAGE diff --git a/system/config/system.yaml b/system/config/system.yaml index 827f47cc1..9730b2623 100644 --- a/system/config/system.yaml +++ b/system/config/system.yaml @@ -9,9 +9,6 @@ languages: translations: true # Enable translations by default translations_fallback: true # Fallback through supported translations if active lang doesn't exist session_store_active: false # Store active language in session - home_redirect: - include_lang: true # Include language in home redirect (/en) - include_route: false # Include route in home redirect (/blog) http_accept_language: false # Attempt to set the language based on http_accept_language header in the browser override_locale: false # Override the default or system locale with language specific one diff --git a/system/src/Grav/Common/Uri.php b/system/src/Grav/Common/Uri.php index 6338dd0b8..eef36a178 100644 --- a/system/src/Grav/Common/Uri.php +++ b/system/src/Grav/Common/Uri.php @@ -110,17 +110,6 @@ class Uri // set active language $uri = $language->setActiveFromUri($uri); - // redirect to language specific homepage if configured to do so - if ($uri == '/' && $language->enabled()) { - if ($config->get('system.languages.home_redirect.include_route', true)) { - $prefix = $config->get('system.languages.home_redirect.include_lang', true) ? $language->getLanguage() . '/' : ''; - $grav->redirect($prefix . Pages::getHomeRoute()); - } elseif ($config->get('system.languages.home_redirect.include_lang', true)) { - $grav->redirect($language->getLanguage() . '/'); - } - } - - // split the URL and params $bits = parse_url($uri);