diff --git a/core/modules/field/tests/modules/field_test/field_test.entity.inc b/core/modules/field/tests/modules/field_test/field_test.entity.inc index d781264..f00a57e 100644 --- a/core/modules/field/tests/modules/field_test/field_test.entity.inc +++ b/core/modules/field/tests/modules/field_test/field_test.entity.inc @@ -50,21 +50,24 @@ function field_test_entity_view_mode_info_alter(&$view_modes) { } /** - * Implements hook_entity_bundle_info_alter(). + * Implements hook_entity_bundle_info(). */ -function field_test_entity_bundle_info_alter(&$bundles) { +function field_test_entity_bundle_info() { + $bundles = array(); + $entity_info = entity_get_info(); - foreach ($bundles as $entity_type => $info) { - if ($entity_info[$entity_type]['module'] == 'field_test') { + foreach ($entity_info as $entity_type => $info) { + if ($info['module'] == 'field_test') { $bundles[$entity_type] = Drupal::state()->get('field_test_bundles') ?: array('test_bundle' => array('label' => 'Test Bundle')); - if ($entity_type == 'test_entity_bundle') { - $bundles[$entity_type] += array('test_entity_2' => array('label' => 'Test entity 2')); - } - if ($entity_type == 'test_entity_bundle_key') { - $bundles[$entity_type] += array('bundle1' => array('label' => 'Bundle1'), 'bundle2' => array('label' => 'Bundle2')); - } } } + + $bundles['test_entity_bundle']['test_entity_2'] = array('label' => 'Test entity 2'); + + $bundles['test_entity_bundle_key']['bundle1'] = array('label' => 'Bundle1'); + $bundles['test_entity_bundle_key']['bundle2'] = array('label' => 'Bundle2'); + + return $bundles; } /** diff --git a/core/modules/field/tests/modules/field_test/field_test.module b/core/modules/field/tests/modules/field_test/field_test.module index c2070f2..242908f 100644 --- a/core/modules/field/tests/modules/field_test/field_test.module +++ b/core/modules/field/tests/modules/field_test/field_test.module @@ -269,20 +269,3 @@ function field_test_field_extra_fields_alter(&$info) { // Remove all extra fields from the 'no_fields' content type; unset($info['node']['no_fields']); } - -/** - * Implements hook_module_implements_alter(). - * - * field_test_entity_info_alter() adds the bundles for its entities, and thus - * needs to run before rdf_entity_info_alter(). - * @todo Remove when http://drupal.org/node/1822458 is fixed. - */ -function field_test_module_implements_alter(&$implementations, $hook) { - if ($hook == 'entity_bundle_info_alter' && isset($implementations['field_test']) && isset($implementations['rdf'])) { - foreach (array('field_test', 'rdf') as $module) { - $group = $implementations[$module]; - unset($implementations[$module]); - $implementations[$module] = $group; - } - } -} diff --git a/core/modules/system/tests/modules/entity_test/entity_test.module b/core/modules/system/tests/modules/entity_test/entity_test.module index 35b332b..5fb043f 100644 --- a/core/modules/system/tests/modules/entity_test/entity_test.module +++ b/core/modules/system/tests/modules/entity_test/entity_test.module @@ -122,15 +122,17 @@ function entity_test_delete_bundle($bundle, $entity_type = 'entity_test') { } /** - * Implements hook_entity_bundle_info_alter(). + * Implements hook_entity_bundle_info(). */ -function entity_test_entity_bundle_info_alter(&$bundles) { +function entity_test_entity_bundle_info() { + $bundles = array(); $entity_info = entity_get_info(); - foreach ($bundles as $entity_type => $info) { - if ($entity_info[$entity_type]['module'] == 'entity_test') { + foreach ($entity_info as $entity_type => $info) { + if ($info['module'] == 'entity_test') { $bundles[$entity_type] = Drupal::state()->get($entity_type . '.bundles') ?: array($entity_type => array('label' => 'Entity Test Bundle')); } } + return $bundles; } /**