Add hook for checking field definition access

Created on 7 July 2025, about 13 hours ago

Problem/Motivation

It is difficult, currently, to hide a core field definition from a user and apply access controls as webform submissions bypass Drupal's usual field access hooks.

It would be a great feature to add a hook so that certain base definitions are able to be hidden in various contexts. The ones I see most relevant being:
- the results table
- wherever entities are printed (downloads etc)

Steps to reproduce

1. Try to hide remote IP conditionally from results table and entity print

Proposed resolution

Add in a hook in the checkFieldDefinitionAccess function to allow other modules to unset field definitions and remove them from display.

Remaining tasks

Add tests.

User interface changes

N/A

API changes

New hook: hook_webform_submission_field_definition_access_alter().
Ability to unset field definition keys and hide them from results tables/exports.

Data model changes

N/A

Feature request
Status

Active

Version

6.3

Component

Code

Created by

🇬🇧United Kingdom littlepixiez

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024