diff --git a/sites/v2/modules/contrib/field_permissions/field_permissions.module b/sites/v2/modules/contrib/field_permissions/field_permissions.module index 9bef90b..4bdd619 100644 --- a/sites/v2/modules/contrib/field_permissions/field_permissions.module +++ b/sites/v2/modules/contrib/field_permissions/field_permissions.module @@ -171,17 +171,17 @@ function _field_permissions_field_view_access($field_name, $obj_type, $object, $ * Implementation of hook_field_access('edit'). */ function _field_permissions_field_edit_access($field_name, $obj_type, $object, $account) { + // Check if user has access to edit this field on object creation. + if (!isset($object)) { + return user_access('create ' . $field_name, $account); + } + // Check if the object is already created. // @TODO: There is an exception warning that is issued here, hence the @. We // should remove the @ when the Drupal core bug is fixed. You can find the // bug here: http://drupal.org/node/1301522 list($id, $vid, $bundle) = @entity_extract_ids($obj_type, $object); - // Check if user has access to edit this field on object creation. - if (!isset($id)) { - return user_access('create ' . $field_name, $account); - } - // Check if user has access to edit this field in any object. if (user_access('edit ' . $field_name, $account)) { return TRUE;