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

Links and images in blocks aren't updated on import #63

Open
joyously opened this issue Nov 20, 2019 · 1 comment
Open

Links and images in blocks aren't updated on import #63

joyously opened this issue Nov 20, 2019 · 1 comment
Milestone

Comments

@joyously
Copy link

We have always been able to use the Theme Unit Test XML file that contains galleries with links, but now that there are gallery blocks with links, the results are different. The original galleries were shortcodes, so there is nothing to do. The block galleries contain the HTML for the links and the images, which remain as the old URL. Yet posts with images (not galleries) or image blocks are imported with changes to the image URLs.

Steps to Reproduce

Original Site:

  1. Using the block editor, create a post with two gallery blocks, one with linked images.
  2. Export the post.
  3. Note the gallery blocks show the original site URLs for links and images.

New Site:

  1. Import the post.
  2. View the imported post on the front end.
  3. View the page source and find the galleries.
    Expected result: links and images use the new site URL
    Actual result: links and images use the original site URL

This screenshot is from my localhost where I did the import. It contains the URL from the original sandbox site. (Tested with WP 5.3 on both sites.)
block-export-import

I have seen the same problem with

  • Cover block video backgrounds
  • Image block in a column block
  • Media/Text block
  • Audio block
  • Video block
  • File block
  • Download block
  • Button block
@joyously
Copy link
Author

I think in my test I exported only the post I created (I chose the Posts radio button and All dates). On import, I chose to download and import file attachments.
But the images were not in the media library after the import (content pointed to the original site for images).
So I tried again by exporting All content. And importing, I chose to download and import file attachments. This time the images were in the media library, and the gallery blocks had the links and image URLs changed to the correct URL. But there is still a data-link attribute that has the original URL.
block-export-import-2

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

No branches or pull requests

3 participants