Download & Extend

Taxonomy fields on profiles: What if a user has administer user permissions, but not administer taxonomy permissions?

Project:Taxonomy Access Control
Version:7.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

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.

AttachmentSizeStatusTest resultOperations
non-entity-form.patch691 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 35,795 pass(es).View details | Re-test

Comments

#1

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

#2

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

#3

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?

#4

Status:needs review» active

Better status.

#5

Category:bug report» task
nobody click here