@@ -1534,7 +1534,7 @@ function field_ui_existing_field_options($entity_type, $bundle) {
|
||||
// - locked fields,
|
||||
// - fields already in the current bundle,
|
||||
// - fields that cannot be added to the entity type,
|
||||
// - fields that that shoud not be added via user interface.
|
||||
// - fields that should not be added via user interface.
|
||||
|
||||
if (empty($field['locked'])
|
||||
&& !field_info_instance($entity_type, $field['field_name'], $bundle)
|
||||
@@ -1544,7 +1544,7 @@ function field_ui_existing_field_options($entity_type, $bundle) {
|
||||
'type' => $field['type'],
|
||||
'type_label' => $field_types[$field['type']]['label'],
|
||||
'field' => $field['field_name'],
|
||||
'label' => t($instance['label']),
|
||||
'label' => $instance['label'],
|
||||
'widget_type' => $instance['widget']['type'],
|
||||
);
|
||||
}
|
||||
|
@@ -6,8 +6,8 @@ core = 7.x
|
||||
dependencies[] = field
|
||||
files[] = field_ui.test
|
||||
|
||||
; Information added by drupal.org packaging script on 2013-03-07
|
||||
version = "7.21"
|
||||
; Information added by drupal.org packaging script on 2013-04-03
|
||||
version = "7.22"
|
||||
project = "drupal"
|
||||
datestamp = "1362616996"
|
||||
datestamp = "1365027012"
|
||||
|
||||
|
@@ -332,23 +332,30 @@ function _field_ui_bundle_admin_path($entity_type, $bundle_name) {
|
||||
* Identifies inactive fields within a bundle.
|
||||
*/
|
||||
function field_ui_inactive_instances($entity_type, $bundle_name = NULL) {
|
||||
if (!empty($bundle_name)) {
|
||||
$inactive = array($bundle_name => array());
|
||||
$params = array('bundle' => $bundle_name);
|
||||
$params = array('entity_type' => $entity_type);
|
||||
|
||||
if (empty($bundle_name)) {
|
||||
$active = field_info_instances($entity_type);
|
||||
$inactive = array();
|
||||
}
|
||||
else {
|
||||
$inactive = array();
|
||||
$params = array();
|
||||
// Restrict to the specified bundle. For consistency with the case where
|
||||
// $bundle_name is NULL, the $active and $inactive arrays are keyed by
|
||||
// bundle name first.
|
||||
$params['bundle'] = $bundle_name;
|
||||
$active = array($bundle_name => field_info_instances($entity_type, $bundle_name));
|
||||
$inactive = array($bundle_name => array());
|
||||
}
|
||||
$params['entity_type'] = $entity_type;
|
||||
|
||||
$active_instances = field_info_instances($entity_type);
|
||||
// Iterate on existing definitions, and spot those that do not appear in the
|
||||
// $active list collected earlier.
|
||||
$all_instances = field_read_instances($params, array('include_inactive' => TRUE));
|
||||
foreach ($all_instances as $instance) {
|
||||
if (!isset($active_instances[$instance['bundle']][$instance['field_name']])) {
|
||||
if (!isset($active[$instance['bundle']][$instance['field_name']])) {
|
||||
$inactive[$instance['bundle']][$instance['field_name']] = $instance;
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($bundle_name)) {
|
||||
return $inactive[$bundle_name];
|
||||
}
|
||||
|
@@ -269,7 +269,7 @@ class FieldUIManageFieldsTestCase extends FieldUITestCase {
|
||||
*/
|
||||
function assertFieldSettings($bundle, $field_name, $string = 'dummy test string', $entity_type = 'node') {
|
||||
// Reset the fields info.
|
||||
_field_info_collate_fields(TRUE);
|
||||
field_info_cache_clear();
|
||||
// Assert field settings.
|
||||
$field = field_info_field($field_name);
|
||||
$this->assertTrue($field['settings']['test_field_setting'] == $string, t('Field settings were found.'));
|
||||
@@ -360,7 +360,7 @@ class FieldUIManageFieldsTestCase extends FieldUITestCase {
|
||||
$this->fieldUIDeleteField($bundle_path1, $this->field_name, $this->field_label, $this->type);
|
||||
|
||||
// Reset the fields info.
|
||||
_field_info_collate_fields(TRUE);
|
||||
field_info_cache_clear();
|
||||
// Check that the field instance was deleted.
|
||||
$this->assertNull(field_info_instance('node', $this->field_name, $this->type), t('Field instance was deleted.'));
|
||||
// Check that the field was not deleted
|
||||
@@ -370,7 +370,7 @@ class FieldUIManageFieldsTestCase extends FieldUITestCase {
|
||||
$this->fieldUIDeleteField($bundle_path2, $this->field_name, $this->field_label, $type_name2);
|
||||
|
||||
// Reset the fields info.
|
||||
_field_info_collate_fields(TRUE);
|
||||
field_info_cache_clear();
|
||||
// Check that the field instance was deleted.
|
||||
$this->assertNull(field_info_instance('node', $this->field_name, $type_name2), t('Field instance was deleted.'));
|
||||
// Check that the field was deleted too.
|
||||
|
Reference in New Issue
Block a user