-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Paste: fix blob uploading #64479
Paste: fix blob uploading #64479
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: +198 B (+0.01%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
I think this approach is the right one. The blocks should be created properly from the start. Thanks for fixing that. We don't have the same issue for "file" and "audio"? |
No they don't have raw transforms. Yes, it's only an issue if someone was relying on being able to create a block with a blob as the URL and have it upload. |
Added an e2e test as well. |
if ( isBlobURL( attributes.url ) ) { | ||
attributes.blob = attributes.url; | ||
delete attributes.url; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be attributes.src
instead of attributes.url
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing it
@ellatrix, not sure why, but failing e2e tests seem to be related to the changes here. |
d63beb9
to
757f8e4
Compare
I ran it locally both on this branch and trunk, and both times it failed. 🤔 |
Also, this tests seems to be introduced just yesterday. |
I don't seem to be able to reproduce the test failure, I tested both in |
It's odd that an unrelated e2e test caused the failure. I'll investigate this later and restore the proposed test case. |
Huh, this was just an idea that I didn't think would work, because locally that test still fails without my e2e test, and it also fails in trunk... |
Didn't notice auto merge was still on sorry |
What?
Since #63076, pasted blobs are no longer uploaded.
Why?
They should be.
How?
In the paste/raw transform, check if the URL is a blob and set the new attribute.
Alternatively, maybe we should handle this in the blocks: check if the url attribute is a blob on mount, and set it as the temporary URL. cc @youknowriad
Testing Instructions
See #60811.
Testing Instructions for Keyboard
Screenshots or screencast