Fixed Language::getDefault() returning false and not null

This commit is contained in:
Matias Griese
2020-07-01 20:54:22 +03:00
parent e2f68194d7
commit b65d48541d
2 changed files with 2 additions and 1 deletions

View File

@@ -15,6 +15,7 @@
* Fixed broken `Flex Page` authorization for groups * Fixed broken `Flex Page` authorization for groups
* Fixed missing `onAdminSave` and `onAdminAfterSave` events when using `Flex Pages` and `Flex Users` [flex-objects#58](https://github.com/trilbymedia/grav-plugin-flex-objects/issues/58) * Fixed missing `onAdminSave` and `onAdminAfterSave` events when using `Flex Pages` and `Flex Users` [flex-objects#58](https://github.com/trilbymedia/grav-plugin-flex-objects/issues/58)
* Fixed new `User Group` allowing bad group name to be saved [admin#1917](https://github.com/getgrav/grav-plugin-admin/issues/1917) * Fixed new `User Group` allowing bad group name to be saved [admin#1917](https://github.com/getgrav/grav-plugin-admin/issues/1917)
* Fixed `Language::getDefault()` returning false and not null
# v1.7.0-rc.12 # v1.7.0-rc.12
## 06/08/2020 ## 06/08/2020

View File

@@ -67,7 +67,7 @@ class Language
if (isset($default) && $this->validate($default)) { if (isset($default) && $this->validate($default)) {
$this->default = $default; $this->default = $default;
} else { } else {
$this->default = reset($this->languages); $this->default = !empty($this->languages) ? reset($this->languages) : null;
} }
$this->resetFallbackPageExtensions(); $this->resetFallbackPageExtensions();