summaryrefslogtreecommitdiff
path: root/modules/field_ui/field_ui.admin.inc
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-01-30 02:22:01 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-01-30 02:22:01 +0000
commite5f48f0f780ac0ea08ecbf31c85f9bcdc80147ac (patch)
tree53338c4beb77d716f2905f0212883cc07af98ba0 /modules/field_ui/field_ui.admin.inc
parent02c1eeee3fc904ecc7845902cc11ba545dd9466b (diff)
downloadbrdo-e5f48f0f780ac0ea08ecbf31c85f9bcdc80147ac.tar.gz
brdo-e5f48f0f780ac0ea08ecbf31c85f9bcdc80147ac.tar.bz2
#680910 by yched and bjaspan: Allow fields to be restricted to entity types.
Diffstat (limited to 'modules/field_ui/field_ui.admin.inc')
-rw-r--r--modules/field_ui/field_ui.admin.inc9
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/field_ui/field_ui.admin.inc b/modules/field_ui/field_ui.admin.inc
index eb94ed6c7..4104e04cf 100644
--- a/modules/field_ui/field_ui.admin.inc
+++ b/modules/field_ui/field_ui.admin.inc
@@ -787,8 +787,13 @@ function field_ui_existing_field_options($obj_type, $bundle) {
if (!($existing_bundle == $bundle && $existing_obj_type == $obj_type)) {
foreach ($instances as $instance) {
$field = field_info_field($instance['field_name']);
- // Don't show locked fields or fields already in the current bundle.
- if (empty($field['locked']) && !field_info_instance($obj_type, $field['field_name'], $bundle)) {
+ // Don't show
+ // - locked fields,
+ // - fields already in the current bundle,
+ // - field that cannot be added to the object type.
+ if (empty($field['locked'])
+ && !field_info_instance($obj_type, $field['field_name'], $bundle)
+ && (empty($field['object_types']) || in_array($obj_type, $field['object_types']))) {
$text = t('@type: @field (@label)', array(
'@type' => $field_types[$field['type']]['label'],
'@label' => t($instance['label']), '@field' => $instance['field_name'],