1

Just upgraded CiviCRM. Running 4.7.29 on D7.56. Have installed wkhtmltopdf at /usr/local/bin/wkhtmltopdf I have placed exactly that file path into the settings in the admin for the "alternate" pdf generator. Doesn't seem to work. Get fatal error when I try to generate pdfs for printing. Here is the alert message:

Fatal error: Call to undefined method CRM_Core_SelectValues::documentFormat() in /home/[site]/public_html/sites/all/modules/civicrm/CRM/Contact/Form/Task/PDFLetterCommon.php on line 186

Don't think wkhtmlpdf is executing. Is there a test to see if wkhtmlpdf is handling the conversion, as opposed to dompdf? Any suggestions?

  • The error message looks unrelated to whether wkhtmltopdf is being used. That method should exist and should be in CRM/Core/SelectValues.php at line 1077 (in 4.7.29) Corrupted download? Out of disk space? – Aidan Jan 30 '18 at 18:05
  • Thanks. This is what I have at 1077-1084: public static function documentFormat() { return array( 'pdf' => ts('Portable Document Format (.pdf)'), 'docx' => ts('MS Word (.docx)'), 'odt' => ts('Open Office (.odt)'), 'html' => ts('Webpage (.html)'), ); } – John Richardson Jan 30 '18 at 18:40
  • Is that code at 1077 what I should expect? – John Richardson Jan 30 '18 at 18:50
  • That is right - compare github.com/civicrm/civicrm-core/blob/4.7.29/CRM/Core/… That is the function it is complaining about not finding. Is there anything else not working? What steps are you doing to attempt to generate the pdf? – Aidan Jan 31 '18 at 8:41
  • Yes, we get other bad behavior when trying to print from civi. To produce the error above: We do a "find contributions" filtered by date, generate a list, select the contributions, select "thank you letters-email or print" under "actions". That last step produces the error. We do not get to the mail module "select template". If I go to the contact record and select "print or merge document" under actions, I get a white-screen-of-death pop-up. However, if I select "print summary" I get what I expect, it opens my system print dialog and displays a well-formatted document to print. – John Richardson Jan 31 '18 at 13:45
0

The fix was to uninstall/reinstall sumfields! However, I had to manually delete row/drop tables (value_sumfields and custom_groups) in order to "clean install" sumfields. Still don't know why, but my instance was buggy. The usual uninstall/install procedure in the extensions manager didn't work for me. Talked to Jamie McClelland and he confirmed that I could/should manually make changes to the tables and then reinstall 3.1.1 of sumfields. NOTE: I had originally assumed that the problem had to do with wkhtmltopdf and so started down a bunny trail. For some reason upgrading from 4.7.22 to 4.7.29 AND having sumfields enabled AND using alternate pdf generator caused/revealed the problem on my instance. I will continue to investigate this, but I want to give a big shout out to Aidan at Squiffle and to Jamie at Progressive Tech Project for sticking with me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.