Skip to content

Support embedded images, media and reusable blocks in Blocks import/export #10050

Open
@designsimply

Description

@designsimply

Steps to reproduce:

  1. Create a reusable block with a gallery of images.
  2. Open the block library by clicking on the inserter in the top toolbar.
  3. Click the gear icon in the "Reusable" section in the block library.
  4. Click "Export as JSON" for the reusable block from step 1.
  5. Open a different site and go to Posts > Add New.
  6. Open the block library by clicking on the inserter in the top toolbar.
  7. Click the gear icon in the "Reusable" section in the block library.
  8. Click the "Import from JSON" button at the top.
  9. Select the block exported from the other site.
  10. Try to edit the gallery images.

Result: the images are not actually imported and therefore cannot be modified via the imported reusable block. The following set of errors appears in the console for each image when the block loads:

GET http://madefortesting.com/wp-json/wp/v2/media/14448?context=edit 404 (Not Found)
index.js?ver=1537381499:1
Uncaught (in promise) {code: "rest_post_invalid_id", message: "Invalid post ID.", data: {…}}
index.js?ver=1537381499:1

screen shot 2018-09-19 at 6 04 00 pm

screen shot 2018-09-19 at 6 04 03 pm

Seen at http://madefortesting.com/wp-admin/post.php?post=616&action=edit running WordPress 4.9.8 and Gutenberg 3.9.0-rc.2 using Chrome 69.0.3497.92 on macOS 10.13.6.

Note: I used a gallery block in this test, but the problem applies to other blocks with images such as Cover Image.

What should happen for images inside reusable blocks? Should they be imported too? This seems complex. 🙂

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs DevReady for, and needs developer efforts[Feature] MediaAnything that impacts the experience of managing media[Feature] Synced PatternsRelated to synced patterns (formerly reusable blocks)[Type] EnhancementA suggestion for improvement.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions