Hi there,

I'm not sure if this belongs in the Form API issues queue or the FCKEditor queue. Here's the issue:

I have a form field that I hide from certain users by altering the #access value of the field in hook_form_alter(). While this hides the input just fine, the input is still processed through fckeditor_process_textarea(), which adds a bit of javascript. When the field is not present, the javascript causes an error (something like 'oFCKeditor_edit_body is not defined').

It doesn't look like it's possible to hook into this to prevent the javascript from being placed in the HTML - form_builder() first sets the field's #processed value to FALSE (so changing that in hook_form_alter() doesn't help), and then it runs the #process functions regardless of whether #access is set to FALSE or not.

So I think either fckeditor_process_textarea() should check whether the field has !(#access == FALSE), or form_builder() should not #process a field unless !(#access == FALSE) - but the form_builder() function might do this on purpose.

Thank you!

Comments

wwalc’s picture

Hmm that probably make sense, in the meantime set the #wysiwyg attribute to false in your hook.

Jorrit’s picture

Title: textarea #process adds js despite #access » Don't process textareas with #access = false
Version: 5.x-1.2 » 5.x-2.x-dev
Assigned: Unassigned » Jorrit

#wysiwyg will not work for 5.x. My intention is to add this to 5.x-2.x, 6.x-1.x and 6.x-2.x.

Jorrit’s picture

My mistake, #wysiwyg does work.

Jorrit’s picture

Category: feature » bug
Priority: Minor » Normal

This should be fixed in all versions.

Jorrit’s picture

Status: Active » Fixed

Fixed in 5.x-2.x, 6.x-1.x and 6.x-2.x.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.