Here's a patch fixing this behaviour.

better_formats.module.patch515 bytestuffnatty


dragonwize’s picture

I never use the core body field, I just don't like it for many reasons. I have never seen an issue in every site I have built. Can you show example of the issue you are having? Also describe the situation because I am sure that you are using some custom code or exotic module that is causing the issue to show.

tuffnatty’s picture

OK, I have many different modules enabled, but no modifications to core modules and better_formats. The issue looks like this: when I enter node/NNN/edit, where NNN is a node without body field, I don't see the body field, but I see the format selector widget. When I disable better_formats, the format selector is not shown. I think the correct way to check for body field is $node_type->has_body, not $form['body_field']. Probably the thing that sets $form['body_field'] unconditionally can be excerpt.module. I should probably check with a clean Drupal install, better_formats and excerpt, but I don't have time right now.

dragonwize’s picture

Status: Needs review » Postponed (maintainer needs more info)

I can not reproduce this so it will have to wait till I can research it more.

cindyr’s picture

Tuffnatty, you're awesome! Works perfectly!

Regarding reproducing it, simply create a node that doesn't have a body but uses some cck fields instead. You'll notice the tips showing at the top of the node create form. This patch removes them.

dragonwize’s picture

Still not able to produce this with standard Drupal and I have never seen it happen in any of my sites nor has it ever been reported from the 17K+ sites that run BF. There has to be another piece of the puzzle issue somewhere not being mentioned because simply creating CCK fields without a body field does not produce this.

cindyr’s picture

Sorry, I have 49 modules enabled, I wouldn't even begin to know where to debug it.

skylord’s picture

I think it's related with this issue - - in this module -
After patching "Node and Comments Form Settings" module behaviour described above went away.

John Pitcairn’s picture

I'm able to reproduce this issue - it appears to be theme-specific.

I have a very simple content type consisting of a title, no body, and one CCK text field with text processing set to plain text.

On the node form for that content type, I have a "formats" fieldset with an empty id attribute output and displayed when using the Rubik theme as the admin theme.

Switching the admin theme to Garland suppresses the formats fieldset. Switching the admin theme to the site's custom theme (based on Zen) also suppresses the fieldset. The Tao theme (which Rubik is based on) also suppresses the fieldset.

I am not using the module mentioned in #7, and there is no $form['body_field'] set.

I'll post an issue against Rubik and crosslink here.

John Pitcairn’s picture

Ack. Another custom module was indeed messing with $form['body_field'] without first checking it exists. My bad.

dragonwize’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Seems everyone is finding the issues elsewhere. Re-open if anyone has further evidence in the matter.

capellic’s picture

John, thanks for reporting back on what fixed this for you. This exactly what was happening to me. Nesting my operations on $form['body_field'] in isset() fixed my issue:

if (isset($form['body_field'])) {
HAg’s picture

Status: Closed (cannot reproduce) » Active

I use Zen for my theme
Comment module is disabled
Better format options for Comment i Present
I use CCK an templates to theme some of my node input forms.

I normally use the core body field, but in this case I needed a label, so instead I created a CCK text field with filtered text.
When I Create a new node, everything works fine, but when choose to edit an existing node I get an extra format selector widget.
I tried using a CCK text field with raw text. In this case I still got one format selector widget, when editing am existing node.
Disabling the Better formats module, made the format selector widget go away.

It seems, the Better format module, thinks there is an comment field, when there is not, an therefore generate a format selector widget. The module should detect whether the comment module is enabled or not. If not, the module should not run any code concerning comments. I think that would solve this an some similar issues.

dragonwize’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

6.x is now unsupported.