The summary (teaser) was automatically split from the body....
| Project: | Table of Contents |
| Version: | 6.x-3.1 |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
howdy,
I use my drupal 6.13 site as a wiki, I have no use for summaries/teasers, etc...
I'm driving myself a little nuts here... I recently upgraded from TOC module from 2.2 -> 2.3, and started to notice strangeness with messages like so "A split summary was automatically created as site settings don't allow Table of Contents in summaries." and "Your summary was split from the body as site settings don't allow Table of Contents in summaries."
I then found this issues page = http://drupal.org/node/422144
I followed the suggestions from others there ^^^^^^^^^^^
Admin => Content Management => Post Settings => Length of trimmed posts: Unlimited
Admin => Site Configuration => Input formats => [Input Format Wiki] => Configure => TOC module selected ... => Configure => "Remove Table of Contents tags from teasers" is UNCHECKED, "Whether an automatic table of content should be added:" is "Do not automatically add a table of contents"
I kept seeing those messages anytime I would edit a node (that has Wiki input format w/TOC enabled), and make sure there was a <!--tableofcontents list: ul;minlevel: 1;maxlevel:5;--> section to call TOC... but I kept getting those messages "A split summary was automatically created as site settings don't allow Table of Contents in summaries." and "Your summary was split from the body as site settings don't allow Table of Contents in summaries."
Im under the impression I have teasers fully disabled? I don't have any desire to use teasers... so now that whenever I or any site user goes to edit a "wiki" node, #1 we see that there is now a summary/teaser, which requires us to manually each edit to click the button "Join Summary" which seems to disable the Teaser, and then #2 we have to add the TOC code <!--tableofcontents list: ul;minlevel: 1;maxlevel:5;--> again, and we notice some weird shit with there being TONs more data added to the node (I.e. the data is duplicated... I think this is happening once we click "split summary at cursor").
I then followed all steps @ http://drupal.org/project/tableofcontents and upgraded to TOC 3.1 (indeed I did remove the TOC directory before upgrading)... same story, I think a little different verbage now = EVERYTIME I add the TOC code <!--tableofcontents list: ul;minlevel: 1;maxlevel:5;-->, save the node, I get the message "The summary (teaser) was automatically split from the body as site settings does not allow table of contents in summaries. If you make any further changes, be sure to check the summary field to see if your changes apply there as well".
That then shows the Table of Contents when viewing the node normally, but once you goto edit it, I now again have a teaser/summary?? If I edit the node, "join summary", remove duplicate data, REMOVE any TOC code - i.e. <!--tableofcontents list: ul;minlevel: 1;maxlevel:5;--> - save it, I have NO PROBLEMS, I never see the summary/teaser again! but this solution does NOT allow me to use TOC! =(
what am I doing wrong? what is the proper way to completely disable teasers in my site, and make it so I can have a Table of Contents in my Wiki nodes like earlier TOC 2.2 usage? I really have no desire to see use summaries/teasers, nor see that message "The summary (teaser) was automatically split from the body as site settings does not allow table of contents in summaries. If you make any further changes, be sure to check the summary field to see if your changes apply there as well"... little help, purty please? =)
agentdcooper

#1
Agentdcooper,
So you played with this flag and it made no difference either way? (And I assume the Automatic feature was turned off)
'remove table of contents from teasers'
Thank you.
Alexis
#2
thanks much for the reply alexis! to answer your question, YES =(
I gave this a shot... viewed a page that I created with older version of TOC and was working perfectly, (remove table of contents from teasers = set to CHECKED) - upon clicking edit, and making adding a single character to the body, and saving my page - I get the message "The summary (teaser) was automatically split from the body as site settings does not allow table of contents in summaries. If you make any further changes, be sure to check the summary field to see if your changes apply there as well."
going back into EDIT on this page, sure enough there is now a teaser there, even though my site shouldnt even be using them...
so I revert back to the original version prior to my edit (I have revision module!), and again that message comes up = "The summary (teaser) was automatically split from the body as site settings does not allow table of contents in summaries. If you make any further changes, be sure to check the summary field to see if your changes apply there as well"! so even reverting back, it is modifying my reverts to now use a teaser (I have 2 seperate areas to edit the content on the EDIT page now - the teaser, and main content area... and a "join summary" button that seems to remove the teaser, only until I save it, and it comes back again).
UNCHECKING 'remove table of contents from teasers' and going thru the same process, the SAME THING happens! I think this may be a bug?
I love the changes, and the progress of the TOC module - but this is something that I can fix right? am I doing something wrong? everything worked with the older version of TOC (maybe I should revert? which I'd rather stay up-to-date honestly).
any other suggestions someone could throw my way?
#3
The code that adds the [toc] node in the teaser is triggered if the following is TRUE.
My guess would be that the name ('tableofcontents_remove_teaser_' . $node->format) is somehow wrong (i.e. $node->format is not what we would expect, or something of the sort.)
<?phpif (variable_get('tableofcontents_remove_teaser_' . $node->format, TRUE)) { ... }
?>
This is the flag named "Remove Table of Contents tags from teasers" in the interface.
Thank you.
Alexis
#4
AlexisWilke, again thanks for the help mate! I'm just not sure what u are suggesting here? What would be the way forward, in hopes of dropping support (the usage AT ALL) of teasers... so I can make 100% sure that this teaser will not get created/added even tho I have them disabled?
thanks for all help! I look forward to licking this!
#5
Agentdcooper,
What I mean is that if the flag 'remove table of contents from teasers' is set to FALSE (i.e. not checked) then there is no way the code can do anything to your teaser since it does not call the very function that does the work.
So if you're saying that it does anyway, I'm not too sure what's going on with your system. Other than maybe the flag is not saved in the database (in which case, when you go back to your setup, the flag should be selected [checked] again.)
One other thing could be that you change the setup for Filter A and are using Filter B in your test node?
Thank you.
Alexis
#6
I will give your suggestions a go - thanks for the help! I'll report back my results
#7
turns out I was confusing content type with input format!! I only set ONE input format with 'remove table of contents from teasers' as FASLE... my test node was being edited with the OTHER input format, hence my problem. all is good, sorry to even open this. thanks so much for the help - this is my own idiocy =)
#8
Wasn't sure if this should be in a separate issue. Different question about the same thing.
I do want summaries, but don't want users to have do deal with the split summary when editing. Seems like it would be possible to eliminate the split summary when the filter is in automatic mode. Any ideas what code I would modify to get rid of the summary splitting, and would you consider it for inclusion?
#9
#10
You already have a flag, named:
Remove Table of Contents tags from teaserswhich when unchecked makes the handling of the teaser disappear.
I don't think we need more than that.
See: tableofcontents/tableofcontents.module line 128
Thank you.
Alexis Wilke
#11
Yeah, I've been tracing through that code for much of the day, and I haven't quite understood the process.
It sounds like you're suggesting unchecking the "Remove the TOC from the teaser" flag. But unchecking it results in the TOC appearing in the teaser.
So, I do want to remove the TOC from the teaser. But as far as I can see, checking that setting also triggers the split summaries (the extra summary text at the top of the "Body" field during editing).
The split summaries are a UI mess and add unnecessary complexity to the editing process. It's also counter-intuitive, because the split summary is not specifically requested by the user (I'd call it "unexpected behavior" inconsistent with the Drupal standard behavior).
BTW, I am aware that I can eliminate the split summary by setting the "Post settings" as described above, but I want automated summaries - just not injected as extra text into the post edit form...
I can't figure out where exactly in the code the extra summary text is getting added to the node body.
#12
Kent,
Okay, got it 8-)
That's a Core feature, not a tableofcontents editor feature.
So even if you were to provide a patch, it would not work in this very module. Now I could put the patch along the module for people to install if they wish to do so.
Anyway...
modules/node/node.modules line 1530 (in v6.14) says: node/%/edit calls node_page_edit() in node.pages.inc
<?php/**
* Menu callback; presents the node editing form, or redirects to delete confirmation.
*/
function node_page_edit($node) {
drupal_set_title(check_plain($node->title));
return drupal_get_form($node->type .'_node_form', $node);
}
?>
And that makes me think, we may be able to short cut the showing of the teaser using the hook_form() callback. Then make sure the teaser gets added on the node_validate() or wherever we need to do that...
This could actually be a module by itself instead of being part of the table of contents module since others may benefit from the feature without the need/requirement to use the table of contents.
Thank you.
Alexis Wilke
#13
Another idea...
Since you're interested in the automatic teaser only, we should DELETE the teaser on Edit. How to do that, not too sure, but I would think that whenever you catch the node form, you can delete the teaser value. Then the editor will not show a teaser and the Save will re-generate a new teaser as required (with the new text, the [toc hidden:1], etc.)
Does that sound like a good solution to you?
Thank you.
Alexis Wilke
#14
Alexis,
Thanks for your help on this. Right now I'm having trouble getting an automatic table of contents at all, so I've been unable to test this theory.
My thought on deleting the teaser from the body during editing is that it would be problematic when the user actually wants a split teaser, combined with automated TOC mode, combined with "Remove TOC from teaser" flag.
If I recall correctly, the appearance of the teaser in the node edit form began when I set the TOC "Remove from teaser" flag, so I was under the impression that something in the module was triggering the core function. From my memory of looking at the code and the results, I'm guessing this is so that
[toc hidden:1]can be explicitly placed in the teaser only. Did I understand this correctly? So if I am getting this right, I was hoping that somehow the triggering of the core function could be prevented when TOC is in automatic mode.I know that there's also the problem that if the [toc] tag is too high in the body, then it will be processed by the input filters during the core automated teaser generation. To solve this, I thought of post-processing the teaser during the display phase with the
hook_nodeapi()to remove the rendered TOC code.I know it's not great programming practice to add the TOC then remove it immediately, but given the limitations of
hook_filter(), there's no good way to keep it from getting into the teaser in the first place. The performance hit is somewhat offset by the core caching for input filters. I think performance can be improved a little more by page caching.#15
The "Remove TOC from teaser" indeed forces the generation of a teaser and sticks the [toc hidden:1] in there. The problem with D6 is that you do NOT know whether you are filtering a teaser or a plain node (or a block, or a term description, or whatever else you'd have a chance to filter.)
One solution I used is to create a CCK field called Teaser and use that as the teaser (which means you want to use the views if you want lists with teasers.) That works great, I do it for one of my websites:
http://new.m2osw.com/news
On that page you see the regular teaser on the left and the CCK teaser on the right (in the LATEST NEWS box.) As you can see they are not the same. The LATEST NEWS box uses a shorter version that fits well in the box. The regular teaser is "much" bigger.
So if we had an option to remove the regular teaser on Edit, then re-generate it, and you add a CCK field named Teaser, you'd be there. The only "problem" is that the teaser box will always appear (although you can put it in a group and hide it by default.) Now that teaser should not be affected by the [toc] system so it should all be perfect... 8-)
Does that sound like a solution?
Alexis
#17
I actually want teasers for my blog entries promoted to the main page, but I have no interest in their use on regular pages.
What I was seeing is that when it is saving and throwing up the "split from the body" message, all of my content was completely deleted. All that existed afterward was the teaser, period.
Needless to say, this is not a graceful failure mode, and it created a great deal of yelling at the screen and whatnot.
Following some of the recommendations on this thread and elsewhere, I think the problem is rectified, but my blood pressure may never recover. I would recommend some further documentation note regarding this teaser issue.
Thanks for the great module!
#18
My sorry for your blood pressure and especially the poor screen & monitor.
So... does it mean you did not lose anything?
The problem is in Drupal Core. It does NOT tell you whether you are filtering a body, a teaser, a block, a view, a whatnot. I guess it makes sense, but on the other hand, it prevents you from managing special cases properly. If you have a solution, I'll be glad to look into it.
Thank you.
Alexis
#19
How about doing the filtering in hook_nodeapi() instead of hook_filter()? Then the code would know it's processing a teaser, I think. Looks like that might be how http://drupal.org/project/htmLawed lets you forgo filtering in the teaser.
Anyway, I think I'm going to do something like filter out the code at the theme level to get around this.
#20
The filters are used for everything you can imagine. There are nodes, blocks, whatnot module that has a buffer that needs to be filtered. For instance, I have my MO References module that let you put a static website in your Drupal site (i.e. your Doxygen documentation. The static pages will be filtered to make sure they are safe. If you wrote those pages, you may use your Full HTML, otherwise you probably want something a bit safer.
This being said, maybe we could have both methods working. After all, you probably rarely want to create a TOC for a block. 8-)
I'll have a quick look at that htmlLawed module to see whether it would be easy to implement something similar. And they may have a solution to that Teaser issue that works inside filters...
Thank you.
Alexis
#21
Subscribe. Also running into this problem.
EDIT: Disregard. Found where I can shut this off entirely.
#22
I'm waiting for a patch... 8-)
Although, I don't think one is necessary, using the hook_nodeapi() could be a solution and there could be a global flag that let you choose the hook to use.