-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Suppressing warnings for malformed metadata in product template downloads #32971
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
Conversation
| } | ||
|
|
||
| $image_meta = wp_read_image_metadata( $upload['file'] ); | ||
| $image_meta = @wp_read_image_metadata( $upload['file'] ); |
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.
Adding the @ here will suppress any warnings from calling this function. I noticed other calls to wp_read_image_metadata within WooCommerce are already doing this.
joshuatf
left a comment
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.
This looks like a good call, but would like to get this addressed at its root as well. I'll ping you with details on getting admin access to the site.
|
@joelclimbsthings What's the status of this PR? |
@mattsherman I had been prioritizing the task chaining side panel PR, but I was also able to gain access to the |
1da2ee3 to
9e62fb5
Compare
|
@joshuatf Alright, I've updated the image on the staging site, and updated all references to the new image. I also tested on a fresh site an fresh clone of this branch, and the correct image was downloaded without issue. Have at it! Edit: The diff is a bit hard to read, but the only change(s) regarding the image is the date in the path. |
|
📊 Test reports for this pull request have been published and are accessible through the following links:
Latest commit referenced in the reports: Visit the WooCommerce Test Reports homepage to view all published reports. See the FAQs page if you're having problems accessing them. |
joshuatf
left a comment
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.
Testing well, thanks for the fix, @joelclimbsthings!
|
Hi @joelclimbsthings, thanks for merging this pull request. Please take a look at these follow-up tasks you may need to perform:
|
All Submissions:
Changes proposed in this Pull Request:
This resolves a warning that is being triggered when a user creates a product via the digital download template. The warning results from corrupt meta-data on an image file that is downloaded (from this source) and then used within the product template as the product image. This doesn't cause any functional issue other than the warning when
WP_DEBUGmode is set totrue.A couple options to resolve this:
https://woocommercecore.mystagingwebsite.com/wp-content/uploads/2017/12/album-1.jpg, and I'm unsure how this is edited or accessed.I've taken option 2 for this PR.
Closes #32137 .
How to test the changes in this Pull Request:
WP_DEBUGis set to true inwp-config.phpdebug.logOther information:
pnpm nx changelog <project>?FOR PR REVIEWER ONLY: