Because now the textareas for both Body and Comments are fields using the Field API, the old way of hiding the input format fieldset is not working.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lelizondo’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev
Wappie08’s picture

hmm, didn't found this out yet, at least it has to include ['und']['0'] for the body I think

 unset($form['body']['und']['0']['format']);

but that also doesn't work

EDIT: this may be more complicted, I just looked into

http://api.drupal.org/api/drupal/developer--topics--forms_api_reference....
and http://drupal.org/node/1087468
and http://drupal.org/update/modules/6/7#text_format

Basicly you just want to hide the formats by some simple trick(s)...

EDIT 2: maybe the answer is in here: http://drupal.org/node/934976

Greets Wappie

Wappie08’s picture

and see http://drupal.org/node/950216 and http://drupal.org/node/934976


 $form['body']['und']['0']['format']['type'] = 'hidden';

Still doesn't work but I need some sleep now :)

Greetings Wappie

Wappie08’s picture

Assigned: Unassigned » Wappie08
Status: Active » Needs review
Wappie08’s picture

Assigned: Wappie08 » Unassigned
Status: Needs review » Active

hmm.. didn't work after all

wcarpent’s picture

I've also experienced this issue...subscribing.

BenK’s picture

Subscribing

Wappie08’s picture

I came across [#35122] but that is only for the theming part..

protools’s picture

sub

protools’s picture

sub

andres_de’s picture

In the codes above (#2 and #3) there is a # missing. It should be:

$form['body']['und'][0]['#format'] = 'full_html';

With this Code I can define the default format.

Shadlington’s picture

Subscribing

Wappie08’s picture

Status: Active » Needs work

I just stumbled upon a solution: http://timonweb.com/how-remove-format-options-guideliness-comments-texta...

The only thing is the fact that the WYSIWYG is also removed when you put #access false on 'format'..

Greetings Wappie

userofdrupal’s picture

Subscribing

Grabby’s picture

This doesn’t work for me either, but hiding the author name and comment title does, which is why I’m using it on a production site anyway. Hope I’m not doing anything dangerous!

Jboo’s picture

Has anyone found a solution for this yet?

hawkeye.twolf’s picture

I use this entry in my theme's .css file to hide the Input Format fieldset:

.fieldset-input-format { display: none; }

It's also helpful to use the Better Formats module so that you can set the default Input Format per user role and also by node type.

Hope that helps!

kssundar’s picture

Issue summary: View changes
Status: Needs work » Needs review
FileSize
2.54 KB

Attached patch that fixes this issue.

The solution is to use hook_element_info_alter().

kssundar’s picture

FileSize
5.83 KB

Attached updated patch which works for node & comments

  • 8af9967 committed on 7.x-2.x
    Issue #1111308 by ksbalajisundar: Fix for Node and Comment Input Format...
kssundar’s picture

Assigned: Unassigned » kssundar
Status: Needs review » Fixed

Patch ported to 7.x.2.x

kssundar’s picture

Status: Fixed » Closed (fixed)