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

Reusable Block: Embed block only shows URL on frontend #9937

Closed
bph opened this issue Sep 16, 2018 · 9 comments
Closed

Reusable Block: Embed block only shows URL on frontend #9937

bph opened this issue Sep 16, 2018 · 9 comments
Assignees
Labels
[Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) [Priority] High Used to indicate top priority items that need quick attention [Type] Bug An existing feature does not function as intended

Comments

@bph
Copy link
Contributor

bph commented Sep 16, 2018

Describe the bug
After making a youtube video block a reusable block, the block only shows the URL not the embedded video on the front end. It shows as embedded in the edit screen, though.
Reusing the saved YT blocks in a different post also doesn't work.

Updated: Reusable Twitter Block also only shows URL on frontend. So does Meetup Block.
I am 0:3 different embed blocks. Making assumption that's and embed bug, not related to any particular service.

To Reproduce
Steps to reproduce the behavior:

  1. Got a post
  2. Embed YouTube video or Tweet
  3. Use Block Options > Add to reusable Blocks
  4. Save and Preview / Publish and view post

Expected behavior
The embedded block shows up on front end of post as embed. Only URL shows.

Screenshots
http://recordit.co/wLqvjgfba3
You'll see: YT block on front end as normal block
Adding it to reusable block, and another preview of the post.

Twitter reusable only shows URL on front end, too
http://recordit.co/6lKQIu1yfi

Desktop (please complete the following information):

  • OS: MAC 10.13/.6
  • Browser Google Chrome
  • Version 68.0.3440.106

Browser Console Error Messages
These seem to be the relevant error message in the browser console:
www-embed-player.js:362 POST https://www.youtube.com/youtubei/v1/log_interaction?alt=json&key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8 401 ()
Ae @ www-embed-player.js:362
ze @ www-embed-player.js:347
Fe @ www-embed-player.js:360
hg @ www-embed-player.js:463
gg @ www-embed-player.js:443
eg @ www-embed-player.js:438
setTimeout (async)
S @ www-embed-player.js:338
fg @ www-embed-player.js:439
cg @ www-embed-player.js:437
jg @ www-embed-player.js:445
Oi @ www-embed-player.js:645
k.K @ www-embed-player.js:281
(anonymous) @ www-embed-player.js:537
setTimeout (async)
S @ www-embed-player.js:338
Kh.q.(anonymous function) @ www-embed-player.js:537
c @ base.js:6097
g.h.V @ base.js:5985
g.zU @ base.js:4263
u_.resume @ base.js:7612
g.h.hP @ base.js:6164
GH.a.C.(anonymous function) @ base.js:2391
(anonymous) @ www-embed-player.js:530
Pi @ www-embed-player.js:646
k.K @ www-embed-player.js:281
Ih @ www-embed-player.js:529
Fh @ www-embed-player.js:528
Bh.a.w @ www-embed-player.js:525
Bh @ www-embed-player.js:526
k.ea @ www-embed-player.js:521
(anonymous) @ www-embed-player.js:549
setTimeout (async)
S @ www-embed-player.js:338
Nh @ www-embed-player.js:549
(anonymous) @ www-embed-player.js:648
(anonymous) @ H1LC7HQ7X5o:12
09:33:47.363 www.youtube.com/youtubei/v1/log_interaction?alt=json&key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8:1 Failed to load resource: the server responded with a status of 401 ()

@bph bph changed the title Reusable Block: YouTube block only shows URL on frontend Reusable Block: Embed block only shows URL on frontend Sep 16, 2018
@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
@brandonpayton
Copy link
Member

I am able to reproduce this with the YouTube embed block.

@brandonpayton brandonpayton added [Priority] High Used to indicate top priority items that need quick attention and removed Needs Testing Needs further testing to be confirmed. labels Sep 19, 2018
@bph
Copy link
Contributor Author

bph commented Sep 19, 2018

Seems @notnownikki has a fix already

@notnownikki
Copy link
Member

#10035 has the fix for this, and, because I love you all so very much, for WordPress embeds as reusable blocks! 😄

@notnownikki notnownikki self-assigned this Sep 29, 2018
@noisysocks
Copy link
Member

#10035 fixed this.

@OksanaRomaniv
Copy link

Getting this same error now again with WP Version 5.2.3

@petethompson
Copy link

petethompson commented Oct 11, 2019

I'm also experiencing this issue with WordPress 5.2.3. This is the code that's being generated:

<figure class="wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio">
    <div class="wp-block-embed__wrapper">
        https://youtu.be/-CzR5lZMWBY
    </div>
</figure>

EDIT:

The gutenberg video block does generate the video player iframe if I format the link like this:
https://www.youtube.com/watch?v=-CzR5lZMWBY&feature=youtu.be

IMO the block should take the youtu.be embed link that youtube gives you for embedding. Having to do it this way seems like it would cause confusion for WP users.

@orvn
Copy link

orvn commented Apr 7, 2021

This issue reappeared in Wordpress 5.6 (and 5.5 as well, I believe)

@juanRabaa
Copy link

This issue reappeared in Wordpress 5.6 (and 5.5 as well, I believe)

Its happening to me too on 5.7. Not even reusable, just a simple Embed Block. Only shows the URL on the front (printed with the_content).

@orvn
Copy link

orvn commented May 4, 2021

See if your issue can be resolved by forcing apply_filters(), as described in this comment @juanRabaa?

The implementation in our use case might be different, but the issue definitely turned out to be one of frontend output, rather than a problem with the Gutenberg embed block itself.

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) [Priority] High Used to indicate top priority items that need quick attention [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

9 participants