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

Save is executed too fast for gallery #170

Closed
1 task done
mdesplenter opened this issue Jun 18, 2024 · 3 comments · Fixed by #173
Closed
1 task done

Save is executed too fast for gallery #170

mdesplenter opened this issue Jun 18, 2024 · 3 comments · Fixed by #173
Assignees
Labels
type:bug Something isn't working.
Milestone

Comments

@mdesplenter
Copy link

Describe the bug

I have a site with old galleries that I wanted to convert to Gutenberg blocks. When clicking the Convert to blocks button in the admin it worked, but running this script it failed loading the images. After a lot of testing I found out that the save function is called directly and not giving the Gutenberg script enough time to modify all the images / content.

Adding the timeout around the save function fixed it for me:
https://github.com/10up/convert-to-blocks/blob/develop/assets/js/editor/editor.js#L69

setTimeout((function(){
client.save();
}),6000)

Takes more time, but better results for me.

Steps to Reproduce

  1. Add a gallery with multiple images in the old editor
  2. Convert the post with the convert-to-blocks script
  3. Images show up without a src

Screenshots, screen recording, code snippet

No response

Environment information

No response

WordPress information

Latest Wordpress, local, with Bedrock
Also tried without Bedrock.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@mdesplenter mdesplenter added the type:bug Something isn't working. label Jun 18, 2024
@Sidsector9 Sidsector9 self-assigned this Jun 19, 2024
@jeffpaul jeffpaul moved this from Incoming to Code Review in Open Source Practice Jun 20, 2024
@jeffpaul jeffpaul added this to the 1.4.0 milestone Jun 20, 2024
@dkotter
Copy link
Collaborator

dkotter commented Jun 20, 2024

@mdesplenter We have a PR up to fix this issue. If you have time to test that out and let us know if that fixes your issue, that would be great. Thanks!

@Sidsector9
Copy link
Member

@dkotter the PR is not yet ready, I marked it as draft.

@Sidsector9
Copy link
Member

@mdesplenter I've raised the PR, can you give it a try and let us know if it works for you? Thanks!

@github-project-automation github-project-automation bot moved this from Code Review to Done in Open Source Practice Jul 5, 2024
@dkotter dkotter modified the milestones: 1.4.0, 1.3.1 Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working.
Projects
Archived in project
4 participants