Hello,

it looks like apart from 'full' and 'teaser' view modes, the print link cannot be displayed, indeed:

<?php
function print_ui_link_allowed($link, $args) {
  if (isset($args['view_mode'])) {
    $view_mode = $args['view_mode'];
    if ((($view_mode == 'teaser') && !variable_get('print_' . $link['format'] . '_link_teaser', PRINT_UI_LINK_TEASER_DEFAULT))
      || !in_array($view_mode, array('full', 'teaser'))) {
      // If the teaser link is disabled
      return FALSE;
    }
  }
  $link_allowed_func = $link['module'] . '_link_allowed';
?>

this

<?php
!in_array($view_mode, array('full', 'teaser'))
?>

systematically returns false for a custom view mode, so even though you define a custom condition using hook_link_allowed, it is never called...
and even though it would pass this check, module has to actually also implement hook_print_link and define its own table for

<?php
function print_ui_node_load($nodes, $types) {
...
$result = db_query('SELECT nid, link, comments, url_list FROM {' . $module . '_node_conf} WHERE nid IN (:nids)', array(':nids' => $ids))->fetchAllAssoc('nid');
?>

to pass.

that's quite heavy to simply display a basic print link...
please remove this part of the condition as it is very restrictive and does not correspond to the comment below (teaser link is disabled).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

miaoulafrite created an issue. See original summary.

miaoulafrite’s picture

Status: Active » Needs review
FileSize
743 bytes