Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
The langcode
field widget is not hidden when denying access via hook_entity_field_access()
.
Proposed resolution
Slightly modify hook_form_alter()
implementation in language.modue since it happens after hook_entity_field_access()
.
Remaining tasks
N/A
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Release notes snippet
N/A
Original report by [username]
N/A
Comments
Comment #2
ibustosAttached test evidencing the problem.
Comment #3
ibustosComment #4
ibustosForgot to specify the @group. My bad.
Comment #5
ibustosComment #6
ibustosComment #8
ibustosComment #9
joachim CreditAttribution: joachim commentedLooks good to me. Thanks!
Comment #10
alexpottNice bug fix and great test coverage.
Committed and pushed f6674fa417 to 8.7.x and efefc9236c to 8.6.x. Thanks!
Quite extreme to deny access to everything but it works within the context of the test. I think we could file a follow-up to make field_test_boolean_access_denied_entity_field_access() more generic and rename its module and use it here.
Comment #13
a_mitch CreditAttribution: a_mitch commentedThis if statement in language.module was throwing warnings when i form i had didn't have #access set inside $form['langcode'].
I have attached a small patch that checks if #access is not set or is false.
Comment #18
quietone CreditAttribution: quietone at PreviousNext commentedThis was committed to 8.6. It was re-opened due to a problem when #access is not defined on the form. Instead, lets made a follow up to explore that problem,
Follow up creates #3270660: Warning if #access not defined on form. Restoring meta data to the time this was committed.
Cheers.
Comment #19
quietone CreditAttribution: quietone at PreviousNext commentedMoved patch and credit to new issue.