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

Error when pasting YouTube URL in Video block #2455

Closed
swissspidy opened this issue May 29, 2019 · 3 comments
Closed

Error when pasting YouTube URL in Video block #2455

swissspidy opened this issue May 29, 2019 · 3 comments
Labels
Bug Something isn't working Integration: Gutenberg

Comments

@swissspidy
Copy link
Collaborator

When creating a Video block in Gutenberg and pasting a YouTube URL in the "Insert from URL" field, Gutenberg automatically creates a YouTube block for it.

In the AMP Stories editor, this does not work, because YouTube videos are currently not allowed in Stories and thus we disabled the YouTube embed block. There's an error in the console:

Here's where this happens:

https://github.com/WordPress/gutenberg/blob/ee7c19acf998d99455939dc2501a66179d82cd97/packages/block-library/src/video/edit.js#L95-L114

And here's the function in question:

https://github.com/WordPress/gutenberg/blob/ee7c19acf998d99455939dc2501a66179d82cd97/packages/block-library/src/embed/util.js#L61-L118

It's probably the same issue when pasting video URLs from some other providers whose blocks we have disabled.

It looks like createUpgradedEmbedBlock does not at all check whether the block type is registered, so I think this is something we should report upstream.


First reported in #2394 (comment).

@swissspidy
Copy link
Collaborator Author

Created an upstream issue: WordPress/gutenberg#15883

@swissspidy
Copy link
Collaborator Author

Upstream pull request: WordPress/gutenberg#15885

@swissspidy
Copy link
Collaborator Author

Merged the upstream fix. It will hopefully be part of Gutenberg 5.9.

Note: Nothing to do for QA here until Gutenberg 5.9 is released!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Integration: Gutenberg
Projects
None yet
Development

No branches or pull requests

1 participant