The module produced the error:

Call to undefined function drupal_get_installed_schema_version() certificate/certificate.pages.inc on line 191

This function is defnined in inc/install.inc. I suppose install.inc is not included but I do not know how to solve this whithout patching core.

A reasonable workaround:
The function is used to test the version of the printmodule in the drupal installation.

Because I used the latest version, I solved this problem by disabling the if statement in the function certificate_print_pdf_wrapper(). The new code of this function :(use the else branch if you have the other version of the printmodule installed)

function certificate_print_pdf_wrapper($filename, $html, $orientation) {
module_load_include('pages.inc', 'print_pdf', 'print_pdf');

// Rewrite image URLs using Print.
$pattern = '!<(img\s[^>]*?)>!is';
$html = preg_replace_callback($pattern, '_print_rewrite_urls', $html);

// if (drupal_get_installed_schema_version('print') > 7200) {
// Print 2.x
$meta = array(
'url',
'name',
'title',
'node',
);
print_pdf_generate_html($html, $meta, $filename, NULL, $orientation);
// }
// else {
// Print 1.x
// global $conf;
// $conf['print_pdf_page_orientation'] = $orientation;
// print_pdf_generate_html(array('node' => NULL), $html, $filename);
// }

exit;
}

Comments

djdevin’s picture

Thanks, I'm not sure why this doesn't work but it must be because it's not included.

I need to find another alternative to check the version of print.

jlongbottom’s picture

I am also having this issue and currently cannot view ANY certificates. I can, however, preview them.

My workaround is adding this to the first line of the function, but its not a good solution either:

include_once DRUPAL_ROOT . '/includes/install.inc';

I would suggestion picking 1 version of print and making it a dependency rather than doing this unnecessary check every time.

djdevin’s picture

Status: Active » Needs review

I changed the detection from drupal_get_installed_schema_version to a simple function_exists for a function that only exists in print 2.x.

Please try the latest dev branch.

djdevin’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

change