We noticed some weird behavior with panel nodes interacting with WYSIWYG module. We had 2 format fieldsets appearing, the radio buttons would not be drawn as checked (even though checked="checked" attribute was on the correct radio button), WYSIWYG wouldn't load when form = HTML.

It seems that the way the body field is added to the node form, some expected elements that other nodes have are not included.

I fixed this by using node_body_field function from the core node module. Patch is attached.

Comments

merlinofchaos’s picture

Status: Needs review » Needs work

Your patch wont' apply. It doesn't specify what file it's modifying.

omerida’s picture

StatusFileSize
new913 bytes

Here's another patch, last time I use NetBeans to generate a patch...

omerida’s picture

Status: Needs work » Needs review

updated patch provided

merlinofchaos’s picture

Ok, so the primary reason I didn't use node_body_field() is that it does the split teaser/body -- the panel node 'body' is only being used as a teaser. The 'split teaser' button (which is kind of bad UI anyway) will be confusing.

omerida’s picture

StatusFileSize
new1.1 KB

I think it's more confusing that a panel node 'body' doesn't behave as other node bodies. Plus, it seems to create more bugs with other modules, that expect the body field to work consistently.

Nonetheless, attached is a patch that replicates node_body_field sans teaser js sillines. I think the expectations are the div w/class "body-field-wrapper" around the fieldset and also that the form elements be within $form['body_field']

merlinofchaos’s picture

Why remove the description?

It's ok that it does not behave like other body fields. The description tells you that it's different.

Perhaps it's a bug in the other modules making an assumption that all body fields behave the same way? There's nothing that says all node modules have to have a body. It could easily be disabled.

omerida’s picture

True, but if it's enabled it should work like other body fields. The description can stay, not sure why my diff removed it - i'll submit another patch tomorrow AM.

omerida’s picture

StatusFileSize
new1 KB

Another patch, this one simply adds the wrapping div and puts the body and format elements inside the body_field parent.

merlinofchaos’s picture

Status: Needs review » Fixed

Ok, this one I can get behind.

omerida’s picture

sweet - should I mark this as closed-fixed ?

Status: Fixed » Closed (fixed)

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