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

Bug report: Lazyblocks does not update meta fields on publish / update. #137

Closed
jasperuitterhoeve opened this issue Apr 20, 2020 · 9 comments
Labels
question Further information is requested

Comments

@jasperuitterhoeve
Copy link

jasperuitterhoeve commented Apr 20, 2020

Dear Developer,

Love this plugin, however i just run into the following issue. It seems like whenever 'save in meta' field is checked. The LZB controller won't update the meta field whenever you save or. update a post or page.

I currently have a block which should be saved in the meta field, however every time i try to save or update an post, the meta fields won't be updated. When i refresh the page after i saved my post the old input value is showed again.

Can this issue be resolver? Thank you in advance.

@jasperuitterhoeve jasperuitterhoeve changed the title Bug report: Cannot change / replace image when added to meta field Bug report: Lazyblocks does not update meta fields on publish Apr 20, 2020
@jasperuitterhoeve jasperuitterhoeve changed the title Bug report: Lazyblocks does not update meta fields on publish Bug report: Lazyblocks does not update meta fields on publish / update. Apr 20, 2020
@nk-o
Copy link
Collaborator

nk-o commented Apr 28, 2020

Please, provide detailed info on how to reproduce the problem. On my test server meta values saved with no problem.

@jasperuitterhoeve
Copy link
Author

The meta values are saved indeed. But once you edit a post or page and try to change a value and overwrite them, this does not work. It does not work with the standard Wordpress theme and plugin out of the box.

@nk-o
Copy link
Collaborator

nk-o commented Apr 29, 2020

It is working as well.

@nk-o nk-o added the question Further information is requested label May 9, 2020
@charles-tyler
Copy link

Also having the same issue as @jaapie1989

When using a block and selecting 'save in meta' the content saves the first time with post update. You can then make a new edit to the lazy block contents and committing a post update and it will work.

However, if the post edit page is reloaded, either through a webpage refresh or just going back to the post index and loading the same post again then the block content doesn't update and isn't passed to "custom fields". It seems as though it looses where it was meant to save or cant overwrite already entered "custom fields" data.

A horrible "fix" is to either manually update the "custom field" values in the Custom Fields Menu when turned on in options. Or delete the whole "custom field", update the post and add in all of your data again including your edit.

This looks like it should be tagged as a bug?

@nk-o
Copy link
Collaborator

nk-o commented Jun 10, 2020

Hey @jaapie1989 @charles-tyler 

Have you tried to disable Custom Fields? Was the block meta saved when this panel was disabled? I think this problem may be the same as in this issue - #141

And I'm not yet sure, that this is Lazy Blocks issue. We need to test blocks with meta fields, that created in a native Gutenberg way (without Lazy Blocks plugin).

@charles-tyler
Copy link

Hi @nk-o

Thanks for your quick reply. Disabling "custom fields" in post options did the trick for me!

Thanks for the help. It makes sense that custom fields will only update one of the fields if they both exist on the page, thought maybe the lazy block would take preference, but no reason why that would be the case.

@NielsWPN
Copy link

Hi

I came here after looking to solve a similar problem: the field default value was not displayed correctly (displayed 0) when 'saved in meta' was ticked.

Custom fields panel was the problem — I think this info should be in the documentation as I thought blocks with meta and WP custom fields could work together (one updating the other and vice versa).

Best

@cheggy
Copy link

cheggy commented Nov 11, 2020

I had the issue of not being able to save items that were saving to meta data.
I would edit the input and it would pop up the toast to say it had saved but looking at the published page, the change was not made and reloading the edit page would show the old content.
Upon looking in the console, there are a bunch of warnings about duplicate IDs. Which was related to having the Custom Fields panel displayed (I guess same ID for the inputs)

From the block edit screen, go to the 'dot dot dot' more menu in the top right, select options and unselect 'custom fields'. Then save and reload. This solved it for me.

@nk-o
Copy link
Collaborator

nk-o commented Aug 17, 2021

I will close this since the problem is because of the Gutenberg feature.

@nk-o nk-o closed this as completed Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants