Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
honest i looked for this.. but couldn't find it... I am using a CVS d/l of 4.7 from about 2 weeks ago.
pretty sure if i have a page like this:
<! -- b r e a k -->
and then some more content here
that my teaser should end up being blank... as opposed to the entire body including the break.
Comment | File | Size | Author |
---|---|---|---|
#9 | node.module_36.patch | 1.06 KB | m3avrck |
#5 | node.module_35.patch | 1.08 KB | m3avrck |
#1 | node_46.patch | 571 bytes | paddy_deburca |
Comments
Comment #1
paddy_deburca CreditAttribution: paddy_deburca commentedThe problem stems from the fact that strpos restuns a boolean false if nothing is found - of course this boolean false has the same numeric value as the first position in a string i.e. zero
This patch compares the result of strpos as a boolean and allows a delimiter to be in position zero.
Paddy.
Comment #2
paddy_deburca CreditAttribution: paddy_deburca commentedJust to signal that a patch exists and needs review.
Paddy.
Comment #3
liquidcms CreditAttribution: liquidcms commentedgreat.. thanks i'll try it out.
Comment #4
Dries CreditAttribution: Dries commentedWorks for me. Code looks good. Committed.
Comment #5
m3avrck CreditAttribution: m3avrck commentedThis patch forgot to take into account that if strpos() doesn't find anything, it returns FALSE. This is the default case, with auto teaser generation and when you compare $delimiter >= 0, in this case, $delimiter === FALSE and you don't get your auto generated teaser.
To fix this, we should check to make sure $delimiter is actually an number, indicating a string postion, and if so, use strpos(). Otherwise, if it isn't a number, then no
<!--break-->
was found.Comment #6
m3avrck CreditAttribution: m3avrck commentedThis broke core functionality.
Comment #7
DaveNotik CreditAttribution: DaveNotik commentedI think this may be related to:
http://drupal.org/node/53235
--D
Comment #8
DaveNotik CreditAttribution: DaveNotik commented+1 on .patch by m3arvck. Fixed my issues.
Comment #9
m3avrck CreditAttribution: m3avrck commentedNew patch after talking with dorpy.
Comment #10
DaveNotik CreditAttribution: DaveNotik commented+1. Works.
Comment #11
chx CreditAttribution: chx commentedfirst two hunks cosmetic only but yes, patch is good to go.
Comment #12
drummcomitted to HEAD
Comment #13
(not verified) CreditAttribution: commented