Call to undefined function drupal_get_installed_schema_version()

Created on 18 January 2013, almost 12 years ago
Updated 26 August 2024, 3 months ago

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;
}

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.71.5 2024