From 972d32c969825d65f559dbcdcba892ed881b807a Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Fri, 16 Oct 2020 12:29:37 +0300 Subject: [PATCH] Added deprecation notice when using system.pages_fallback_only --- system/config/system.yaml | 2 +- system/src/Grav/Common/Language/Language.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/system/config/system.yaml b/system/config/system.yaml index 32bc095a1..56f0a2e07 100644 --- a/system/config/system.yaml +++ b/system/config/system.yaml @@ -21,13 +21,13 @@ languages: default_lang: # Default is the first supported language. Must be one of the supported languages include_default_lang: true # Include the default lang prefix in all URLs include_default_lang_file_extension: true # If true, include language code for the default language in file extension: default.en.md - pages_fallback_only: false # Only fallback to find page content through supported languages translations: true # If false, translation keys are used instead of translated strings translations_fallback: true # Fallback through supported translations if active lang doesn't exist session_store_active: false # Store active language in session 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 content_fallback: {} # Custom language fallbacks. eg: {fr: ['fr', 'en']} + pages_fallback_only: false # DEPRECATED: Use `content_fallback` instead home: alias: '/home' # Default path for home, ie / diff --git a/system/src/Grav/Common/Language/Language.php b/system/src/Grav/Common/Language/Language.php index b839031be..49b1105c7 100644 --- a/system/src/Grav/Common/Language/Language.php +++ b/system/src/Grav/Common/Language/Language.php @@ -414,6 +414,8 @@ class Language $fallback_languages = []; if (null === $fallback && $this->config->get('system.languages.pages_fallback_only', false)) { + user_error('Configuration option `system.languages.pages_fallback_only` is deprecated since Grav 1.7, use `system.languages.content_fallback` instead', E_USER_DEPRECATED); + // Special fallback list returns itself and all the previous items in reverse order: // active: 'v2', languages: ['v1', 'v2', 'v3', 'v4'] => ['v2', 'v1', ''] if ($includeDefault) {