May 7, 2023, 6:14pm
I uploaded a custom invoice logo in System Settings → Invoices. Now, when working with a quote and attempting to “Download PDF” or “Send Email”, the application crashes when in debug mode.
Here is the debug log:
And, here is the backtrace received by the browser:
I have found a workaround.
In application/helpers/invoice_helper.php, I changed line 39 from:
return '<img src="file://' . getcwd() . '/uploads/' . $CI->mdl_settings->setting('invoice_logo') . '" id="invoice-logo">';
return '<img src="' . base_url() . '/uploads/' . $CI->mdl_settings->setting('invoice_logo') . '" id="invoice-logo">';
It is my understanding that the “file://” protocol attempts to access a file on the client system, not on the server, which is forbidden by the browser for security reasons.
I do not know the reason for the original coding, so I do not know if this is a bug nor if the above is a proper fix for it. If this is indeed a bug, should I go ahead and open an issue at the IP repo ?
System: LAMP with Apache2 and PHP 8.0.28
Browsers: Firefox and Chromium (both report the security exception in their consoles)
Try this solution:
10:37AM - 08 Dec 22 UTC
In version 1.6.0 the logo isn't shown on the PDF invoice. When changing line 39
… the logo returns.
Please check the following steps to submit your pull request. If you have any questions please read the contribution guide available at https://go.invoiceplane.com/contribguide or join the community forums or the Slack channel.
You can check items by changing `[ ]` to `[x]`.
If you can't check all checklist items please add `[WIP]` in front of your title.
Remove this first paragraph but please keep the following checklist even if it's incomplete.
## Related Issue
## Motivation and Context
## Screenshots (if appropriate):
## Pull Request Checklist
* [ ] My code follows the code formatting guidelines.
* [ ] I have an issue ID for this pull request.
* [ ] I selected the corresponding branch.
* [ ] I have rebased my changes on top of the corresponding branch.
## Issue Type (Please check one or more)
* [x] Bugfix
* [ ] Improvement of an existing Feature
* [ ] New Feature
The PR is already merged and will be released with version 1.6.1
May 8, 2023, 2:52am
Interesting. That’s the exact same fix I applied.
I searched the Issues before posting here. Apparently I used the wrong search term as there is no “logo image” in the title of the related issue.
Thank you for the note.
May 22, 2023, 5:01am
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.