Image Upload is still being shown despite "Use Image Upload for this node" is set to No for some content types
xiao-feng - March 11, 2009 - 09:42
| Project: | Image Upload |
| Version: | 6.x-1.2 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | reviewed & tested by the community |
Jump to:
Description
Under Administer -> Content Management, I have a few contents that I don't want to use Image Upload, and set the "Use Image Upload for this node" options to "No". But the Image Upload field is still being shown whenever I tried to add that content type. Seems like the settings is not being enforced.

#1
To solve this problem change image_upload_NODE_TYPE to image_upload_enabled_NODE_TYPE in two lines:
220:
from
'#default_value' => variable_get('image_upload'. $form['#node_type']->type, 1),
to
'#default_value' => variable_get('image_upload_enabled_'. $form['#node_type']->type, 1),
243:
if ($form['type']['#value'] .'_node_form' == $form_id && variable_get("image_upload_$node->type", TRUE)) {
to
if ($form['type']['#value'] .'_node_form' == $form_id && variable_get("image_upload_enabled_$node->type", TRUE)) {
#2
I сат confirm: this solution works very well.