function field_tools_field_clone_form_submit in Field tools 8
Same name and namespace in other branches
- 7 field_tools.admin.inc \field_tools_field_clone_form_submit()
Submit handler for the field clone form.
File
- ./
field_tools.admin.inc, line 714 - NOTICE: THIS FILE IS OBSOLETE. IT IS BEING KEPT UNTIL ALL FUNCTIONALITY IS PORTED TO DRUPAL 8.
Code
function field_tools_field_clone_form_submit($form, &$form_state) {
$instance = $form['#instance'];
$field_name = $instance['field_name'];
$field = field_info_field($field_name);
$new_instances = array();
foreach (array_filter($form_state['values']['bundles']) as $option_key) {
list($entity_type, $bundle_type) = explode(':', $option_key);
$new_instances[$entity_type][] = $bundle_type;
}
if (!empty($new_instances)) {
_field_tools_add_instance_to_bundles($instance, $new_instances);
}
}