Hi there,

I'm running Drupal 5.21 and print 4.9 and when I activate the module, I get this error on all of my pages:

Fatal error: Call to undefined function print_settings_default() in /home/cnotes/public_html/themes/platform/template.php on line 698

Here is the code around 698:

/**
 * Format the Printer-friendly link
 *
 * @return
 *   array of formatted attributes
 * @ingroup themeable
 */
function phptemplate_print_format_link() {
  $print_settings = variable_get('print_settings', print_settings_default());               <-------------- Line 698
  $text = t('Print');
  $img = base_path() . drupal_get_path('module', 'print') .'/icons/print_icon.gif';
  $title = t('Display a printer-friendly version of this page.');
  $class = 'print-page';
  $format = _print_format_link_aux($print_settings['show_link'], $text, $img, $title, $class);

  return array('text' => $format['text'],
               'html' => $format['html'],
               'attributes' => $format['attributes'],
              );
}

Any guidance would be greatly appreciated as I've had this module working before, but when I upgraded my Drupal versions, it no longer works and my users are requesting to have it back.

Thanks!
-Chris

Comments

jcnventura’s picture

Status: Active » Fixed

Hi,

The function print_settings_default() was removed after I stopped using an array to store the print settings. You are probably using a really old version of the module, as I don't see any reason in the above code to define your own print_format_link function.

See http://drupal.org/node/190173#themeicon for a current version of the above code.. However, if all that you're doing is to replace the "Printer-friendly version" text with "Print", there's a setting in the admin/settings/print/html/strings form where you can replace it without having to do it in code.

João

clkeenan’s picture

Status: Fixed » Active

So I changed the code to the code in the link you provided and now I get this error:

Fatal error: Cannot redeclare theme_print_format_link() (previously declared in /home/cnotes/public_html/sites/all/modules/print/print.module:556) in /home/cnotes/public_html/themes/platform/template.php on line 729

Sorry to bug you again, but I'm really not sure how to proceed from here.

Thanks so much!
-Chris

jcnventura’s picture

Status: Active » Fixed

You can't call it theme_print_format_link(), but rather phptemplate_print_format_link(), as correctly defined in the initial post.

João

Status: Fixed » Closed (fixed)

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