Fixed Flex Pages using only default language in frontend

This commit is contained in:
Matias Griese 2021-02-05 15:19:47 +02:00
parent 25f8b787b6
commit 830fa40bb7
2 changed files with 7 additions and 0 deletions

View File

@ -7,6 +7,7 @@
1. [](#bugfix)
* Fixed CLI progressbar in `backup` and `security` commands to use styled output [#3198](https://github.com/getgrav/grav/issues/3198)
* Fixed page save failing because of uploaded images [#3191](https://github.com/getgrav/grav/issues/3191)
* Fixed `Flex Pages` using only default language in frontend [#106](https://github.com/trilbymedia/grav-plugin-flex-objects/issues/106)
# v1.7.5
## 02/01/2021

View File

@ -759,6 +759,12 @@ class Pages
$instance = $this->index[$path] ?? null;
if (is_string($instance)) {
/** @var Language $language */
$language = $this->grav['language'];
$lang = $language->getActive();
if ($lang) {
$instance .= ':' . $lang;
}
$instance = $this->directory ? $this->directory->getObject($instance, 'flex_key') : null;
if ($instance) {
if ($this->fire_events && method_exists($instance, 'initialize')) {