Skip to content

Reusable Blocks: Convert to Regular Block does not preserve nested blocks #9278

Closed

Description

@ZebulanStanphill

The issue

If you save a block containing nested blocks as a Reusable Block, then it works just fine as a Reusable Block. But if you try to convert an instance of that Reusable Block to a regular block, then the resulting regular block will not contain any of the nested blocks that the Reusable Block had.

Steps to reproduce

  1. Insert a Columns block.
  2. Insert some other block into the Columns block.
  3. Open the ellipsis (More Options) menu and choose Add to Reusable Blocks.
  4. Finish naming and saving the Reusable Block.
  5. Notice that the nested blocks are saved in the Reusable Block as expected.
  6. Open the ellipsis menu again and choose Convert to Regular Block.
  7. Notice that the nested blocks are gone.

Expected behavior

Reusable blocks should preserve nested blocks when an instance is converted to a regular block.

Related issues and PRs

Activity

  1. designsimply commented on Aug 23, 2018

    @designsimply
    Member

    Tested and confirmed using WordPress 4.9.8 and Gutenberg 3.6.2 and noting that in my case the blocks were preserved but the content inside them was not. (39s)

  2. added
    [Feature] Synced PatternsRelated to synced patterns (formerly reusable blocks)
    [Feature] Nested / Inner BlocksAnything related to the experience of nested/inner blocks inside a larger container, like Group or P
    [Type] BugAn existing feature does not function as intended
    on Aug 23, 2018
  3. noisysocks commented on Aug 24, 2018

    @noisysocks
    Member

    Likely the same root cause as #5754.

  4. asadrahbar commented on Sep 18, 2018

    @asadrahbar

    Is anyone working on a fix for this? The issue also occurs when using the Atomic Blocks plugin's AB Container block. I would like to create reusable sections (ex: image with heading, paragraph, and button) that clients could drop onto a page and then edit the content, similar to how the Divi library works. The only workaround for now is to copy the HTML for the nested blocks, paste into an HTML block and then Convert to Blocks - obviously not ideal for users who are afraid of code.

  5. riemerta6 commented on Oct 19, 2018

    @riemerta6

    I'm also experiencing the same issue :/ Learned the hard way.

  6. added this to the WordPress 5.0 milestone on Oct 29, 2018
  7. self-assigned this
    on Oct 29, 2018
  8. noisysocks commented on Oct 29, 2018

    @noisysocks
    Member

    Likely the same root cause as #5754.

    After looking into this some more, I think that this is a seperate bug caused by not passing referencedBlock.innerBlocks here:

    newBlocks = [ createBlock( referencedBlock.name, referencedBlock.attributes ) ];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

[Feature] Nested / Inner BlocksAnything related to the experience of nested/inner blocks inside a larger container, like Group or P[Feature] Synced PatternsRelated to synced patterns (formerly reusable blocks)[Type] BugAn existing feature does not function as intended

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions