Skip to content

Commit

Permalink
Fixed saving page in expert mode [#3174]
Browse files Browse the repository at this point in the history
  • Loading branch information
mahagr committed Jan 26, 2021
1 parent 0918419 commit 2a67b5b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion system/src/Grav/Framework/Flex/Pages/FlexPageObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ protected function filterElements(array &$elements, bool $extended = false): voi
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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,11 @@ public function raw($var = null): string
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();
Expand Down

0 comments on commit 2a67b5b

Please sign in to comment.