fields(array('weight' => 1)) ->condition('name', 'entityconnect') ->condition('type', 'module') ->execute(); } /** * Add cache table. */ function entityconnect_update_7000() { if (!db_table_exists('cache_entityconnect')) { $schema = entityconnect_schema(); db_create_table('cache_entityconnect', $schema ['cache_entityconnect']); } } /** * Change module weight so that other modules are less likely to break the * redirect that this module performs after creating a referenced entity. */ function entityconnect_update_7101() { // We need to run after the workbench_email module so that our // entityconnect_return redirect works properly. db_update('system') ->fields(array('weight' => 1)) ->condition('name', 'entityconnect') ->condition('type', 'module') ->execute(); } /** * Update all settings from 7.x-1.x to 7.x-2.x */ function entityconnect_update_7200() { $instances = field_info_instances(); foreach ($instances as $entity_type => $bundles) { foreach ($bundles as $bundle_name => $fields) { if (!empty($fields)) { foreach ($fields as $field_name => $field) { if ($field['widget']['module'] == 'entityreference' || $field['widget']['module'] == 'node_reference' || $field['widget']['module'] == 'user_reference' || $field['display']['default']['module'] == 'entityreference' || $field['display']['default']['module'] == 'node_reference' || $field['display']['default']['module'] == 'user_reference') { $field['entityconnect']['button']['unload_add_button'] = $field['entityconnect_unload_add']; $field['entityconnect']['button']['unload_edit_button'] = $field['entityconnect_unload_edit']; $field['entityconnect']['icon']['show_add_icon'] = $field['entityconnect_show_add_icon']; $field['entityconnect']['icon']['show_edit_icon'] = $field['entityconnect_show_edit_icon']; field_update_instance($field); } } } } } }