summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxjm2012-03-26 16:32:43 (GMT)
committer xjm2012-03-26 16:32:43 (GMT)
commit801843271f4cdd341755ef8fd1afe2a5f2bde502 (patch)
tree5600ec36808c9263c18a71d85e66e5445738fba9
parent6049a1f7d68df1f0378f2e4322a83c6cdc6aaf66 (diff)
Issue #1362210 by rooby, xjm: Fixed notice in taxonomy_access_field_attach_validate() when other modules modify the profile form.
-rw-r--r--taxonomy_access.create.inc11
1 files changed, 8 insertions, 3 deletions
diff --git a/taxonomy_access.create.inc b/taxonomy_access.create.inc
index 8cef34c..c832f28 100644
--- a/taxonomy_access.create.inc
+++ b/taxonomy_access.create.inc
@@ -616,10 +616,15 @@ function _taxonomy_access_field_validate($entity_type, $entity, &$errors) {
$old_fields = FALSE;
// The entity is actually a "pseudo-entity," and the user profile form
- // neglects to include the uid. So, load it.
+ // neglects to include the uid. So, we need to load it manually.
if ($entity_type == 'user') {
- if ($account = user_load_by_name($entity->name)) {
- $entity->uid = $account->uid;
+ // Some modules which extend the user profile form cause additional
+ // validation to happen with "pseudo-entities" that do not include the
+ // name. So, check if it exists.
+ if (isset($entity->name)) {
+ if ($account = user_load_by_name($entity->name)) {
+ $entity->uid = $account->uid;
+ }
}
}