The 'Simplify Node Form' option causes CCK image fields on the node edit / node add form to disappear.

CommentFileSizeAuthor
#4 formfilter.module.patch555 bytespianomansam

Comments

cjeich’s picture

I've had a similar issue.
For some reason, when form filter is enabled on a CCK image field, the enctype="multipart/form-data" is removed from the form, causing a very long error message to be returned, rather than uploading the image.

Took me a while to find this error... Not sure about the best way to go about fixing it though. Form api is not really my strong suit.

goodeit’s picture

I put my CCK imagefield inside of a CCK field group and it still shows on my node/edit pages, inside the 'advanced' group. Try creating a field group and adding the image field into it.

EDIT: I just found that my field group does not seem to be showing properly in content type -> manage fields (or display fields) hmmm...

pianomansam’s picture

This still remains an issue. Any idea of how to fix it?

pianomansam’s picture

Status: Active » Needs review
StatusFileSize
new555 bytes

I've come up with a patch that seems to work. Since all CCK fields begin with "field_", I've created a simple regular expression to check for this in the field name and not put any fields like that inside the Advanced fieldset. I replace line 122 in formfilter.module, which looks like this:

if (!(in_array($key, array('advanced', 'taxonomy'))) && $form[$key]['#type'] && $form[$key]['#type'] == 'fieldset') {

with this:

if (!(in_array($key, array('advanced', 'taxonomy'))) && $form[$key]['#type'] && $form[$key]['#type'] == 'fieldset' && preg_match("/field_/", $key) == 0) {

I've included a small patch file that will do the job if you don't want to do it by hand. Thanks!

nedjo’s picture

Status: Needs review » Fixed

Thanks, fixed.

Status: Fixed » Closed (fixed)

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