When I use this module with my CCK nodes, the Description tag that shows up on the page also has the node's Title tacked onto it. E.g., instead of the desired:
<meta name="description" content="This is the description" />
I get
<meta name="description" content="This is the TitleThis is the description" />

I changed description.inc to work around this, but I'm sure there's a better way than this. Here's what I changed in description.inc (existing all-comment lines removed for brevity):

BEFORE:

case 'node':
  $node = node_load($ids[0]);
  if ($node && node_access('view', $node)) {
    if (filter_format_allowcache($node->format)) {
      $node = node_build_content($node, TRUE, FALSE);
      $content = drupal_render($node->content);
      $node->teaser = $content;
      node_invoke_nodeapi($node, 'alter', TRUE, FALSE);
      $value = $node->teaser;
    }
  }
  break;

AFTER:

case 'node':
  $node = node_load($ids[0]);
  if ($node && node_access('view', $node)) {
    if (filter_format_allowcache($node->format)) {
      $node = node_build_content($node, TRUE, FALSE);
      // $content = drupal_render($node->content);		/* Commented out as no longer necessary */
      $node->teaser = $node->content['body']['#value'];		/* Changed from ... = $content; */
      node_invoke_nodeapi($node, 'alter', TRUE, FALSE);
    }
    $value = $node->teaser;		/* Moved this line OUTside the prior "if" statement's "then" code */
  }
  break;

Got a better way? Did I do something wrong? Thanks.

Comments

ardee-1’s picture

Addendum: this code change also fixed another problem I'd been having: the Description was also including text about the Fivestar ratings. I had had to turn off Fivestar for the teasers. But with this code change, I can put Fivestar back and the Description is unaffected.

ardee-1’s picture

There was at least one negative side-effect of what I did (above): the Fivestar ratings no longer appeared after the nodes. At least I think that was a side effect of this change, but I'm not really sure.

By the way, I also ended up commenting out this line:

node_invoke_nodeapi($node, 'alter', TRUE, FALSE);

because I don't see its purpose. (Is it actually modifying the node in the database? If so, why??)

Feedback appreciated!!

2c’s picture

AFAIK, node_invote_nodeapi is altering the node as presented to the site visitor, it isn't altering the database or making any permanent changes...it's on-the-fly node altering. Maybe this is the reason your fivestar widget isn't appearing after your node?

avpaderno’s picture

Status: Active » Closed (won't fix)

As the Drupal 5 version is not supported anymore, I am changing the status of this report.