Advertisement
Guest User

Untitled

a guest
Jan 28th, 2015
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.62 KB | None | 0 0
  1. <?php
  2.  
  3. $query = db_select('field_config_instance', 'fci');
  4. $query->join('field_config', 'fc', 'fci.field_name = fc.field_name');
  5. $query
  6.   ->fields('fci', array('entity_type', 'bundle', 'field_name'))
  7.   ->condition('fc.type', array('taxonomy_term_reference'), 'IN')
  8.   ->condition('fci.bundle', 'cv');
  9. $result = $query->execute();
  10.  
  11. while ($r = $result->fetchObject()) {
  12.   $instance = field_info_instance($r->entity_type, $r->field_name, $r->bundle);
  13.   if ($instance['widget']['type'] != 'taxonomy_autocomplete') {
  14.     $instance['widget']['type'] = 'taxonomy_autocomplete';
  15.     field_update_instance($instance);
  16.   }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement