You are here

function hs_taxonomy_field_settings_submit in Hierarchical Select 7.3

Submit callback; updates the field settings (i.e. sets the cardinality of the field to unlimited) whenever either the dropbox or "save lineage" is enabled.

1 string reference to 'hs_taxonomy_field_settings_submit'
hs_taxonomy_form_field_ui_widget_type_form_alter in modules/hs_taxonomy.module
Implements hook_form_FORMID_alter().

File

modules/hs_taxonomy.module, line 133
Implementation of the Hierarchical Select API for the Taxonomy module.

Code

function hs_taxonomy_field_settings_submit(&$form, &$form_state) {
  $field = field_info_field($form['#field_name']);
  $config = hierarchical_select_common_config_get(hs_taxonomy_get_config_id($form['#field_name']));
  if ($config['dropbox']['status'] || $config['save_lineage']) {
    $field = field_info_field($form['#field_name']);
    $field['cardinality'] = -1;

    // -1 = unlimited
    field_update_field($field);
    drupal_set_message(t("Updated this field's cardinality to unlimited."));
  }
}