I created a CCK field of type external image using emfield module and image_ncck module.
The widget settings page for this CCK field (one that has options like full size display width, full size link etc) displays form values different from what are saved.

For example: if I set
full size display width = 0
full size display height = 200
full size display link = No link

After saving the form and loading it again I would get the following -
full size display width = 500
full size display height = 200
full size display link = Link to provider

Moreover on the node page which has this this CCK field in full view the image would link to the provider and instead of not having any link at all.

CommentFileSizeAuthor
#1 widget_settings.patch10.72 KBsumeet.pareek

Comments

sumeet.pareek’s picture

Assigned: Unassigned » sumeet.pareek
StatusFileSize
new10.72 KB

The bug that I just reported is there because of if conditions like

'#default_value' => $widget['full_width'] ? $widget['full_width'] : $width,
'#default_value' => $widget['full_link'] ? $widget['full_link'] : variable_get('image_ncck_default_full_link', IMAGE_NCCK_DEFAULT_FULL_LINK),
$link = $field['widget']['full_link'] ? $field['widget']['full_link'] : variable_get('image_ncck_default_full_link', IMAGE_NCCK_DEFAULT_FULL_LINK); //line-351

which are wrong.. because when a user sets width = 0 and full_link = No link (which corresponds to zero).. the default values are loaded instead of the ones saved by the user.

I have created a patch that fixes such if conditions at multiple places and gets rid of the variable_get function. The variable_get function should not be there because widget-settings are not saved in the variables table created by drupal but in the node_field_instance table created by the CCK module. It would be great if the community can test this patch. (Though I have tested it, I might have skipped something)

alex ua’s picture

Version: 5.x-1.2 » 5.x-1.x-dev

Thanks! I committed your patch to the dev branch. I'll be including this in the 5.x-1.3 version which I'm going to roll soon...

alex ua’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

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