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

Account for $meta arg in wp_prepare_attachment_for_js not being an array #1756

Merged
merged 1 commit into from
Dec 18, 2024

Conversation

westonruter
Copy link
Member

@westonruter westonruter commented Dec 18, 2024

Summary

Fixes #1755

This is a follow-up to #1719.

Relevant technical choices

The dominant_color_prepare_attachment_for_js() function depends on there being metadata associated with an attachment, since this metadata is where the dominant color information comes from. In addition to allowing $meta to be passed as false instead of an array (which fixes the fatal error), if it is passed as false then the function now short-circuits since there is nothing for it to do.

@westonruter westonruter added [Type] Bug An existing feature is broken [Plugin] Image Placeholders Issues for the Image Placeholders plugin (formerly Dominant Color Images) skip changelog PRs that should not be mentioned in changelogs labels Dec 18, 2024
@westonruter westonruter requested a review from pbearne as a code owner December 18, 2024 06:35
@westonruter westonruter mentioned this pull request Dec 18, 2024
4 tasks
Copy link

github-actions bot commented Dec 18, 2024

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: westonruter <[email protected]>
Co-authored-by: mukeshpanchal27 <[email protected]>
Co-authored-by: felixarntz <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Member

@mukeshpanchal27 mukeshpanchal27 left a comment

Choose a reason for hiding this comment

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

Quickest 🚀

@felixarntz felixarntz merged commit 07fd4cf into release/3.7.0 Dec 18, 2024
25 checks passed
@felixarntz felixarntz deleted the fix/non-array-meta-arg branch December 18, 2024 09:55
@westonruter
Copy link
Member Author

I'm surprised that zepeviktor/phpstan-wordpress didn't catch this issue with static analysis. It looks like there is an open issue for it: szepeviktor/phpstan-wordpress#106.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Plugin] Image Placeholders Issues for the Image Placeholders plugin (formerly Dominant Color Images) skip changelog PRs that should not be mentioned in changelogs [Type] Bug An existing feature is broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants