Obsolete wkhtmltopdfPath causes hard fail in event registration due to internal fatal error for the missing package
This occurred to us after migration, as on new server the wkhtmltopdfPath is not installed/or it might be changed and as result of which alternate executable path of wkhtmltopdfPath becomes obsolete. This causes hard fail on any of the following operations which involves PDF generation from html content:
- attaching confirmation mail to participant and attaching PDF of the content on it.
- same with #1 (closed) but in case of online donation.
- Manual print document for contacts
ETC.
In our case its #1 (closed) which prevents the event registration process with an internal error
Sep 02 14:03:16 [error]
$Fatal Error Details = array(3) {
["message"]=>
string(424) "The exit status code '127' says something went wrong:
stderr: "sh: /old/path/wkhtmltox/bin/wkhtmltopdf: not found
"
stdout: ""
command: /old/path/wkhtmltox/bin/wkhtmltopdf --lowquality --margin-bottom '0.75in' --margin-left '0.75in' --margin-right '0.75in' --margin-top '0.75in' --orientation 'portrait' --page-height '792pt' --p
age-width '612pt' '/tmp//knp_snappy5f4fec74637de.html' '/tmp//knp_snappy5f4fec74638cf.pdf’.
“
To resolve this I would propose the following approach:
- In case, if the wkhtmltopdf executable path is not working for various reason, throw an error message on civicrm status page.
- Prevent the code to use the wkhtmltopdf executable path and fallback to use the default pdf package tcpdf which is bundled with CiviCRM
ping @eileen @JoeMurray @seamuslee