Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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)) {
Comment | File | Size | Author |
---|---|---|---|
#1 | email-contact_form_access-1272394-1.patch | 573 bytes | Matthew Davidson |
Comments
Comment #1
Matthew Davidson CreditAttribution: Matthew Davidson commentedThe 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().)
Comment #2
BWPanda CreditAttribution: BWPanda commentedPatch works for me. Had 'page not found' error, applied patch, error gone and form working again.
Comment #3
mh86 CreditAttribution: mh86 commentedPatch 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.
Comment #4.0
(not verified) CreditAttribution: commentedchanged typo in line number