$node->readmore always true because it compares filtered teaser with unfiltered body.
| Project: | Excerpt |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
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.
| Attachment | Size |
|---|---|
| excerpt-readmore.patch | 1.23 KB |

#1
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".
#2
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.
#3
This has been committed.
#4
Automatically closed -- issue fixed for two weeks with no activity.