Hi All,

I have been having this issue for a while, that is when I install the CKEditor Module (11th July 2010 Dev Release) and CKEditor (3.3.2), I create or edit a node, save it and when viewing the teasers/trimmed versions, for example on the front page, only the title is shown.

I know others have had similar issues before, but those threads are now closed. I have this issue on multiple sites so thought I would try from a fresh install and see what happens. Let me walk you through what I ahve done so far. I

1. Fresh install of drupal.
2. Created posts and promoted to front page - which works and shows trimmed posts fine
3. Installed CKEditor
4. Created a new page, promted to front page - only title is shown
5. Created a new page with full HTML input selected, promted to front page - only title is shown

I have cleared my cache (browser and drupal), tested on FF 3.6.8 and Safari and get the same problem. I am assuming as this has only been raised a few times, all automatically closed, that it is something I am doing wrong and not a bug.

Can anyone shed any light on what I am doing wrong?

Regards,
Nick

CommentFileSizeAuthor
#6 ckeditor-debug.png173.86 KBmarketter

Comments

mjohnq3’s picture

I have to agree, it's flaky. If I type a paragraph, it's fine. If I type a second paragraph, it's still fine. But, if I backspace to join the two paragraphs into one, the teaser is empty. Cutting and pasting a couple of paragraphs of text also results in an empty teaser. In both cases the teaser is empty both in the preview and after the node is saved. Not sure what's going on here.

nickbits’s picture

Thanks for the reply. At least I know it is not just me with the issue. I know putting line breaks in manually seems to work, but you shouldn't, and never had to do that.

juc1’s picture

Just to add - I have had the same or similar problem. If I bypass CKE and switch to plain text editor the teaser will appear correctly. If I later edit the same post in CKE, on re-publication the teaser has disappeared. If I create a new post in CKE I have many times got node title only and no teaser.

geoman’s picture

Have had the same problem and discovered that CKeditor was automatically inserting a paragraph break at the beginning of every post, and that's what caused the teaser to disappear. I went back and deleted the break and the teaser reappeared. That's why editing in plain text helps—you can avoid the automatic insertion of the paragraph break and/or delete if it has appeared. But now a new problem: why are the paragraph breaks appearing in the first place? I have turned off the line break converter (input filter setting) and tried various CKeditor settings, but no luck. Anyone know how to stop these automatic paragraph break inserts?

nickbits’s picture

I see what you mean, but CKEditor use to put this in and it was never a problem before. So the question then is, what has changed? I ahve disabled and uninstalled CKEditor, and gone back and tried plain text but with paragrpah tags and it doesn't show the teaser.

Before I do anymore digging, would someone else be kind enough to double check this for me and make sure it is not me. If it is the case then I doubt it is a CKEditor issue.

marketter’s picture

StatusFileSize
new173.86 KB

I am noticing this as well with a new install of Drupal and CKeditor. From what I can tell if the first paragraph of the node is longer than the teaser trim length the teaser doesn't show on the default homepage. And as you would guess, if the first paragraph is under the trim length the teaser shows up fine.

Also I could not get the 'insert teaser break' to work at all. I clicked both inside a paragraph and after one and neither one worked. In order to properly control the teaser for a node I had to click 'Switch to plain text editor' and use the default 'split summary at cursor' option. This works but if I then went back to the 'rich text editor' the node edit textarea bugged out and nothing was shown but the CKeditor buttons and a blank area under (see attached screen shot).

marketter’s picture

Looks like this is a duplicate of: http://drupal.org/node/814970

I downloaded the DEV copy of the module and the insert teaser button worked fine, however, if the first paragraph is still longer than the trim length the teaser doesn't show.

nickbits’s picture

I dont think it is a duplicate, if you look at my first post, I am not reporting an issue with the break but with the generation of a teaser. I have no problem nor reported one with the insert break. What I reported and still have issues with is this.

I create content with CKEditor, no matter how long or short, no teaser is shown. Without CKEditor this works fine.

The teaser break that was refereed to earlier is not a problem, not one I reported when creating this issue. However it is the paragraph tags that appear to be the issue.

malcolm8’s picture

thought it might be related to the "Story" content type so I remade that content type and deleted the original. Both Page and Blog content types behaved ok. Noticed the same disappearing teaser in the Newsletter Issue content type so I remade that one also, and deleted the original.

Then I edited my test "Story-2" post - and the teaser disappeared from the front page again.

Another thing I noticed was that if I set the teaser length to 1400 characters it would work, but at anything less, the teasers would disappear.

Sure would like to have a solution to this!

mjohnq3’s picture

One solution is to use the Wysiwyg module (http://drupal.org/project/wysiwyg) configured for CKeditor. Since I switched to that I haven't had any problems.

DrippelDrop@drupal.org’s picture

I tried the wysiwyg module and had lots of trouble with the ckeditor. The pure ckeditor is much better. But! the teaser-bug is annoying. I can help myself by adding the teaser-break manually, but for my users this is a pain.... I am using the latest dev and the newest 3.4 version of ckeditor. Wish this bug would be fixed sooner than later ;(

kriskhaira’s picture

Hi geoman. I'm having the same issue with CKEditor (6.x-1.1) and Drupal 6.17. An empty paragraph break gets inserted at the beginning of the text in CKEditor. Have you solved this?

geoman’s picture

Hi kriskhaira,

Yes, I think I did solve it. In CKeditor set up, in Cleanup and Output, I just changed the "enter mode" ("Set which tag CKEditor should use when [Enter] key is pressed"): Instead of the "p" break I changed it to "br" and this seems to be doing the trick. Learned this from http://drupal.org/node/671668, #26. Good luck.

xplan’s picture

My solution
in Administer › Site configuration › Input formats

do not check Line break converter

it's ok for me

kriskhaira’s picture

geoman, using br instead of p is unacceptable for me. P tags are more semantic for that sort of use.

xplan, this happens even when all filters are disabled.

Raf’s picture

I've tried all suggestions above, but to no avail. The button for adding a teaser break doesn't even work! Firebug gives me this error:

l.getAttribute is not a function
[Break on this error] var s=y.createBookmark(),t=s.startNode...''};if(n)s._cke_real_element_type=n;

Also, if I open a node which has the teaser break in it, I can't click the input field. That field's completely empty, too.

When I switch to "source", it shows everything just fine. If I switch back, everything's gone again, and on top of that, the editor's disabled. The text "switch to rich text editor" remains, though, and if you click that, another instance of the editor appears right underneath the first one, as if it's a multivalue field.

Dreamlinker’s picture

CKEditor does do some strange things to Teasers.

For me, when using a Lorem Ipsum text, he just broke the text somewhere after a sentence, but in de source it didn't show why, and for some texts it didn't break at all. Now we discovered a strange tag which seems te be a leftover from our text which had been made with the default editor before installing CKEditor

<!--break-->

and now, wherever we put this comment (in the source, not in the rich text obviously) it separates the teaser from the main body, and only that what stands before the comment is in the teaser.

Hope this helps anybody.

mhugos’s picture

Similar issue: I'm using CKEditor 6.x-1.x-dev on a Drupal 6.17 site. The site-wide teaser setting is 200 characters.

The problem came down to the whitespace after the <p> tag that CKEditor puts in. The whitespace is actually three hex characters for CR, LF, HT (carriage return, line feed, horizontal tab.) When the whitespace is removed in plain text mode, it's fine, but editing in plain text mode isn't acceptable for site editors. This post adds code to ckeditor.config.js in order to set some options. Based on this, I went to my CKEditor profile (Site configuration / CKEditor / Profiles / Edit appropriate profile) where these options are listed, under "Cleanup and Output" / "Use custom formatting options." I made sure YES was ticked, and set the options as follows:

NO - indent the element contents
YES - line before the opener tag
NO - break line after the opener tag
NO - break line before the closer tag
YES - break line after the closer tag
NO - indent the

 element contents

Now the editor no longer puts in CR, LF, HT and teaser breaks work.

However, I've noticed it's breaking at an arbitrary number of characters.  I think what's happening is that it's counting HTML tags (e.g. it adds three char's for  <p>) and entities (e.g. adding six char's for &quot;) even though these are invisible when rendered on the page.  So, it's breaking at 200 characters, but counting non-visible characters in the tally.

Raf: In case you haven't already found this, http://drupal.org/node/814970  addresses the Break button not working.  This resolved it for me, but only after I cleared my browser's cache -- very important.
parasox’s picture

Category: support » bug
Priority: Normal » Major

I'm also having this issue. Even a single long paragraph ends up with a blank teaser, some kind of character limit. If I reduce the number of characters, the teasers show up again.

I'd consider this a major bug, and people shouldn't have to setup this module in some special way to resolve this. Imagine doing so across a large multisite installation!

jcisio’s picture

Status: Active » Closed (works as designed)

I'm sorry, but it is the expected Drupal behavior. Use a WYSIWYG editor or not, all characters are counted. If you have an image at the beginning of a post, it counts easily for 100 characters.

Workaround? I'm not sure, but if you don't use HTML in your teaser, then you can set for example 1000 characters for teaser, and in your template, you strip out all HTML tags, then cut the first 200 remaining characters.

parasox’s picture

Status: Closed (works as designed) » Active

How is it expected behaviour when a body over X number of characters gets cut to ZERO characters in a teaser? Kind of obliterates the point of having a "read more" for use in teasers?

For my use case, I do not have any images, or HTML tags except for the opening

and closing

in my body, and I'm experiencing blank teasers.

As of now, my 'workaround' is to keep my body text under a certain number of characters.. And setting a high number of characters to show in my teaser isn't really a teaser at all.. That would basically mean that my entire posts are showing up as teasers..

I don't see how this isn't an issue? I won't re-open if someone who has made commits to this module tells me it's expected behaviour and how to resolve it. Teasers should show a portion of my body text, that's the whole point of a teaser...

jcisio’s picture

Post your HTML code here, we'll know why the teaser is empty, then we'll know how to fix it.

parasox’s picture

Sorry I forgot to add the code tag here so my message got garbled.

The only code that's being produced (I see this by clicking the "source" button that ckeditor provides) is an opening <p> and closing </p>. I should also mention there is only one fair sized paragraph, with no line breaks, and only a single paragraph tag.

It's text only, with absolutely no other formatting within.

If I cut a few lines off the text and re-save, the teaser is displayed.

jcisio’s picture

Don't hesistate to post your "one fair sized paragraph, with no line breaks, and only a single paragraph tag" here, or in some pastebin. And describe how to reproduce the bug, step by step.

parasox’s picture

I usually can't/don't do that, because I run adult websites, but I'll concede and do it in a pastebin.

NOTE: This link contains adult content!!!!

http://pastebin.com/meSieBjg

Also of note, I use "DrupalFull" in the CKEditor toolbar settings, as well as "CKEditor Default" in the CSS settings.

My drupal post settings are at the default 600 characters.

It seems that sometimes when I edit save I get the extra non breaking space, other times I don't and I only get the P paragraph tag. Shrug. Both produce no teaser either way.

jcisio’s picture

Priority: Major » Normal
Status: Active » Closed (works as designed)

Ok I understand it now.

When Drupal generates the teaser, it tries to break it at the end of a paragraph. You have two paragraph, with the first one only a space. The second paragraph is longer than 600 characters, thus it is removed by Drupal.

Solution? Remove the first blank paragraph. If the first paragraph is longer than 600 characters, it will be cut at 600 characters.

jcisio’s picture

parasox’s picture

Status: Closed (works as designed) » Active

Wish it was that easy jcisio.. As I mentioned, sometimes it puts the break, sometimes it doesn't. I just edited, removed the space it inserted, re-saved, and it took out the space.

Still no teaser. Only the P tag as I previously said.

hhttp://pastebin.com/w9S5Yt1J

Having fun yet? ;) Thanks for your help btw!

jcisio’s picture

Status: Active » Closed (works as designed)

You have multiple problems which are in other issues:
- #878188: CKeditor automatically inserting &nbsp; at the beginning of every post that I gave above
- #707878: Where has the format source option gone with your output formatting. If you use a richtext editor, don't enable the "Line break converter" in your filter, or <p>[newline]... text ...</p> will be converted to <p><br />... text ...</p> and the first "paragraph" is actually empty.

I hope this reply solves the "empty teaser" question.

parasox’s picture

I wasn't even using a filter I don't think, I had it all set to Full HTML.

Anyways I fixed the issue in my case. All I did was go to Modules and uncheck "CKEditor" and voila.. ;)

I don't think I was having a p br issue either, as when I viewed the source at browser level it just had a p tag.

From my limited experience, this module wasn't installed normally like other modules (/ckeditor/ckeditor/ckeditor/ was it?) and therefore wasn't easily upgradeable either, and didn't just let me type a simple paragraph without issues. Furthermore, inserting images which was my original use for a rich text editor took way more time and clicks than simply adding them in image fields.

Not for me. Wordpress dominates Drupal in this area as far as I'm concerned. Hopefully they'll have a nice easy solution for Drupal 8.

Thanks for your help though jcisio, your efforts to help are appreciated. Now if only you could browse through the rest of my issue queue... ;) hehe

jcisio’s picture

1. You use the "Full HTML" format, and in Drupal 6 this format has indeed 4 filters enabled by default.

2. There are too many ways to fix this issue, I don't understand why you don't try it:
- Disable the "Auto line break" filter in your format
- Or, in CKEditor setting, under "Cleanup and Output" change Use Custom Format Options to "Yes" and deselect "break line after the opener tag."
- Or, fix the bug in the issue whose link was given below

3. This module allows you to install in sites/all/modules/ckeditor and put the editor in sites/all/libraries/ckeditor. I don't have any problem upgrading: drush -y up ckeditor and that's all. If I hadn't drush, I upgrade with:

cd sites/all/modules
wget http://ftp.drupal.org/files/projects/ckeditor-6.x-1.2.tar.gz;
rm ckeditor;
tar -xzvf ckeditor-6.x-1.2.tar.gz

And in D7 modules are upgradable through web interface. Well, it's too off topic now.

pog21’s picture

I don't find this working as designed. I tried the above, but unfortunately none of it has fixed the issue for me. I'll try to explain:

* Input format for content creation is 'filtered html'.
* I am displaying teasers in a block with views.
* If I use ckeditor to insert the text, it inserts paragraph tags, making the code look like this:

<p>Body text here... </p>

* With auto line break disabled, the teaser shows, but there are no paragraphs in the full node view - just a single, long block of text. With auto line break enabled the full-view is fine, but the teaser vanishes.
* Deactivating "break line after the opener tag" allows teaser to appear, but seems to replace p tags with br tags, which is not what I want. Activating it again makes teaser disappear.
* The only ways I have found to make the teasers appear correctly are to,
a) Use the plain-text editor only, without any paragraph tags, or
b) to insert a teaser break manually with ckeditor.

Unfortunately, my site allows users to submit their own articles, and they always forget to add the teaser break, so it's not much of an option.

Anyone got any further with this?

Michsk’s picture

I've got exactly the same issues as above when trying to fix this.

And i as well have the same kind of users as above.

Michsk’s picture

Priority: Normal » Major
Status: Closed (works as designed) » Needs work

changing status since it does not work as desired, but needs work.

MBroberg’s picture

Definitely a teaser issue for me too.
Any body text that has <!--break--> in it causes the whole ckeditor area to go blank. Text still exists, because it shows up in the node, and the teasers show up on the appropriate page views, but nothing in the edit area. I tried this in multiple themes.
I put the teaser break right at the beginning of the text and it all disappeared. Doesn't seem to matter where it is placed.
Removing the <!--break--> brings the editor back to normal function. I am now using the Deck module to create a separate CCK teaser, which stores data in the teaser so that other modules (like Views) can still use teaser data.
That works fine.
Seems like the editor is not interpreting <!--break-->

dczepierga’s picture

Status: Needs work » Closed (works as designed)

I check this on fresh drupal with last DEV version of CKEditor module with CKEditor library in version 3.6 and for me everything works fine.
I closed this issue because it's to much OT here. If u find any bugs pls create new issue with as much details as u can give - it's really help to reproduce this and fix it later.

Greetings

gaëlg’s picture

In CKEditor setting, under "Cleanup and Output" change Use Custom Format Options to "Yes" and deselect "break line after the opener tag."
worked for me. But bodies and teasers have to be rebuilded. I had to update the database with something like :

    $result = db_query("SELECT * FROM {node_revisions}");
    $pattern = "/^<p([^>]*)?>[\s\n\r\t]+(.*?)<\/p>(.*)$/";
    $replacement = '<p$1>$2</p>$3';
    while ($line = db_fetch_object($result)) {
      if (preg_match($pattern, $line->body)) {
        dpm($line->body, 'old body');
        $new_body = preg_replace($pattern, $replacement, $line->body);
        dpm($new_body, 'new body');
        dpm($line->teaser, 'old teaser');
        $new_teaser = empty($line->body) ? '' : node_teaser($new_body, $line->format);
        dpm($new_teaser, 'new teaser');
        //db_query("UPDATE {node_revisions} SET body='%s', teaser='%s' WHERE vid='%s'", $new_body, $new_teaser, $line->vid);
      }
    }

Do NOT use this piece of code if you don't understand what it does.

adjperez’s picture

I am suffering the issue commented here.

I use "Wysiwyg profiles" and if I edit ckeditor, I can not find the option mentioned in #37 "Use Custom Format Options"

Any workaround in that case?

mkesicki’s picture

@adjperez do you use WYSIWYG module ?
Guys please don't write in this ticket. Please open new one if there is problem with Teaser and CKEditor module.

adjperez’s picture

Sorry but I use WYSIWYG module, not the independent CKEditor

norman.lol’s picture

I can confirm #18! Saved my day!