Fixed saving page in expert mode [#3174]

This commit is contained in:
Matias Griese
2021-01-26 11:08:43 +02:00
parent 0918419191
commit 2a67b5b827
3 changed files with 8 additions and 3 deletions

View File

@@ -7,6 +7,8 @@
* Fixed `bin/gpm uninstall` script not working because of bad typehint [#3172](https://github.com/getgrav/grav/issues/3172)
* Fixed `login: visibility_requires_access` not working in pages [#3176](https://github.com/getgrav/grav/issues/3176)
* Fixed cannot change image format [#3173](https://github.com/getgrav/grav/issues/3173)
* Fixed saving page in expert mode [#3174](https://github.com/getgrav/grav/issues/3174)
* Fixed exception in `$flexPage->frontmatter()` method when setting value
# v1.7.3
## 01/21/2021

View File

@@ -396,7 +396,7 @@ class FlexPageObject extends FlexObject implements PageInterface, FlexTranslateI
unset($elements['content']);
}
// RAW frontmatter support.
// TODO: Remove: RAW frontmatter support has been moved to Flex-Objects v1.0.2 controller.
if (isset($elements['frontmatter'])) {
$formatter = new YamlFormatter();
try {

View File

@@ -92,8 +92,11 @@ trait PageLegacyTrait
public function frontmatter($var = null): string
{
if (null !== $var) {
// TODO:
throw new RuntimeException(__METHOD__ . '(string): Not Implemented');
$formatter = new YamlFormatter();
$this->setProperty('frontmatter', $var);
$this->setProperty('header', $formatter->decode($var));
return $var;
}
$storage = $this->getFlexDirectory()->getStorage();