I've just upgraded to 4.6 from 4.5.2. On my front page and on taxonomy pages as well, every single post, regardless of node type, has a 'Read More' link, even where there shouldn't be one, since all the content was already displayed. This didn't happen in 4.5.2, which displayed the link only if there actually was more content.

CommentFileSizeAuthor
#2 excerpt_0.patch353 bytesPermanently Undecided

Comments

Permanently Undecided’s picture

Project: Drupal core » Excerpt
Version: 4.6.0 »
Component: node system » Code

I realized it might have something to do with the excerpt module, and indeed once I disabled that, everything started working properly again. Filing this as an excerpt.module bug.

Permanently Undecided’s picture

StatusFileSize
new353 bytes

The attached patch fixes the problem for Drupal 4.6.0.

However, if the teaser is longer than the body, no 'read more' link is displayed (it currently is, instead).

If somebody else has a better idea on how to fix the problem without the mentioned drawback, please share! It'd be appreciated.

crisdias’s picture

The problem seems to be that while $node->body is stored in the database as entered in the form, $node->teaser has all filters applied (specially line-breaking).

So, for example, while body will only have \n, teaser will have <P>, <BR>, etc.

Geary’s picture

There is a fix for this here:

http://drupal.org/node/18571

Grab the latest patch or pre-patched excerpt.module from that issue (the geary-2005-09-15... versions) and you should be in good shape.

markus_petrux’s picture

I have also observed the problem reported in this issue. When the excerpt module is active all nodes in homepage have the 'read more' link.

Since the excerpt module doesn't touch node data at 'view' time, I believe it is better to remove the alteration of the readmore property of the node. I did the following and it seems to work perfectly:

function excerpt_nodeapi(&$node, $op, $arg) {
  switch ($op) {
    case 'validate':
      if (trim($node->teaser) == '') {
        $node->teaser = node_teaser($node->body);
      }
      break;
    case 'view':
//      $node->readmore = $node->teaser != $node->body;
      break;
  }
}
hayesr’s picture

Version: » 6.x-1.x-dev
Status: Needs review » Closed (fixed)

I believe this problem no longer exists in the latest version. Please submit a new issue if it persists in another version.