The 'Simplify Node Form' issue with with CCK image fields

levavie - January 17, 2008 - 01:30
Project:Formfilter
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

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

#1

cjeich - May 30, 2008 - 09:16

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.

#2

goodeit - August 12, 2008 - 14:41

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...

#3

pianomansam - March 12, 2009 - 21:12

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

#4

pianomansam - March 13, 2009 - 19:15
Status:active» needs review

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!

AttachmentSize
formfilter.module.patch 555 bytes
 
 

Drupal is a registered trademark of Dries Buytaert.