I'm using the latest dec version of drupal and i want to create new product types with commerce.
So i cannot create new fields on my product types.
When I do that i get the following error:
Undefined index: in _field_ui_bundle_admin_path() line 309 in field_ui.module

This funtion looks like:
function _field_ui_bundle_admin_path($entity_type, $bundle_name) {
$bundles = field_info_bundles($entity_type);
$bundle_info = $bundles[$bundle_name];
if (isset($bundle_info['admin'])) {
return isset($bundle_info['admin']['real path']) ? $bundle_info['admin']['real path'] : $bundle_info['admin']['path'];
}
}

I've looked up all teh info on the net and there are old post about this but i've checked all of them all these patches are correct in my version.

Can anyone help me out.

Kind regards,
ed

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

edg1’s picture

Status: Active » Needs work
edg1’s picture

Status: Needs work » Fixed

update the fiel_group module to the latest _dev
doesn't work

i don't know what to do can anyone help here ?

edg1’s picture

Status: Fixed » Needs work
Oceanman’s picture

I am getting these notices too. This error appears when I am in the "Manage Fields" tab of the field collection module.

# Notice: Undefined index: fieldable in field_ui_menu() (line 72 of modules/field_ui/field_ui.module).
# Notice: Undefined index: fieldable in field_group_menu() (line 25 of /modules/field_group/field_group.module)

Could this be an issue for field collection and not core? Maybe it should be moved.

Wappie08’s picture

Title: Notice: Undefined index: [custom_content_type_machine_name] in _field_ui_bundle_admin_path(), line 309 in field_ui.module » Undefined index: in _field_ui_bundle_admin_path() line 309 in field_ui.module
Version: 8.x-dev » 7.x-dev
Status: Needs work » Active
Issue tags: -Needs tests, -Needs issue summary update, -Needs backport to D7 +book, +undefined index

Actually this happened to me with the core book module after I renamed the machine name (from book to customname):

Notice: Undefined index: customname in _field_ui_bundle_admin_path() (line 309 of /modules/field_ui/field_ui.module).

Actually it's weird that "book" seems to be hardcoded in the system, it would be much more logical if one can change this name (instead of having to make a new content type and deleting type book).

btw. after uninstalling and reenabling book the problem was solved.

Greets

klonos’s picture

Title: Undefined index: in _field_ui_bundle_admin_path() line 309 in field_ui.module » Notice: Undefined index: [] in _field_ui_bundle_admin_path(), line 309 in field_ui.module
Status: Needs work » Active
Issue tags: +book, +undefined index

I also got this when trying to go to the "Manage fields" tab of a custom content type after I'd just changed its machine name to a custom one. I'll give this a go in a vanilla setup ...unless someone beats me to it.

klonos’s picture

klonos’s picture

Title: Notice: Undefined index: [] in _field_ui_bundle_admin_path(), line 309 in field_ui.module » Notice: Undefined index: [custom_content_type_machine_name] in _field_ui_bundle_admin_path(), line 309 in field_ui.module

...sorry, meant to have a generic token-style name there in the title.

catch’s picture

Version: 7.x-dev » 8.x-dev
Status: Active » Needs review
Issue tags: -book, -undefined index +Needs backport to D7
FileSize
1.6 KB

Attaching a patch, I haven't tested this, please give it a try and report back. Instructions for using patches are at http://drupal.org/patch/apply

As a @todo, field_attach_rename_bundle() should change to entity_rename_bundle() in Drupal 8.

catch’s picture

Issue tags: +Needs tests

This needs simpletests, but please try manually if you're experiencing the bug.

catch’s picture

#1091054: Disabled content types and modules cause notices in field_ui_fields_list() was duplicate.

That bug report suggests the might also be a need for clearing caches on bundle deletion if that's not already done.

xjm’s picture

Tagging issues not yet using summary template.

dawehner’s picture

Here is a patch for the test, but it sadly doesn't fail at the moment.
Perhaps someone understands why.

Status: Needs review » Needs work

The last submitted patch, 1079966-rename-bundle-test.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
FileSize
2.58 KB

Here is a merged patch

catch’s picture

Can you explain why the node_type_save() cache clears are moved around - I'm sure we moved them the other direction not too long ago.

There's an extra blank line in the first hunk.

The logic in field_ui looks sound to me, although it makes me wish we had crud functions for menu router items instead of info hooks + manual calls to menu_rebuild().

catch’s picture

Status: Needs review » Needs work
dawehner’s picture

Actually i just merged the patch from you in, so i'm not totally sure why this was done.

catch’s picture

Oh dear :( I knew I remembered something but didn't realise it was a few comments up

Trying to remember back to June - we needed to clear the cache in both update and insert hooks before anything was invoked. It feels like that leaves a potential race condition if the cache is set again before the hooks are done, so I think it does need work for that and that's clearly my fault.

steinmb’s picture

Subscribing. Got a few D6 upgraded sites that throw those errors all over the place, pls. let me know I you need help testing patches.

Best reg.
steinmb

Todd Young’s picture

Title: Undefined index: in _field_ui_bundle_admin_path() line 309 in field_ui.module » Notice: Undefined index: [custom_content_type_machine_name] in _field_ui_bundle_admin_path(), line 309 in field_ui.module
Version: 7.x-dev » 8.x-dev
Status: Active » Needs work
Issue tags: -book, -undefined index +Needs tests, +Needs issue summary update, +Needs backport to D7

Still seeing this error on D7.8, subscribing.

dawehner’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
FileSize
1.67 KB

Actually it doesn't need tests anymore.

So let's try out what happens if you don't reorder the stuff in node.module
I guess if the test passes this is optional at the first place.

xjm’s picture

+++ b/modules/field_ui/field_ui.testundefined
@@ -411,6 +411,21 @@ class FieldUIManageFieldsTestCase extends FieldUITestCase {
+   * Test renaming a bundle.

This is super nitpicky but I believe this is supposed to be "Tests..." rather than "Test..."

dawehner’s picture

Okay you should know it :)

catch’s picture

Status: Needs review » Needs work
+}
+
+
+/**

Extra line break.

Otherwise looks good to me.

dawehner’s picture

Status: Needs work » Needs review
FileSize
1.67 KB

Here is the new version.

chx’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me as well.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 7.x and 8.x. Thanks!

klonos’s picture

Thank you people!

Status: Fixed » Closed (fixed)
Issue tags: -Needs issue summary update, -Needs backport to D7

Automatically closed -- issue fixed for 2 weeks with no activity.