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

Weird behavior trying to save a WordPress embed as reusable block #9938

Closed
bph opened this issue Sep 16, 2018 · 7 comments · Fixed by #10035
Closed

Weird behavior trying to save a WordPress embed as reusable block #9938

bph opened this issue Sep 16, 2018 · 7 comments · Fixed by #10035
Assignees
Labels
[Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) [Type] Bug An existing feature does not function as intended

Comments

@bph
Copy link
Contributor

bph commented Sep 16, 2018

Describe the bug
I added a WordPress embed block to my post. It worked. Then I used "add as reusable block", it bypassed the save screen and added it as an "untitled" to the list. Then I tried to add it to a post. The "An error happened screen" appeared. (nice!!)
And I was able to "copy the error" see below.

NOTE: The error message indicates 3.9 RC, I tested it in 3.8 as well, with the same outcome.

To Reproduce
Steps to reproduce the behavior:

  1. Add a new post
  2. in new line, copy/page URL
  3. save post
  4. Edit Post
  5. Select block
  6. Use: Add to reusable block.
  7. Remove block from post
  8. Try to add from reusable blocks the "Untitled" block

Expected behavior

  • A save screen to give the reusable block a name
  • when selected add just saved block again into the post.

Video
http:https://recordit.co/cHJ3ygmpqZ

Desktop (please complete the following information):

  • OS: Mac 10.13.6
  • Browser Chrome
  • Version 68

Error Message
TypeError: this.props.onReplace is not a function
at r.value (http:https://rctesting.local/wp-content/plugins/gutenberg-3.9-RC/build/block-library/index.js?ver=1537102276:12:86194)
at new r (http:https://rctesting.local/wp-content/plugins/gutenberg-3.9-RC/build/block-library/index.js?ver=1537102276:12:84960)
at yh (http:https://rctesting.local/wp-content/plugins/gutenberg-3.9-RC/vendor/react-dom.min.82e21c65.js:97:111)
at lg (http:https://rctesting.local/wp-content/plugins/gutenberg-3.9-RC/vendor/react-dom.min.82e21c65.js:120:88)
at mg (http:https://rctesting.local/wp-content/plugins/gutenberg-3.9-RC/vendor/react-dom.min.82e21c65.js:120:386)
at gc (http:https://rctesting.local/wp-content/plugins/gutenberg-3.9-RC/vendor/react-dom.min.82e21c65.js:127:202)
at vb (http:https://rctesting.local/wp-content/plugins/gutenberg-3.9-RC/vendor/react-dom.min.82e21c65.js:126:230)
at ub (http:https://rctesting.local/wp-content/plugins/gutenberg-3.9-RC/vendor/react-dom.min.82e21c65.js:126:65)
at ug (http:https://rctesting.local/wp-content/plugins/gutenberg-3.9-RC/vendor/react-dom.min.82e21c65.js:136:380)
at ue (http:https://rctesting.local/wp-content/plugins/gutenberg-3.9-RC/vendor/react-dom.min.82e21c65.js:25:80)

@bph bph changed the title 3.9. Weird behavior trying to save a WordPress embed as reusable block Weird behavior trying to save a WordPress embed as reusable block Sep 16, 2018
@notnownikki notnownikki self-assigned this Sep 17, 2018
@notnownikki
Copy link
Member

Seems to be specific to WordPress embeds. Twitter worked ok.

There are also some yucky rendering issues with reusable embed blocks. Time to dive into the implementation..!

@designsimply designsimply added [Type] Bug An existing feature does not function as intended [Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) Needs Testing Needs further testing to be confirmed. labels Sep 17, 2018
@notnownikki
Copy link
Member

This is a deeper issue with WordPress embeds, how we detect them and make sure the correct embed block is used, and how the JavaScript that does the embedding gets loaded. It's... not straightforward.

I am drinking lots of coffee, put it that way 🤣

@notnownikki
Copy link
Member

Some progress, some... not progress.

I have a fix for the WordPress embed block - that's good!

The reusable blocks are only meants for static content - that's not so good! Because it means that when a reusable block is used in a post, the content doesn't get any further processing. So the URL you embed doesn't get processed, and the content doesn't embed, it just shows the URL on the page.

I'll continute investigating to see if there's anything we can do to fix this, but at this point having read the code, it seems that reusable blocks are for static content only.

I'll update here once I know more.

@notnownikki
Copy link
Member

...and 2 minutes after I posted that, I think I found a fix :)

@designsimply
Copy link
Member

Noting this was also reported by another tester at https://make.wordpress.org/test/2018/09/14/call-for-testing-gutenberg-3-9-pre-release/#comment-1075

@notnownikki
Copy link
Member

@designsimply thanks! The PR that fixes this has a conflict, I'll fix that first thing tomorrow and request a core review :)

@notnownikki
Copy link
Member

PR conflict is resolved. @bph the fix is up for review by the core team now, so hoping this should be fixed very soon :)

@designsimply designsimply removed the Needs Testing Needs further testing to be confirmed. label Feb 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants