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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

paddy_deburca’s picture

FileSize
571 bytes

The 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.

paddy_deburca’s picture

Status: Active » Needs review

Just to signal that a patch exists and needs review.

Paddy.

liquidcms’s picture

great.. thanks i'll try it out.

Dries’s picture

Status: Needs review » Fixed

Works for me. Code looks good. Committed.

m3avrck’s picture

Status: Fixed » Reviewed & tested by the community
FileSize
1.08 KB

This 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.

m3avrck’s picture

Priority: Normal » Critical

This broke core functionality.

DaveNotik’s picture

I think this may be related to:

http://drupal.org/node/53235

--D

DaveNotik’s picture

+1 on .patch by m3arvck. Fixed my issues.

m3avrck’s picture

FileSize
1.06 KB

New patch after talking with dorpy.

DaveNotik’s picture

+1. Works.

chx’s picture

first two hunks cosmetic only but yes, patch is good to go.

drumm’s picture

Status: Reviewed & tested by the community » Fixed

comitted to HEAD

Anonymous’s picture

Status: Fixed » Closed (fixed)