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
Comment #1
wwalc CreditAttribution: wwalc commentedHmm that probably make sense, in the meantime set the #wysiwyg attribute to false in your hook.
Comment #2
Jorrit CreditAttribution: Jorrit commented#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.
Comment #3
Jorrit CreditAttribution: Jorrit commentedMy mistake, #wysiwyg does work.
Comment #4
Jorrit CreditAttribution: Jorrit commentedThis should be fixed in all versions.
Comment #5
Jorrit CreditAttribution: Jorrit commentedFixed in 5.x-2.x, 6.x-1.x and 6.x-2.x.