When the View Type is set to Full Nodes, and the node's teaser is not equal to the full node, a "read more" link is shown in the node's links, even though the full node is displayed in the view.

The root of the problem seems to be in function theme_views_view_nodes. The output is generated by function node_view (from node.module) which invokes function node_prepare, which assumes we want a "more" link if $node->teaser is shorter than $node->body.

I don't know how to override this in an elegant way... Anyone???

Comments

merlinofchaos’s picture

Status: Active » Closed (won't fix)

Oh how lame is that! I'm not sure I have a good answer for that either. You'd think readmore would only be shown if $teaser == true.

I think this may be a bug in Drupal.

A workaround might be to override the theme function and prior to the node_view, do $node->teaser = $node->body.

I don't see a good way for Views to fix this, though. :/

Scott’s picture

I patched node.module and the problem seems to be fixed...

Around line 556, Change

function node_prepare($node, $teaser = FALSE) {
  $node->readmore = (strlen($node->teaser) < strlen($node->body));

to

function node_prepare($node, $teaser = FALSE) {
  $node->readmore = ($teaser && strlen($node->teaser) < strlen($node->body));