Debian stable, apache 2, php 5, mysql 5, drupal 7.x-dev, fresh install, no additional modules, garland theme, seven admin theme.

Two related issues:

1. Adding a new field (field_test123) of any field type, when pressing "Save", I get a "Page not found" from the following path:

/admin/structure/types/manage/radio-show/fields/field_test123/field-settings?destinations[0]=admin/structure/types/manage/radio-show/fields/field_test123/edit&destinations[1]=admin/structure/types/manage/radio-show/fields

The field is there when I go back to edit the content type.

2. When I try to delete the field I just added, I also get a "Page not found", at this path:

/admin/structure/types/manage/radio-show/fields/field_test123/delete

But this time the field is NOT deleted.

Comments

johanneshahn’s picture

Assigned: Unassigned » johanneshahn
Priority: Normal » Critical
johanneshahn’s picture

seems that is only working if you change the url from

/admin/structure/types/manage/radio-show/fields/field_test123

to:

/admin/structure/types/manage/radio_show/fields/field_test123

notice the underscored "radio_show"

it does working on listing fields without the field name.
theres some problem with the menu path and the wildcards

looking at field_ui.module near line 70

$items["$path/fields/%field_ui_menu"] = array(

in the var $path there is a wildcard %node_type too.
wich is not rewritten to "my-content-type" for the menupath.
so if you call this path drupal cant find it and you get the page not found page.

johanneshahn’s picture

Status: Active » Fixed

fixed bug

change code from

/**
 * Menu loader; Load a field instance based on its name.
 */
function field_ui_menu_load($field_name, $obj_type, $bundle_name) {
 
  if ($instance = field_info_instance($obj_type, $field_name, $bundle_name)) {
 
	return  $instance;
  }
   
  return FALSE;
}

to:

/**
 * Menu loader; Load a field instance based on its name.
 */
function field_ui_menu_load($field_name, $obj_type, $bundle_name) {
 
  $bundle_name = str_replace('-', '_', $bundle_name);
  if ($instance = field_info_instance($obj_type, $field_name, $bundle_name)) {
 
	return  $instance;
  }
   
  return FALSE;
}

notice to convert $bundle_name to get instance.

stborchert’s picture

Title: Content type - Adding field shows error (but works) and added field cannot be deleted » Content type - bundle realname not using machine readable name
Assigned: johanneshahn » Unassigned
Status: Fixed » Needs review
StatusFileSize
new6.51 KB

@Johannes: an issue is marked as fixed if the patch one provides fixes the error or misbehavior and has been committed.

To create the path for editing node types a converted type value was used (e.g. "radio-show" instead of "radio_show").
This causes errors while adding or removing fields from content types.

The patch changes the 'real path' attribute of node_entity_info to use the correct type (machine name).

johanneshahn’s picture

why was the path for editing node rewritten from "_" to "-" ?
was it maybe some unknown feature to have nice looking urls?

johanneshahn’s picture

Assigned: Unassigned » johanneshahn
Status: Needs review » Closed (fixed)
stborchert’s picture

Assigned: johanneshahn » Unassigned
Status: Closed (fixed) » Needs review

@Johannes: the issue can't be closed or fixed until the changes are committed!

johanneshahn’s picture

sorry my fault :)

Status: Needs review » Needs work

The last submitted patch failed testing.

stborchert’s picture

Status: Needs work » Needs review
StatusFileSize
new4.6 KB

Re-roll

Status: Needs review » Needs work

The last submitted patch failed testing.

stborchert’s picture

Status: Needs work » Needs review
StatusFileSize
new2.52 KB

Re-roll (and left out the whitespace corrections).

yched’s picture

Status: Needs review » Closed (duplicate)