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

Post meta not saved if attributes not included in block JS #7425

Closed
LABCAT opened this issue Jun 21, 2018 · 4 comments
Closed

Post meta not saved if attributes not included in block JS #7425

LABCAT opened this issue Jun 21, 2018 · 4 comments
Labels
[Feature] Block API API that allows to express the block paradigm. Needs Testing Needs further testing to be confirmed. [Type] Question Questions about the design or development of the editor.

Comments

@LABCAT
Copy link

LABCAT commented Jun 21, 2018

Not sure if this is a bug or if this expected behaviour but I think the post_meta should save if the attributes have been registered in PHP (and not in JS).

To Reproduce
Steps to reproduce the behavior:

  1. Register a dynamic block with php containing at least one meta attribute (making sure post type supports rest and meta has been registered)
  2. Create the required JS with no attributes
  3. Create new post enter
  4. Save post

Expected behavior
Post meta is saved/updated

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • windows 10
  • chrome
  • 67

Additional context

  • Gutenberg version 3.0.1.

If I include the following in my block JS the meta value gets saved but if this is only included in PHP it does not:
attributes: { myMeta: { type: 'string', source: 'meta', meta: 'my_meta' } },

@mtias mtias added [Type] Question Questions about the design or development of the editor. [Feature] Block API API that allows to express the block paradigm. labels Jul 19, 2018
@youknowriad youknowriad added the Needs Testing Needs further testing to be confirmed. label Feb 8, 2019
@youknowriad
Copy link
Contributor

Is this still the case? I don't see why it wouldn't work.

@noisysocks
Copy link
Member

This issue was raised in a #core-editor triage session.

@LABCAT: Are you still running into this issue? If so, could you please provide some sample code which demonstrates the issue so that it's easier for testers to verify the bug report?

@LABCAT
Copy link
Author

LABCAT commented Jan 23, 2020

@noisysocks that was a very long time ago and I honestly can't remember what I was doing then. This could potentially be closed and reopened in the future if needed.

@noisysocks
Copy link
Member

Thanks @LABCAT! Let's do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block API API that allows to express the block paradigm. Needs Testing Needs further testing to be confirmed. [Type] Question Questions about the design or development of the editor.
Projects
None yet
Development

No branches or pull requests

4 participants