-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Facebook Embed Block preview error doesn't differentiate from a oEmbed API error #8361
Comments
Thanks for the report, @7studio
Notably, Facebook previews don't ever work in Gutenberg (introduced in f9d17bc and #816). The message "Previews for this are unavailable in the editor, sorry!" is always true because Gutenberg never attempts to fetch the oEmbed preview. Flagging as |
Another idea, and this would be a refinement to the existing implementation, would be to attempt the oEmbed preview, and then have the preview message distinguish between a Facebook Embed that would preview on the frontend vs. one that wouldn't (because the URL is incorrect, etc.) |
Why do they -- what detail do you want to communicate here? And there's nothing the user can do about this, right? |
Facebook Embeds don't preview in Gutenberg like, for instance, Twitter Embeds do.
Correct. |
Thank you to take into account this issue @danielbachhuber
When I used the word "preview" I wanted to say "the oEmbed content displayed" sorry for this misspelling. So in my case, the current Gutenberg message is wrong because WordPress succeeds in catching the response of oEmbed API but Gutenberg doesn't render it 😉 I hope Facebook embeds can have the same behaviour than Twitter in the near future 😁 |
So in the interest of giving the user a useful next step/solution, I'm thinking you want something like: Unlike other embeddable content, embedded Facebook links don't preview in the editor. Take a look at the page preview to see how they look. |
Not really 😅 First of all, I didn't understand why @danielbachhuber said
I took the time to look into I will try to argument a solution in my other issue #8360 IMHO, a message like:
is the worst thing that Gutenberg can do. I don't want to switch into preview mode to know if you paste a wrong URL… Facebook contents should not be an exception. Due to an error in my code ( Gutenberg could take into account the WP_Error from the REST route response in Example of WP_Error for wrong URL: WP_Error Object
(
[errors] => Array
(
[oembed_invalid_url] => Array
(
[0] => Not Found
)
)
[error_data] => Array
(
[oembed_invalid_url] => Array
(
[status] => 404
)
)
) Currently, Gutenberg returns this JSON for my invalid URL: {
'html': '<a href="https://www.facebook.com/oohmyworld/vidos/2324195200940031/">https://www.facebook.com/oohmyworld/vidos/2324195200940031/</a>',
'provider_name': 'Embed Handler'
} If Gutenberg doesn't return In fact, this behaviour could be applied for all services 😍 |
@7studio Do you want to open a pull request for the behavior you'd prefer? |
@danielbachhuber Yes, I will |
Removing the |
This was fixed by #10958 where we separated the preview and input components so that the logic isn't mixed. |
Describe the bug
When I try to use the Embed Blocks, the preview of a valid embeddable content and the error message for an invalid URL have the same render.
To Reproduce
Steps to reproduce the behaviour:
Expected behaviour
Gutenberg should display different error messages for failed previews and failed oEmbed API requests.
E.g.:
Screenshots
Edition:
Website:
The text was updated successfully, but these errors were encountered: