From cb7cd262479e57687bb077c8e62b7f4cc47d4b29 Mon Sep 17 00:00:00 2001
From: webchick <webchick@24967.no-reply.drupal.org>
Date: Sun, 22 Dec 2013 11:50:01 -0800
Subject: [PATCH] Issue #2160159 by yched: Remove useless D7 field_ui menu
 loader callback.

---
 core/modules/field_ui/field_ui.module | 45 ---------------------------
 1 file changed, 45 deletions(-)

diff --git a/core/modules/field_ui/field_ui.module b/core/modules/field_ui/field_ui.module
index 2033cf617376..bc50a76ab941 100644
--- a/core/modules/field_ui/field_ui.module
+++ b/core/modules/field_ui/field_ui.module
@@ -91,51 +91,6 @@ function field_ui_permission() {
   return $permissions;
 }
 
-/**
- * Menu loader callback: Loads a field instance based on field and bundle name.
- *
- * @param $field_name
- *   The name of the field, as contained in the path.
- * @param $entity_type
- *   The name of the entity.
- * @param $bundle_name
- *   The name of the bundle, as contained in the path.
- * @param $bundle_pos
- *   The position of $bundle_name in $map.
- * @param $map
- *   The translated menu router path argument map.
- *
- * @return
- *   The field instance array.
- *
- * @ingroup field
- */
-function field_ui_instance_load($field_name, $entity_type, $bundle_name, $bundle_pos, $map) {
-  // Extract the actual bundle name from the translated argument map.
-  // The menu router path to manage fields of an entity can be shared among
-  // multiple bundles. For example:
-  // - admin/structure/types/manage/%node_type/fields/%field_ui_instance
-  // - admin/structure/types/manage/%comment_node_type/fields/%field_ui_instance
-  // The menu system will automatically load the correct bundle depending on the
-  // actual path arguments, but this menu loader function only receives the node
-  // type string as $bundle_name, which is not the bundle name for comments.
-  // We therefore leverage the dynamically translated $map provided by the menu
-  // system to retrieve the actual bundle and bundle name for the current path.
-  if ($bundle_pos > 0) {
-    $bundle = $map[$bundle_pos];
-    $bundle_name = field_extract_bundle($entity_type, $bundle);
-  }
-  // Check whether the field exists at all.
-  if ($field = field_info_field($entity_type, $field_name)) {
-    // Only return the field if a field instance exists for the given entity
-    // type and bundle.
-    if ($instance = field_info_instance($entity_type, $field_name, $bundle_name)) {
-      return $instance;
-    }
-  }
-  return FALSE;
-}
-
 /**
  * Implements hook_theme().
  */
-- 
GitLab