the field permissions module in 7 does this:

  $field_permissions = (isset($field['settings']['field_permissions']) && is_array($field['settings']['field_permissions']) ? array_filter($field['settings']['field_permissions']) : array());
  if (empty($field_permissions)) {
    return;
  }

That is, it checks to see if field permissions are defined at all. If not, it simply returns.

For this reason, I think in email.module near line 224 we need to change:

    if (!field_permissions_field_access('view', $field_info, $object_type, $object, $user)) {

-to-

    if (FALSE === field_permissions_field_access('view', $field_info, $object_type, $object, $user)) {
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Matthew Davidson’s picture

Status: Active » Needs review
FileSize
573 bytes

The above works fine, but is there a reason why we need to hard-code support for field_permissions rather than just calling field_access()?

(Also if email_mail_page() is only ever invoked as a menu callback we should return MENU_ACCESS_DENIED or MENU_NOT_FOUND instead of invoking drupal_access_denied() or drupal_not_found().)

BWPanda’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Status: Needs review » Reviewed & tested by the community

Patch works for me. Had 'page not found' error, applied patch, error gone and form working again.

mh86’s picture

Status: Reviewed & tested by the community » Fixed

Patch from #1 had a serious problem, as it used $field_name as parameter instead of $field_info.
Changed that, as well as the MENU_ACCESS_DENIED/MENU_NOT_FOUND, and committed it.

Thanks for the contributions.

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

changed typo in line number