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

Backport #493 to v2 #497

Merged
merged 4 commits into from
Mar 16, 2021
Merged

Backport #493 to v2 #497

merged 4 commits into from
Mar 16, 2021

Conversation

goldenapples
Copy link
Contributor

This PR manually backports the patch from #493 to the v2 branch.

See #492.

Sets the "filesize" property in the attachment metadata when initially
uploading images, so that it doesn't have to be queried for in
wp_prepare_attachment_for_js() ajax response.
The attachment metadata array doesn't always have a "file" attribute.
This uses the core API for getting the attached file rather than
building it from the file path and the upload dir.
Copy link

@hm-linter hm-linter bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linting failed (1161 errors).

(1152 notices occurred in your codebase, but were on files/lines not included in this PR.)

Copy link
Member

@joehoyle joehoyle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@goldenapples I might be wrong, but I think we might not have used return type declarations as it's not supported by the version of PHP supported in 2x. Before merging could you just verify if we are using them elsewhere?

v2 of S3-Uploads should continue supporting older versions of PHP.
Removing the return type declaration here to avoid fatals.
@goldenapples
Copy link
Contributor Author

goldenapples commented Mar 16, 2021

@joehoyle you were right, there aren't any return types elsewhere in the plugin on v2-branch. I've removed the one from this PR in
ecd933e.

@joehoyle joehoyle merged commit 2064c46 into v2-branch Mar 16, 2021
@joehoyle
Copy link
Member

awesome thanks

@joehoyle joehoyle deleted the backport-493-to-v2 branch March 16, 2021 14:29
@joehoyle
Copy link
Member

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

Successfully merging this pull request may close these issues.

2 participants