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.
Here's a patch fixing this behaviour.
Comment | File | Size | Author |
---|---|---|---|
better_formats.module.patch | 515 bytes | tuffnatty | |
Comments
Comment #1
dragonwize CreditAttribution: dragonwize commentedI 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.
Comment #2
tuffnatty CreditAttribution: tuffnatty commentedOK, 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.
Comment #3
dragonwize CreditAttribution: dragonwize commentedI can not reproduce this so it will have to wait till I can research it more.
Comment #4
cindyr CreditAttribution: cindyr commentedTuffnatty, 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.
Comment #5
dragonwize CreditAttribution: dragonwize commentedStill 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.
Comment #6
cindyr CreditAttribution: cindyr commentedSorry, I have 49 modules enabled, I wouldn't even begin to know where to debug it.
Comment #7
skylord CreditAttribution: skylord commentedI think it's related with this issue - http://drupal.org/node/919776 - in this module - http://drupal.org/project/nodeformsettings.
After patching "Node and Comments Form Settings" module behaviour described above went away.
Comment #8
John Pitcairn CreditAttribution: John Pitcairn commentedI'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.
Comment #9
John Pitcairn CreditAttribution: John Pitcairn commentedAck. Another custom module was indeed messing with $form['body_field'] without first checking it exists. My bad.
Comment #10
dragonwize CreditAttribution: dragonwize commentedSeems everyone is finding the issues elsewhere. Re-open if anyone has further evidence in the matter.
Comment #11
capellicJohn, 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:
Comment #12
HAg CreditAttribution: HAg commentedI 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.
Comment #13
dragonwize CreditAttribution: dragonwize commented6.x is now unsupported.