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.
I'm not sure if this is a new feature of a bug.
Previously (D6), when I was writing an article with a teaser, only the second part (everything after the teaser break) was showing in the article page. Now (D7, tested stable and dev version, CKEditor 3.6.6.1, 4.0.1 & 4.0.2), the teaser is shown in the article page.
Is there a way to filter out the teaser when showing the article page?
I need a work around for this. I will post it here when I will find one.
Comments
Comment #1
TwoDI originally assumed you had upgraded a site from D6 to D7 and noticed issues with teasers in existing content. After reading your summary again, I realized that assumption may be wrong, so forgive me if much of this isn't relevant.
The teaser/summary functionality is pretty broken in D6 and many problems stem from the Core code assuming the {node_revisions}.teaser field is always an exact copy if the begining of the {node_revisions}.body field. If it's not, Drupal [6] will fail to remove the teaser from the main contents when the desire is to not show it. The problems are mainly with auto-generated teasers/summaries, but can be accidentally reproduced using manually inserted
<!--break-->
comments. I think any code attempting to perform node upgrades from Drupal 6 to 7 would face the same issues when trying to move teasers to the new "Long text with summary" field types, which would be the equivalent of the old node body "field".From what I can remember, I have not seen this issue with content produced in D7, which would make sense, since the teaser/summary is now a sub-value and always stored separately from the main field contents.
There are still issues with using Wysiwyg module together with that type of field though, but that's been worked on in #741606: Teaser splitter / text fields with summary support.
One workaround I've used before is having a separate Teaser field and not using the teaser/summary functionality provided by Drupal Core.
Please also see the Core issue #221257: text_summary() should output valid HTML and Unicode text, and not count markup characters as part of the text length as we can't fix this in Wysiwyg without also fixing Core.
Comment #2
gaellafond CreditAttribution: gaellafond commentedThanks for your workarounds but they are unrelated. I already had a look at those issues before posting this one.
The issue is not related to D6, nor auto generated summary. I did 3 new fresh install with different combinations of version of D7 / WYSIWYG module / CKEditor and the problem is always present. I'm not migrating anything yet, I'm just trying to create a simple article with a teaser, using the teaser break button of CKEditor.
When I create the following article:
then I go to the article page, instead of getting this:
I get this:
The teaser has not been stripped out. This bug was not present in D6.
NOTE: If I look at the source, I can see that the HTML comment <!-- break --> is present.
We can clearly see that the "body_summary" field has not been filled in the DB, everything is in the "body_value":
This occur with a vanilla install of D7 with WYSIWYG + CKEditor, nothing else. The problem occur 100% of the time.
Comment #3
TwoDOh, I forgot to mention that D7 always displays the summary with the main content if you only insert a
<!--break-->
comment. To not have it show the summary, you must put it in the separate "Summary" field you get after clicking "Edit Summary" (that's where there's currently no WYSIWYG editor available and what #741606 is about).If there's a value in that field, it takes precedence and the
<!--break-->
comment is ignored (not actually removed from the content though). The changes from D6 are mentioned on http://drupal.org/update/modules/6/7#body_teaser_fields but the consequences of the "The data entry form processing rules for the new Summary and Full text formatter is:"-section aren't that obvious at first.Comment #4
gaellafond CreditAttribution: gaellafond commentedThank you! That's exactly what I was talking about. I didn't notice the "edit summary" link. I was concentrated on the processing, not the entry...
Thanks again, I had a feeling it was something simple...
Comment #5
TwoDGood we got that sorted out. I wish all bugs and support request could be like this, would give me more time to actually code. ;)