nodeapi->view shouldn't add anchor tag when there are no attachments

case 'view':
  foreach ((array)$node->attachments as $attachment) {
    if ($attachment['working']) {
      $file = module_invoke('filemanager', 'get_file_info', $attachment['fid']);
      $workingurl = str_replace('&', '&', module_invoke('filemanager', 'url', $file, TRUE));
      $activeurl = str_replace('&', '&', module_invoke('filemanager', 'url', $file, FALSE));
      $node->body = str_replace($activeurl, $workingurl, $node->body);
      $node->teaser = str_replace($activeurl, $workingurl, $node->bteaser);
    }
  }

  // If this is not a teaser add our attachment list to the end of the body
  if (!$teaser) {
    $node->body .= '<br /><a name="attachments"></a>' . theme('attachments', $node);
  }
  return;

should be some check to see if there are attachments

Comments

ccourtne’s picture

Status: Active » Closed (duplicate)

Duplicate of an already closed issue.