Hello,

At the moment, the module always always displays the forward link for comments.
The code is:

function forward_link($type, $node=0, $main=0) {
  if (user_access('access forward') && (variable_get('forward_form_type', 'link') == "link") && variable_get('forward_display_'. $node->type, '1')){

Now... for comments, $node->type is empty. So, effectively, the module checks the variable 'forward_display_', which is empty, and therefore '1' is taken as a default.

Ideally, the module should have a config option for comments.

Unless I am missing something, which is very possible.

It's not urgent for me, because I just manually added an entry in the "variable" table: 'forward_display_'.

But still...

Merc.

Comments

seanr’s picture

Status: Active » Postponed (maintainer needs more info)

Look at line 561 through 599:


/**
 * Generate links for pages
 */
function forward_link($type, $node=0, $teaser=0) {
  if ('comment' == $type && !variable_get('forward_display_comments', '1')) {
    return;
  }
  
  if (($type == 'node' || $type == 'comment') && user_access('access forward') && (variable_get('forward_form_type', 'link') == 'link') && variable_get('forward_display_'. $node->type, '1')) {
    $links=array();
    if (($type == 'system')) {
      // URL, page title, func called for page content, arg, 1 = don't disp menu
      menu('forward', t('Email this page'), 'forward_page', 1, 1);
    }

    // This var is set in the settings section under the admin/modules/forward section
    // It shows 'email this $nodetype' or 'email this page'
    $forward_link_type = variable_get('forward_link_type', 0);
    if ($forward_link_type) {
      if ($type == 'comment') {
        if (variable_get('forward_display_comments', 1)) {
          $forward_link_type = 'comment';
          $links[] = l(t("email this %type", array('%type' => $forward_link_type)), "forward/$node->nid&cid=$node->cid", array('title' => t('Forward this comment to a friend'), 'class' => 'forward-page'));
          return $links;
        }
      }
      else {$forward_link_type = node_get_types("name", $node);}
    }
    else $forward_link_type = t('page');

    if (!$teaser || variable_get('forward_display_teasers', 0)) {
      $links['forward_links'] = array(
        'title'      => t('Email this !type', array('!type' => $forward_link_type)),
        'href'       => "forward/$node->nid",
        'attributes' => array('title' => t('Forward this page to a friend'), 'class' => 'forward-page'));
      return $links;
    }
  }
}

In particular, line 565 which should read as follows:

if ('comment' == $type && !variable_get('forward_display_comments', '1')) {

If you do not see that, please update your copy. That variable gets set in admin/settings/forward.

seanr’s picture

Is it still doling this? I think I fixed this in response to another issue (gotta hate duplicates, LOL).

mercmobily’s picture

Hi,

Sorry about this. I have bugs that are open forever as well...
Will investigate it and let you know!

Merc.

john.oltman’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)