Commit 5c673490 authored by yched's avatar yched
Browse files

#964058 by yched - add 'foreign keys" info in noderef / userref field schema.

parent 0e6629ec
......@@ -52,7 +52,13 @@ function node_reference_field_schema($field) {
);
return array(
'columns' => $columns,
'indexes' => array('nid' => array('nid')), // useful to find back-references
'indexes' => array('nid' => array('nid')),
'foreign keys' => array(
'nid' => array(
'table' => 'node',
'columns' => array('nid' => 'nid'),
),
),
);
}
......
......@@ -48,7 +48,13 @@ function user_reference_field_schema($field) {
);
return array(
'columns' => $columns,
'indexes' => array('uid' => array('uid')), // useful to find back-references
'indexes' => array('uid' => array('uid')),
'foreign keys' => array(
'uid' => array(
'table' => 'users',
'columns' => array('uid' => 'uid'),
),
),
);
}
......@@ -605,12 +611,12 @@ function user_reference_options_list($field) {
/**
* Implements hook_content_migrate_field_alter().
*
*
* Use this to tweak the conversion of field settings
* from the D6 style to the D7 style for specific
* situations not handled by basic conversion,
* as when field types or settings are changed.
*
*
* $field_value['widget_type'] is available to
* see what widget type was originally used.
*/
......@@ -625,7 +631,7 @@ function user_reference_content_migrate_field_alter(&$field_value) {
/**
* Implements hook_content_migrate_instance_alter().
*
*
* Use this to tweak the conversion of instance or widget settings
* from the D6 style to the D7 style for specific
* situations not handled by basic conversion, as when
......@@ -640,7 +646,7 @@ function user_reference_content_migrate_instance_alter(&$instance_value) {
// with 'user_reference_'.
foreach ($instance_value['display'] as $context => $settings) {
$instance_value['display'][$context]['type'] = 'user_reference_'. $settings['type'];
}
}
switch ($instance_value['widget']['type']) {
case 'userreference_autocomplete':
$instance_value['widget']['type'] = 'user_reference_autocomplete';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment