-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Description
Description
I'm currently rebuilding my website using custom blocks.
During this process, once the blocks are developed, I first build the posts/pages in a staging environment. Then I take advantage of the "Copy All Blocks" feature to copy the entire content into a new post on the live website.
The media I uploaded on the staging site is also present on the live site, but with absolute URLs.
It's not immediately obvious unless you look for it, but I quickly realized that the image block copied here retain the absolute path (from the staging environment). This isn’t ideal for my workflow, altough I suppose it probably make more sense for diffent use cases.
What’s worse, though, is that when I try to replace a media file with it's live website same image, then the image won't actually get replaced. The media from the staging site remains, even though I did select and confirm the replacement from the live website Media Library.
The only workaround I’ve found is to click "Reset" first, then search for the image again in the library.
How comes? Won't the path get checked if the filename remains the same?
Thanks.
Step-by-step reproduction instructions
- Build a page with images blocks on a staging environment
- Click Copy All Blocks from the top-right 3-dots menu button.
- Create a new page the live website (which is the very same site the staging one)
- Paste
- Check the image URL (ex: right click on it > open it in a new tab >> it still has the staging environment domain)
- Click Replace > Open Media Library > Look for the same image in this environment > Update > Click on it > Click Select, to get back to the editor
- Check the image >> It's still the previous one, from the staging environment ❌
- Click Replace > Reset > Replace > Media Library > Look for the same image > Select
- Check the images >> Now it's the right image... ✅
Screenshots, screen recording, code snippet
No response
Environment info
WordPress v6.7.2
Theme: Storefront v4.6.1
Web Browser: Chromium 134.0.6998.178
Windows 11 Pro
Please confirm that you have searched existing issues in the repo.
- Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
- Yes
Please confirm which theme type you used for testing.
- Block
- Classic
- Hybrid (e.g. classic with theme.json)
- Not sure