Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $query = db_select('field_config_instance', 'fci');
- $query->join('field_config', 'fc', 'fci.field_name = fc.field_name');
- $query
- ->fields('fci', array('entity_type', 'bundle', 'field_name'))
- ->condition('fc.type', array('taxonomy_term_reference'), 'IN')
- ->condition('fci.bundle', 'cv');
- $result = $query->execute();
- while ($r = $result->fetchObject()) {
- $instance = field_info_instance($r->entity_type, $r->field_name, $r->bundle);
- if ($instance['widget']['type'] != 'taxonomy_autocomplete') {
- $instance['widget']['type'] = 'taxonomy_autocomplete';
- field_update_instance($instance);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement