I have a CCK Number ratio widget field containing values:

0|Image
1|External video (Youtube, Google Video)
2|External image (PhotoBucket, ImageShack, Google Picasa)
3|External audio (Odeo, Podcast Alley, PodOmatic)

Each value corresponds to a conditional field as follows:
0: ImageField
1: Embedded Media Video
2: Embedded Media Image
3: Embedded Media Audio

When conditional fields are enabled, the ImageField is not shown when viewing the node directly. Editing the node shows it keeps its value, and Views still shows the value properly.

I can consistently get this behavior across all nodes of the content type by adding or removing the conditional setting on the ImageField.

Dev load and render shows the php value is still populated.

Fields 1-3 (Embedded media) all work fine. A single number on/off checkbox controlling a text area also works fine.

CommentFileSizeAuthor
#4 conditional_fields_458923_4.patch828 bytesRoboPhred

Comments

RoboPhred’s picture

Status: Active » Postponed

This worked fine on the previous dev version I was using, a recent change must have taken it out.

Marking as posponed based on the first comment of #438122: Create an integrated modules page.

I will try to look into it and patch it if I can.

RoboPhred’s picture

Changing the display types has no effect, it remains broken.
Changing the widget type back to "File upload" (ImageField is a widget on top of FileField) does not fix it.

Deleting and recreating the field did not fix it.

Here is the strange part: Creating a new content type with only a number on/off (values 0/1) checkbox connecting to an imagefield works...

Here ends my testing for now, I have been getting inconstant results.
I still have more tests to do on it, hopefully I can find a consistant cause for this.

Here is the entire dump of the content type.

$content['type']  = array (
  'name' => 'Media',
  'type' => 'media',
  'description' => 'Upload a picture or video, and connect it to venues and events.',
  'title_label' => 'Name',
  'body_label' => 'Description',
  'min_word_count' => '0',
  'help' => '',
  'node_options' => 
  array (
    'status' => true,
    'promote' => false,
    'sticky' => false,
    'revision' => false,
  ),
  'old_type' => 'media',
  'orig_type' => '',
  'module' => 'node',
  'custom' => '1',
  'modified' => '1',
  'locked' => '0',
  'comment' => '0',
  'comment_default_mode' => '4',
  'comment_default_order' => '1',
  'comment_default_per_page' => '50',
  'comment_controls' => '3',
  'comment_anonymous' => 0,
  'comment_subject_field' => '1',
  'comment_preview' => '1',
  'comment_form_location' => '0',
  'unique_field_fields' => 
  array (
    'title' => true,
    'name' => false,
    'field_media_type' => false,
    'field_media_image' => false,
    'field_media_em_video' => false,
    'field_media_em_image' => false,
    'field_media_em_audio' => false,
    'field_media_content' => false,
  ),
  'unique_field_scope' => 'type',
  'unique_field_comp' => 'each',
  'unique_field_show_matches' => 
  array (
    'show_matches' => true,
  ),
);
$content['fields']  = array (
  0 => 
  array (
    'label' => 'Type',
    'field_name' => 'field_media_type',
    'type' => 'number_integer',
    'widget_type' => 'optionwidgets_buttons',
    'change' => 'Change basic information',
    'weight' => '-4',
    'description' => 'Select the type of media you wish to upload.',
    'default_value' => 
    array (
      0 => 
      array (
        'value' => '',
      ),
    ),
    'default_value_php' => '',
    'default_value_widget' => NULL,
    'group' => false,
    'required' => 1,
    'multiple' => '0',
    'min' => '',
    'max' => '',
    'prefix' => '',
    'suffix' => '',
    'allowed_values' => '0|Image
1|External video (Youtube, Google Video)
2|External image (PhotoBucket, ImageShack, Google Picasa)
3|External audio (Odeo, Podcast Alley, PodOmatic)',
    'allowed_values_php' => '',
    'op' => 'Save field settings',
    'module' => 'number',
    'widget_module' => 'optionwidgets',
    'columns' => 
    array (
      'value' => 
      array (
        'type' => 'int',
        'not null' => false,
        'sortable' => true,
      ),
    ),
    'display_settings' => 
    array (
      'weight' => '-4',
      'parent' => '',
      'label' => 
      array (
        'format' => 'hidden',
      ),
      'teaser' => 
      array (
        'format' => 'hidden',
        'exclude' => 0,
      ),
      'full' => 
      array (
        'format' => 'hidden',
        'exclude' => 0,
      ),
      4 => 
      array (
        'format' => 'default',
        'exclude' => 1,
      ),
      'token' => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
    ),
  ),
  1 => 
  array (
    'label' => 'Image',
    'field_name' => 'field_media_image',
    'type' => 'filefield',
    'widget_type' => 'imagefield_widget',
    'change' => 'Change basic information',
    'weight' => '-3',
    'file_extensions' => 'jpg gif png',
    'progress_indicator' => 'bar',
    'file_path' => '',
    'max_filesize_per_file' => '',
    'max_filesize_per_node' => '',
    'max_resolution' => 0,
    'min_resolution' => 0,
    'custom_alt' => 0,
    'alt' => '',
    'custom_title' => 0,
    'title_type' => 'textfield',
    'title' => '',
    'use_default_image' => 0,
    'default_image_upload' => '',
    'default_image' => NULL,
    'description' => 'Upload an image for the media.',
    'group' => false,
    'conditional_fields' => 
    array (
      'field_media_type' => 
      array (
        0 => '0',
      ),
    ),
    'required' => 0,
    'multiple' => '0',
    'list_field' => '0',
    'list_default' => 1,
    'description_field' => '0',
    'op' => 'Save field settings',
    'module' => 'filefield',
    'widget_module' => 'imagefield',
    'columns' => 
    array (
      'fid' => 
      array (
        'type' => 'int',
        'not null' => false,
        'views' => true,
      ),
      'list' => 
      array (
        'type' => 'int',
        'size' => 'tiny',
        'not null' => false,
        'views' => true,
      ),
      'data' => 
      array (
        'type' => 'text',
        'serialize' => true,
        'views' => true,
      ),
    ),
    'display_settings' => 
    array (
      'label' => 
      array (
        'format' => 'above',
        'exclude' => 0,
      ),
      'teaser' => 
      array (
        'format' => 'image_plain',
        'exclude' => 0,
      ),
      'full' => 
      array (
        'format' => 'image_plain',
        'exclude' => 0,
      ),
      4 => 
      array (
        'format' => 'image_plain',
        'exclude' => 0,
      ),
      'token' => 
      array (
        'format' => 'image_plain',
        'exclude' => 0,
      ),
    ),
  ),
  2 => 
  array (
    'label' => 'Third party video',
    'field_name' => 'field_media_em_video',
    'type' => 'emvideo',
    'widget_type' => 'emvideo_textfields',
    'change' => 'Change basic information',
    'weight' => '-2',
    'providers' => 
    array (
      0 => 1,
      'google' => false,
      'myspace' => false,
      'youtube' => false,
    ),
    'video_width' => '425',
    'video_height' => '350',
    'video_autoplay' => '',
    'preview_width' => '250',
    'preview_height' => '205',
    'preview_autoplay' => '',
    'thumbnail_width' => '120',
    'thumbnail_height' => '90',
    'thumbnail_default_path' => '',
    'thumbnail_link_title' => 'See video',
    'description' => 'Enter the url for the video.

Currently, only Youtube, Myspace, and Google Video support is enabled.  However, this site can handle many more sources that are currently not enabled.  If you would like support for another third party media site, send an email to admin@robophreddev.net.',
    'default_value' => 
    array (
      0 => 
      array (
        'embed' => '',
        'value' => '',
      ),
    ),
    'default_value_php' => '',
    'default_value_widget' => 
    array (
      'field_media_em_video' => 
      array (
        0 => 
        array (
          'embed' => '',
          'value' => '',
        ),
      ),
    ),
    'group' => false,
    'conditional_fields' => 
    array (
      'field_media_type' => 
      array (
        1 => '1',
      ),
    ),
    'required' => 0,
    'multiple' => '0',
    'op' => 'Save field settings',
    'module' => 'emvideo',
    'widget_module' => 'emvideo',
    'columns' => 
    array (
      'embed' => 
      array (
        'type' => 'text',
        'size' => 'big',
        'not null' => false,
        'sortable' => true,
      ),
      'value' => 
      array (
        'type' => 'varchar',
        'length' => 255,
        'not null' => false,
        'sortable' => true,
      ),
      'provider' => 
      array (
        'type' => 'varchar',
        'length' => 255,
        'not null' => false,
        'sortable' => true,
      ),
      'data' => 
      array (
        'type' => 'text',
        'size' => 'big',
        'not null' => false,
        'sortable' => false,
      ),
    ),
    'display_settings' => 
    array (
      'weight' => '-2',
      'parent' => '',
      'label' => 
      array (
        'format' => 'hidden',
      ),
      'teaser' => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      'full' => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      4 => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      'token' => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
    ),
  ),
  3 => 
  array (
    'label' => 'Third party image',
    'field_name' => 'field_media_em_image',
    'type' => 'emimage',
    'widget_type' => 'emimage_textfields',
    'change' => 'Change basic information',
    'weight' => '-1',
    'providers' => 
    array (
      0 => 1,
      'imageshack' => false,
      'photobucket' => false,
      'picasa' => false,
    ),
    'full_width' => '500',
    'full_height' => '800',
    'full_link' => 'provider',
    'preview_width' => '240',
    'preview_height' => '360',
    'preview_link' => 'provider',
    'thumbnail_width' => '100',
    'thumbnail_height' => '180',
    'thumbnail_link' => 'node',
    'description' => 'Enter the url for the video.

Currently, only PhotoBucket, ImageShack, and Google Piscia support is enabled.  However, this site can handle many more sources that are currently not enabled.  If you would like support for another third party media site, send an email to admin@robophreddev.net.',
    'default_value' => 
    array (
      0 => 
      array (
        'embed' => '',
        'value' => '',
      ),
    ),
    'default_value_php' => '',
    'default_value_widget' => 
    array (
      'field_media_em_image' => 
      array (
        0 => 
        array (
          'embed' => '',
          'value' => '',
        ),
      ),
    ),
    'group' => false,
    'conditional_fields' => 
    array (
      'field_media_type' => 
      array (
        2 => '2',
      ),
    ),
    'required' => 0,
    'multiple' => '0',
    'op' => 'Save field settings',
    'module' => 'emimage',
    'widget_module' => 'emimage',
    'columns' => 
    array (
      'embed' => 
      array (
        'type' => 'text',
        'size' => 'big',
        'not null' => false,
        'sortable' => true,
      ),
      'value' => 
      array (
        'type' => 'varchar',
        'length' => 255,
        'not null' => false,
        'sortable' => true,
      ),
      'provider' => 
      array (
        'type' => 'varchar',
        'length' => 255,
        'not null' => false,
        'sortable' => true,
      ),
      'data' => 
      array (
        'type' => 'text',
        'size' => 'big',
        'not null' => false,
        'sortable' => false,
      ),
    ),
    'display_settings' => 
    array (
      'weight' => '-1',
      'parent' => '',
      'label' => 
      array (
        'format' => 'hidden',
      ),
      'teaser' => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      'full' => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      4 => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      'token' => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
    ),
  ),
  4 => 
  array (
    'label' => 'Third party audio',
    'field_name' => 'field_media_em_audio',
    'type' => 'emvideo',
    'widget_type' => 'emvideo_textfields',
    'change' => 'Change basic information',
    'weight' => 0,
    'providers' => 
    array (
      0 => 1,
      'google' => false,
      'myspace' => false,
      'youtube' => false,
    ),
    'video_width' => '425',
    'video_height' => '350',
    'video_autoplay' => '',
    'preview_width' => '425',
    'preview_height' => '350',
    'preview_autoplay' => '',
    'thumbnail_width' => '120',
    'thumbnail_height' => '90',
    'thumbnail_default_path' => '',
    'thumbnail_link_title' => 'See video',
    'description' => 'Enter the url for the video.

Currently, only Odeo, Podcast Alley, PodOmatic support is enabled.',
    'default_value' => 
    array (
      0 => 
      array (
        'embed' => '',
        'value' => '',
      ),
    ),
    'default_value_php' => '',
    'default_value_widget' => 
    array (
      'field_media_em_audio' => 
      array (
        0 => 
        array (
          'embed' => '',
          'value' => '',
        ),
      ),
    ),
    'group' => false,
    'conditional_fields' => 
    array (
      'field_media_type' => 
      array (
        3 => '3',
      ),
    ),
    'required' => 0,
    'multiple' => '0',
    'op' => 'Save field settings',
    'module' => 'emvideo',
    'widget_module' => 'emvideo',
    'columns' => 
    array (
      'embed' => 
      array (
        'type' => 'text',
        'size' => 'big',
        'not null' => false,
        'sortable' => true,
      ),
      'value' => 
      array (
        'type' => 'varchar',
        'length' => 255,
        'not null' => false,
        'sortable' => true,
      ),
      'provider' => 
      array (
        'type' => 'varchar',
        'length' => 255,
        'not null' => false,
        'sortable' => true,
      ),
      'data' => 
      array (
        'type' => 'text',
        'size' => 'big',
        'not null' => false,
        'sortable' => false,
      ),
    ),
    'display_settings' => 
    array (
      'weight' => 0,
      'parent' => '',
      'label' => 
      array (
        'format' => 'hidden',
      ),
      'teaser' => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      'full' => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      4 => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      'token' => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
    ),
  ),
  5 => 
  array (
    'label' => 'Contains',
    'field_name' => 'field_media_content',
    'type' => 'nodereference',
    'widget_type' => 'nodereference_autocomplete',
    'change' => 'Change basic information',
    'weight' => '2',
    'autocomplete_match' => 'contains',
    'description' => 'Type the name of the title for each event, venue, or other content that this media applies to.  Uploaded images will show up in the content\'s slideshow, and all others will show under the content\'s media tab.',
    'default_value' => 
    array (
      0 => 
      array (
        'nid' => NULL,
        '_error_element' => 'default_value_widget][field_media_content][0][nid][nid',
      ),
    ),
    'default_value_php' => '',
    'default_value_widget' => 
    array (
      'field_media_content' => 
      array (
        0 => 
        array (
          'nid' => 
          array (
            'nid' => '',
            '_error_element' => 'default_value_widget][field_media_content][0][nid][nid',
          ),
          '_error_element' => 'default_value_widget][field_media_content][0][nid][nid',
        ),
      ),
    ),
    'group' => false,
    'conditional_fields' => 
    array (
      'field_media_type' => 'conditional_field_no_value',
    ),
    'required' => 0,
    'multiple' => '1',
    'referenceable_types' => 
    array (
      'event' => 'event',
      'venue' => 'venue',
      'media' => 0,
      'page' => 0,
      'test' => false,
    ),
    'advanced_view' => '--',
    'advanced_view_args' => '',
    'op' => 'Save field settings',
    'module' => 'nodereference',
    'widget_module' => 'nodereference',
    'columns' => 
    array (
      'nid' => 
      array (
        'type' => 'int',
        'unsigned' => true,
        'not null' => false,
      ),
    ),
    'display_settings' => 
    array (
      'weight' => '2',
      'parent' => '',
      'label' => 
      array (
        'format' => 'above',
      ),
      'teaser' => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      'full' => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      4 => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      'token' => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
    ),
  ),
);
$content['extra']  = array (
  'title' => '1',
  'body_field' => '4',
  'menu' => '3',
);
RoboPhred’s picture

I have not been able to get a consistant cause for it. Currently I have a field which controls two image fields when toggled on/off. One imagefield works, the other does not.

Here is the result of my debug output in nodeapi view when the field is set to off, and the proper field is NOT being displayed:

CFDEBUG: node viewed 
CFDEBUG: Data loaded 
CFDEBUG: not showing all 
CFDEBUG: running on field field_test_contl 
CFDEBUG: ** group is false 
CFDEBUG: ** field[ctrl name] is field_test_contl 
CFDEBUG: ** field[ctrl name] val is 
CFDEBUG: ** field[ctrl name] val empty is true 
CFDEBUG: ** viewed is false 
CFDEBUG: ** contains value 0 
CFDEBUG: ** running orphaned field settings 
CFDEBUG: ** show triggered 
CFDEBUG: ** hiding orphan 
CFDEBUG: running on field field_test_contl 
CFDEBUG: ** group is false 
CFDEBUG: ** field[ctrl name] is field_test_contl 
CFDEBUG: ** field[ctrl name] val is 
CFDEBUG: ** field[ctrl name] val empty is true 
CFDEBUG: ** viewed is false 
CFDEBUG: ** contains value 0 
CFDEBUG: ** running orphaned field settings 
CFDEBUG: ** show triggered 
CFDEBUG: ** hiding orphan 

Now, here it is with the control filed set to 1, with the proper field being displayed as it should be:

CFDEBUG: node viewed 
CFDEBUG: Data loaded 
CFDEBUG: not showing all 
CFDEBUG: running on field field_test_contl 
CFDEBUG: ** group is false 
CFDEBUG: ** field[ctrl name] is field_test_contl 
CFDEBUG: ** field[ctrl name] val is 
CFDEBUG: ** field[ctrl name] val empty is true 
CFDEBUG: ** viewed is false 
CFDEBUG: ** contains value 1 
CFDEBUG: ** running orphaned field settings 
CFDEBUG: ** show triggered 
CFDEBUG: ** ** was triggered 
CFDEBUG: running on field field_test_contl 
CFDEBUG: ** group is false 
CFDEBUG: ** field[ctrl name] is field_test_contl 
CFDEBUG: ** field[ctrl name] val is 
CFDEBUG: ** field[ctrl name] val empty is true 
CFDEBUG: ** viewed is false 
CFDEBUG: ** contains value 1 
CFDEBUG: ** running orphaned field settings 
CFDEBUG: ** show triggered 
CFDEBUG: ** hiding orphan 

My control field is not hidden and rendered properly, yet its value is missing from content and it assumes that the other fields are orphaned...

The next thing I will look into is what the "show triggered" component actually does...

Here is the export of the testing content I am using. "field_test_image_3" works, "field_test_image_3_2" does not.

$content['type']  = array (
  'name' => 'test',
  'type' => 'test',
  'description' => '',
  'title_label' => 'Title',
  'body_label' => 'Body',
  'min_word_count' => '0',
  'help' => '',
  'node_options' => 
  array (
    'status' => true,
    'promote' => true,
    'sticky' => false,
    'revision' => false,
  ),
  'old_type' => 'test',
  'orig_type' => '',
  'module' => 'node',
  'custom' => '1',
  'modified' => '1',
  'locked' => '0',
  'comment' => '2',
  'comment_default_mode' => '4',
  'comment_default_order' => '1',
  'comment_default_per_page' => '50',
  'comment_controls' => '3',
  'comment_anonymous' => 0,
  'comment_subject_field' => '1',
  'comment_preview' => '1',
  'comment_form_location' => '0',
  'unique_field_fields' => 
  array (
    'title' => false,
    'name' => false,
    'field_test_contl' => false,
    'field_test_image_3' => false,
    'field_test_image_3_2' => false,
  ),
  'unique_field_scope' => 'type',
  'unique_field_comp' => 'each',
  'unique_field_show_matches' => 
  array (
    'show_matches' => false,
  ),
);
$content['fields']  = array (
  0 => 
  array (
    'label' => 'Control',
    'field_name' => 'field_test_contl',
    'type' => 'number_integer',
    'widget_type' => 'optionwidgets_buttons',
    'change' => 'Change basic information',
    'weight' => '-4',
    'description' => '',
    'default_value' => 
    array (
      0 => 
      array (
        'value' => '0',
      ),
    ),
    'default_value_php' => '',
    'default_value_widget' => NULL,
    'group' => false,
    'required' => 0,
    'multiple' => '0',
    'min' => '',
    'max' => '',
    'prefix' => '',
    'suffix' => '',
    'allowed_values' => '0|off
1|on',
    'allowed_values_php' => '',
    'op' => 'Save field settings',
    'module' => 'number',
    'widget_module' => 'optionwidgets',
    'columns' => 
    array (
      'value' => 
      array (
        'type' => 'int',
        'not null' => false,
        'sortable' => true,
      ),
    ),
    'display_settings' => 
    array (
      'label' => 
      array (
        'format' => 'above',
        'exclude' => 0,
      ),
      'teaser' => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      'full' => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      4 => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      'token' => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
    ),
  ),
  1 => 
  array (
    'label' => 'test',
    'field_name' => 'field_test_image_3',
    'type' => 'filefield',
    'widget_type' => 'imagefield_widget',
    'change' => 'Change basic information',
    'weight' => '-3',
    'file_extensions' => 'jpg gif png',
    'progress_indicator' => 'bar',
    'file_path' => '',
    'max_filesize_per_file' => '',
    'max_filesize_per_node' => '',
    'max_resolution' => 0,
    'min_resolution' => 0,
    'custom_alt' => 0,
    'alt' => '',
    'custom_title' => 0,
    'title_type' => 'textfield',
    'title' => '',
    'use_default_image' => 0,
    'default_image_upload' => '',
    'default_image' => NULL,
    'description' => '',
    'group' => false,
    'conditional_fields' => 
    array (
      'field_test_contl' => 
      array (
        1 => '1',
      ),
    ),
    'required' => 0,
    'multiple' => '0',
    'list_field' => '0',
    'list_default' => 1,
    'description_field' => '0',
    'op' => 'Save field settings',
    'module' => 'filefield',
    'widget_module' => 'imagefield',
    'columns' => 
    array (
      'fid' => 
      array (
        'type' => 'int',
        'not null' => false,
        'views' => true,
      ),
      'list' => 
      array (
        'type' => 'int',
        'size' => 'tiny',
        'not null' => false,
        'views' => true,
      ),
      'data' => 
      array (
        'type' => 'text',
        'serialize' => true,
        'views' => true,
      ),
    ),
    'display_settings' => 
    array (
      'label' => 
      array (
        'format' => 'above',
        'exclude' => 0,
      ),
      'teaser' => 
      array (
        'format' => 'image_plain',
        'exclude' => 0,
      ),
      'full' => 
      array (
        'format' => 'image_plain',
        'exclude' => 0,
      ),
      4 => 
      array (
        'format' => 'image_plain',
        'exclude' => 0,
      ),
      'token' => 
      array (
        'format' => 'image_plain',
        'exclude' => 0,
      ),
    ),
  ),
  2 => 
  array (
    'label' => 'test2',
    'field_name' => 'field_test_image_3_2',
    'type' => 'filefield',
    'widget_type' => 'imagefield_widget',
    'change' => 'Change basic information',
    'weight' => '-2',
    'file_extensions' => 'jpg gif png',
    'progress_indicator' => 'bar',
    'file_path' => '',
    'max_filesize_per_file' => '',
    'max_filesize_per_node' => '',
    'max_resolution' => 0,
    'min_resolution' => 0,
    'custom_alt' => 0,
    'alt' => '',
    'custom_title' => 0,
    'title_type' => 'textfield',
    'title' => '',
    'use_default_image' => 0,
    'default_image_upload' => '',
    'default_image' => NULL,
    'description' => '',
    'group' => false,
    'conditional_fields' => 
    array (
      'field_test_contl' => 
      array (
        0 => '0',
      ),
    ),
    'required' => 0,
    'multiple' => '0',
    'list_field' => '0',
    'list_default' => 1,
    'description_field' => '0',
    'op' => 'Save field settings',
    'module' => 'filefield',
    'widget_module' => 'imagefield',
    'columns' => 
    array (
      'fid' => 
      array (
        'type' => 'int',
        'not null' => false,
        'views' => true,
      ),
      'list' => 
      array (
        'type' => 'int',
        'size' => 'tiny',
        'not null' => false,
        'views' => true,
      ),
      'data' => 
      array (
        'type' => 'text',
        'serialize' => true,
        'views' => true,
      ),
    ),
    'display_settings' => 
    array (
      'label' => 
      array (
        'format' => 'above',
        'exclude' => 0,
      ),
      'teaser' => 
      array (
        'format' => 'image_plain',
        'exclude' => 0,
      ),
      'full' => 
      array (
        'format' => 'image_plain',
        'exclude' => 0,
      ),
      4 => 
      array (
        'format' => 'image_plain',
        'exclude' => 0,
      ),
      'token' => 
      array (
        'format' => 'image_plain',
        'exclude' => 0,
      ),
    ),
  ),
);
$content['extra']  = array (
  'title' => '-5',
  'body_field' => '0',
  'menu' => '-1',
);
RoboPhred’s picture

Status: Fixed » Postponed
StatusFileSize
new828 bytes

Turns out this has nothing to do with third party fields, just the cck Number field as control.

Tracked it down to the conditional_fields_is_triggered

Here is some debug output from is_triggered

=================
~is_triggered: trigger_values[0] is 
~is_triggered: trigger_values[1] is 1
~is_triggered (foreach*2): value is 0
~is_triggered returning false
=================
~is_triggered: trigger_values[0] is 0
~is_triggered: trigger_values[1] is 
~is_triggered (foreach*2): value is 0
~is_triggered returning false

The second one has 0 in the array, yet the check returns false. This is because ($value) returns false if the value is 0.

I fixed it by replacing
if ($value && in_array($value, $trigger_values)) {
with
if (isset($value) && in_array($value, $trigger_values)) {

I am not sure if the check for $value is needed at all.

RoboPhred’s picture

Status: Postponed » Needs review
peterpoe’s picture

Status: Needs review » Fixed

Tested and committed. Should not cause any problem. Thanks!

Status: Postponed » Closed (fixed)

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