Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onAdminSave original page has empty header #3259

Closed
Karmalakas opened this issue Mar 7, 2021 · 3 comments
Closed

onAdminSave original page has empty header #3259

Karmalakas opened this issue Mar 7, 2021 · 3 comments
Assignees

Comments

@Karmalakas
Copy link
Contributor

In plugin's onAdminSave i need a header version of a page before save. dump($page->getOriginal()->header()) gives me:

^ Grav\Common\Page\Header {#566 ▼
  #items: []
  #nestedSeparator: "."
}

toArray() returns []. Trying to get items also ends up empty.

Also noticed, that $page->getOriginal() all flexDirectory objects also have empty headers.
Tried to comment out two lines where unset($data['header']); happens in system/src/Grav/Common/Flex/Types/Pages/PageObject.php:229, but no luck

Frontmatter before save looks like:

title: 'Title'
body_classes: 'title-center title-h1h2'
content:
    items: '@self.modular'
visible: false
aura:
    metadata: {}
    pagetype: website
    description: 'Description'
metadata:
    'og:url': 'http://playground.local/test/'
    'og:type': website
    'article:author': 'Author'

Might be related to #3098

@mahagr
Copy link
Member

mahagr commented Mar 15, 2021

@Karmalakas
Copy link
Contributor Author

Karmalakas commented Mar 15, 2021

Needs also trilbymedia/grav-plugin-flex-objects@19ac508

I'm a bit confused :) Did the fix get to v1.0.3 of Flex Objects which was released 02/17/2021 (according to changes in changelog)? Or will it be released with v1.0.4 after all?

@rhukster
Copy link
Member

released both

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants