Notices are triggered when adding or editing taxonomy field instances to the user account settings.

Notice: Undefined index: #entity_type in taxonomy_access_form_alter() (line 470 of /Users/xjm/git/drupal/taxonomy_access/taxonomy_access.module).
Notice: Undefined index: entity keys in entity_extract_ids() (line 7375 of /Applications/MAMP/htdocs/d7/includes/common.inc).
Notice: Undefined index: field_name in field_language() (line 275 of /Applications/MAMP/htdocs/d7/modules/field/field.multilingual.inc).

The quick fix for this is to return if the form does not have an entity type defined, as in the attached patch. However, the issue raises an interesting question: what if a role has administer user permissions, but not administer taxonomy permissions? They could conceivably not have create permissions for some or all terms on a given autocomplete field. The same might actually go for content type configuration forms.

CommentFileSizeAuthor
non-entity-form.patch691 bytesxjm

Comments

xjm’s picture

Title: Notices triggered when adding a taxonomy field to user fields » Notice: Undefined index: #entity_type in taxonomy_access_form_alter() when configuring user account settings
xjm’s picture

Committed the workaround in http://drupal.org/commitlog/commit/364/a355d809a15b6a1f71d978bfecdcee438.... Leaving open to address the wider question.

xjm’s picture

Title: Notice: Undefined index: #entity_type in taxonomy_access_form_alter() when configuring user account settings » Taxonomy fields on profiles: What if a user has administer user permissions, but not administer taxonomy permissions?
xjm’s picture

Status: Needs review » Active

Better status.

xjm’s picture

Category: bug » task
xjm’s picture

Issue summary: View changes

Updated issue summary.