-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Media: Inserting media that hasn't been added yet causes errors. #31230
Comments
This came up in #5711931-hc (follow-up #2077994-zen.) We did not succeed with the workaround of removing the featured image and re-selecting it from the site's Media. It must be some theme/plugin conflict because it did work fine on my atomic site. |
The console errors are caused because the media modal does the following synchronously:
The blocks recover from this because in calypsoify-iframe, we listen for changes in the media store and post an
|
Turns out the above is unrelated - the code we have for update image blocks is specifically for editing an image (see D26023-code) and doesn't fire when inserting an image in the first place. I'm not sure how the core Gutenberg image block (source code here) recovers from receiving the transient ID, while the featured image selector (source code here) does not. Both core image blocks and the featured image selector use the I was unable to find a solution / cause during HACK week, so I'm sending it back to the backlog. |
This was reported here #35987 as well, and I am able to reproduce. I also noticed that, when the featured image is removed and when I open the media library again, the photo from That is, the featured image action fails, and when we remove that image to check the media library, the file can be seen to be successfully uploaded. But, trying to set new images as featured again, from |
Confirmed this is still an issue today, but didn't get far on a solution. |
Confirming that it is still happening and I encountered it many times during Quick Start Sessions. |
As per pbAPfg-1z-p2#comment-94 it should not be happening anymore. Can others confirm this too so we can close the issue? |
Let's verify if this is still an issue |
@zdenys this was fixed by @Addison-Stavlo in #38488 💖 The insert button will be disabled until the image is fully uploaded. |
When setting a featured image, we can access the Pexels API from the "Free Photo Library" dropdown in the media modal. As soon as we select an image, we can immediately insert it (with the primary action button), even though it hasn't completed uploading to our library.
In Calypso, this will give console errors but corrects itself somehow; however, when using the media modal with an iframed block editor, the failure will leave the featured image loader spinning forever unresolved.
Additionally, you'll get the same console errors when trying to insert a still-uploading image in the block editor, but it works itself out with no issues. Only in the context of the featured image in the block editor is this an issue.
The core media modal gets around this by not allowing you to insert an image until it has been uploaded. (Seems this could be a possible solution, though not as slick a UX.)
Note that if we then remove the featured image, we can reapply it successfully, since the media has completed uploading.
#12000 may point to a solution.
To Replicate
https://wordpress.com/post
, select a site that's opted in to the block editor.(You can also replicate this by uploading a local picture and then inserting it as a featured image before it has finished uploading.)
Note: after resolving this issue, also make sure you can no longer reproduce #33362.
The text was updated successfully, but these errors were encountered: