-
Notifications
You must be signed in to change notification settings - Fork 808
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
CRM: PDF invoice logo - image not found issue. Set the tmp folder and don't add protocols #37311
Conversation
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Once your PR is ready for review, check one last time that all required checks appearing at the bottom of this PR are passing or skipped. |
It works for me: Using this logo: https://img.freepik.com/free-vector/business-logo-template-minimal-branding-design-vector_53876-136229.jpg |
Not related to this PR, but ran into this problem:
|
The thing I wasn't getting right is that this applies only to new invoices; all old ones won't get the new logo. |
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.
LGTM!
Fixes https://github.com/Automattic/zero-bs-crm/issues/3459
Proposed changes:
This PR fixes our issue with the PDF invoices for rendering the logo. I've been investigating it for a while, and really, there were two issues;
The main one was a method introduced to check the remote link, but it was not working well because many sites use CDN to cache their assets, including images, which implies that the logo image has a different domain or subdomain.
The other issue was about the temporary folder to download that remote file locally and to be able the DomPdf to generate the PDF correctly. In some servers, the temporary folder is not writable, so we usually have an issue there. To fix this, we set the temporary folder inside of the JPCRM storage folder, in the wp-content folder to ensure we have a writable .temporary folder.
Other information:
Jetpack product discussion
N/A
Does this pull request change what data or activity we track or use?
N/A
Testing instructions:
Your Business Logo:
to an external image link.