I have a node where the teaser and body are the same. A "read more" link is not desirable in this circumstance.

This is happening because the teaser is filtered but the body is not. See this dpm output for the case:

teaser: <p>The world is full of bullies and frauds.</p>
body: The world is full of bullies and frauds.

In my previous patch at #235382, I made the comparison at $op = 'load' and it worked fine, but looking at that a little more closely, it was just allowing the normal node_view calculation for the readmore property to rule. If the teaser were longer than the body, you'd not see the read more link.

This patch fixes it by calculating readmore on load and storing the boolean in a static variable for the excerpt_nodeapi function. Then in view, it overwrites the readmore property with the stored value.

CommentFileSizeAuthor
#2 excerpt.module.patch1.36 KBsmk-ka
#1 excerpt.module.patch1013 bytessmk-ka
excerpt-readmore.patch1.23 KBAnonymous (not verified)

Comments

smk-ka’s picture

Status: Active » Needs review
StatusFileSize
new1013 bytes

I'm not sure if nodeapi is always called in this set order, ie. if nodes are always loaded and immediately viewed thereafter, with no other node load inbetween. Let's play safe and store the readmore status in a node property, which we copy over on "view".

smk-ka’s picture

StatusFileSize
new1.36 KB

Revised patch adding support for nodes that were saved with earlier versions of excerpt (when teasers were still generated on load). I know it's a bit offtopic, however you seem to be interested in getting out a stable release of this module, so I just put it here.

smk-ka’s picture

Status: Needs review » Fixed

This has been committed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.