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

Xandle - March 15, 2009 - 12:49
Status:active» needs work

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

fasdalf@fasdalf.ru - September 9, 2009 - 14:03
Status:needs work» reviewed & tested by the community

I сат confirm: this solution works very well.

 
 

Drupal is a registered trademark of Dries Buytaert.