Gutenberg: Video embeds fail if embed block is converted to a reusable block

Created on 15 Jan 2018  路  10Comments  路  Source: WordPress/gutenberg

Issue Overview

Embedding youtube videos works well. However, if you convert the block to a reusable block, the youtube player no longer gets embedded in the post. In the editor, the embed continues to show the player, though the play button doesn't work anymore.

Steps to Reproduce (for bugs)


  1. Embed any youtube video using the Embed block
  2. Convert the block to a reusable block
  3. Preview the post - the video is no longer embedded in the post
  4. Reload the editor - you can no longer play the video by clicking the play button

Expected Behavior



The video embed should render in posts, even if it's a reusable block.

Screenshots

  1. Youtube video embed rendering properly in post

screen shot 2018-01-16 at 12 05 35 am

  1. Convert video embed to a reusable block in the editor

screen shot 2018-01-16 at 12 06 01 am

  1. Reusable block successfully created. Embed shows in editor, though video can no longer be played in the embed

screen shot 2018-01-16 at 12 06 14 am

  1. Click Preview button and the video embed is no longer visible in the post page

screen shot 2018-01-16 at 12 06 25 am

[Feature] Reusable Blocks [Status] Duplicate [Type] Bug

Most helpful comment

I have experienced this same issue.

I added a Youtube block in a test post, and the video was displayed on the frontend. As soon as I converted the block to a Reusable Block, the video stopped displaying on the frontend, leaving just the video URL.

All 10 comments

Works as expected on master / v3.2

I have experienced this same issue.

I added a Youtube block in a test post, and the video was displayed on the frontend. As soon as I converted the block to a Reusable Block, the video stopped displaying on the frontend, leaving just the video URL.

@ajitbohra The issue seems to be back. Can we reopen this thread?

@ajitbohra Bringing up @davoraltman and @thabotswana comment, this bug seems to be back (for internal reference, affected site 1999851-zen ).

Can you re-open this issue? Otherwise we can create a new bug report, but would be duplicating info that can already be found here.

@iamgabrielma @davoraltman was able to reproduce, reopening issue.

Just to add to this, after adding a reusable block of almost anything, you need to convert it back to a regular block in order for it to function properly. I found this out on my own site after creating a reusable block for a "more" tag combined with protected content.

I also tested it on my test site with the youtube code and had the same behaviour. I'll let the user know about this work around for now.

The issue seems to be in core. I've created a ticket and attached a possible patch for this issue in the core. Please see - https://core.trac.wordpress.org/ticket/48034

@ajitbohra @tanjoymor @thabotswana @davoraltman @iamgabrielma @niranjan-uma-shankar - Please check if you have time. Thanks.

User reported this issue in 18596347-hc - do we have an update on this?

@donmhico shared an explanation of what's happening here over in Trac. Since this will need to be fixed in Core, I'm closing this issue in favour of https://core.trac.wordpress.org/ticket/48034.

Change of plan here. As mentioned in https://github.com/WordPress/gutenberg/pull/21043#issuecomment-611318826, changing the order of when the do_blocks will most definitely break plugins and themes. Instead let's fix this by making the Embed block a dynamic block. I'm re-opening https://github.com/WordPress/gutenberg/issues/14608 to track this work.

Was this page helpful?
0 / 5 - 0 ratings