The docs for node_teaser():
http://api.drupal.org/api/HEAD/function/node_teaser
say that it will return 'a teaser for a node body in a given format' if a $format is passed to it. However, it only checks $format for the prescene of the PHP eval filter, not others, such as the HTML filter. Shouldn't this work for any generic filter format that is passed in?
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | node_teaser_115912.patch | 397 bytes | gpk |
| #4 | node.module_20071026.patch | 525 bytes | stevenpatz |
Comments
Comment #1
Bevan commentedI think you misunderstood the documentation -- although, arguable it's not very clear.
Comment #2
Bevan commentedrelated: http://drupal.org/node/180425
Comment #3
catchNeeds a real patch in unified diff format:
http://drupal.org/patch/create
Comment #4
stevenpatzhere's a patch
Comment #5
gpk commentedChanged title to reflect the focus of this issue.
Related questions: is the fact that for PHP input format pages that actually contain PHP code the teaser is always the same as the entire body made clear to the end user? Also that Drupal tries to slice the main body text at a paragraph break to generate the teaser, and that multibyte characters count as multiple characters when calculating the teaser length. These probably belong in new issue(s). [edited]
Comment #6
gpk commentedHmmm not sure there is much actual improvement going on here :/ !!
Comment #7
gpk commentedPrevious patch no longer worked since documentation of node_teaser() had been updated. Here's a new one.
Comment #8
gábor hojtsyIMHO "in a given format" only means that you need to pass on the format (for checking for the PHP format). Otherwise teaser generation is the same in all formats.
Comment #9
gpk commentedAgreed ... I think the point it that "in a given format" does not add anything to "Automatically generate a teaser for a node body" - it only confuses, especially since the argument $format is clearly defined now in the documentation.
Comment #10
gábor hojtsyThanks, committed.
Comment #11
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.