Commit 5cc7c8b5 authored by webchick's avatar webchick
Browse files

#597508 by sun: Fixed path argument loader for node type paths.

parent a346f0d6
...@@ -54,6 +54,7 @@ function field_ui_menu() { ...@@ -54,6 +54,7 @@ function field_ui_menu() {
$path = $bundle_info['admin']['path']; $path = $bundle_info['admin']['path'];
$bundle_arg = isset($bundle_info['admin']['bundle argument']) ? $bundle_info['admin']['bundle argument'] : $bundle_name; $bundle_arg = isset($bundle_info['admin']['bundle argument']) ? $bundle_info['admin']['bundle argument'] : $bundle_name;
$access = array_intersect_key($bundle_info['admin'], drupal_map_assoc(array('access callback', 'access arguments'))); $access = array_intersect_key($bundle_info['admin'], drupal_map_assoc(array('access callback', 'access arguments')));
$instance_position = count(explode('/', $path)) + 1;
$items["$path/fields"] = array( $items["$path/fields"] = array(
'title' => 'Manage fields', 'title' => 'Manage fields',
...@@ -63,11 +64,10 @@ function field_ui_menu() { ...@@ -63,11 +64,10 @@ function field_ui_menu() {
'weight' => 1, 'weight' => 1,
'file' => 'field_ui.admin.inc', 'file' => 'field_ui.admin.inc',
) + $access; ) + $access;
$instance_position = count(explode('/', $path)) + 1;
$items["$path/fields/%field_ui_menu"] = array( $items["$path/fields/%field_ui_menu"] = array(
'title callback' => 'field_ui_menu_label', 'title callback' => 'field_ui_menu_label',
'title arguments' => array($instance_position), 'title arguments' => array($instance_position),
'load arguments' => array($bundle_name), 'load arguments' => array($bundle_arg),
'page callback' => 'drupal_get_form', 'page callback' => 'drupal_get_form',
'page arguments' => array('field_ui_field_edit_form', $obj_type, $bundle_arg, $instance_position), 'page arguments' => array('field_ui_field_edit_form', $obj_type, $bundle_arg, $instance_position),
'type' => MENU_LOCAL_TASK, 'type' => MENU_LOCAL_TASK,
...@@ -75,7 +75,7 @@ function field_ui_menu() { ...@@ -75,7 +75,7 @@ function field_ui_menu() {
) + $access; ) + $access;
$items["$path/fields/%field_ui_menu/edit"] = array( $items["$path/fields/%field_ui_menu/edit"] = array(
'title' => 'Edit instance settings', 'title' => 'Edit instance settings',
'load arguments' => array($bundle_name), 'load arguments' => array($bundle_arg),
'page callback' => 'drupal_get_form', 'page callback' => 'drupal_get_form',
'page arguments' => array('field_ui_field_edit_form', $obj_type, $bundle_arg, $instance_position), 'page arguments' => array('field_ui_field_edit_form', $obj_type, $bundle_arg, $instance_position),
'type' => MENU_DEFAULT_LOCAL_TASK, 'type' => MENU_DEFAULT_LOCAL_TASK,
...@@ -83,7 +83,7 @@ function field_ui_menu() { ...@@ -83,7 +83,7 @@ function field_ui_menu() {
) + $access; ) + $access;
$items["$path/fields/%field_ui_menu/field-settings"] = array( $items["$path/fields/%field_ui_menu/field-settings"] = array(
'title' => 'Edit field settings', 'title' => 'Edit field settings',
'load arguments' => array($bundle_name), 'load arguments' => array($bundle_arg),
'page callback' => 'drupal_get_form', 'page callback' => 'drupal_get_form',
'page arguments' => array('field_ui_field_settings_form', $obj_type, $bundle_arg, $instance_position), 'page arguments' => array('field_ui_field_settings_form', $obj_type, $bundle_arg, $instance_position),
'type' => MENU_LOCAL_TASK, 'type' => MENU_LOCAL_TASK,
...@@ -91,7 +91,7 @@ function field_ui_menu() { ...@@ -91,7 +91,7 @@ function field_ui_menu() {
) + $access; ) + $access;
$items["$path/fields/%field_ui_menu/widget-type"] = array( $items["$path/fields/%field_ui_menu/widget-type"] = array(
'title' => 'Change widget type', 'title' => 'Change widget type',
'load arguments' => array($bundle_name), 'load arguments' => array($bundle_arg),
'page callback' => 'drupal_get_form', 'page callback' => 'drupal_get_form',
'page arguments' => array('field_ui_widget_type_form', $obj_type, $bundle_arg, $instance_position), 'page arguments' => array('field_ui_widget_type_form', $obj_type, $bundle_arg, $instance_position),
'type' => MENU_LOCAL_TASK, 'type' => MENU_LOCAL_TASK,
...@@ -99,7 +99,7 @@ function field_ui_menu() { ...@@ -99,7 +99,7 @@ function field_ui_menu() {
) + $access; ) + $access;
$items["$path/fields/%field_ui_menu/delete"] = array( $items["$path/fields/%field_ui_menu/delete"] = array(
'title' => 'Delete instance', 'title' => 'Delete instance',
'load arguments' => array($bundle_name), 'load arguments' => array($bundle_arg),
'page callback' => 'drupal_get_form', 'page callback' => 'drupal_get_form',
'page arguments' => array('field_ui_field_delete_form', $obj_type, $bundle_arg, $instance_position), 'page arguments' => array('field_ui_field_delete_form', $obj_type, $bundle_arg, $instance_position),
'type' => MENU_LOCAL_TASK, 'type' => MENU_LOCAL_TASK,
......
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