Posted by cwells on September 7, 2011 at 7:22pm
6 followers
| Project: | Email Field |
| Version: | 7.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
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)) {
Comments
#1
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().)
#2
Patch works for me. Had 'page not found' error, applied patch, error gone and form working again.
#3
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.
#4
Automatically closed -- issue fixed for 2 weeks with no activity.