Skip to content

Field editability conditions #16805

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 1, 2025

Conversation

brandonkelly
Copy link
Member

Description

Groups the existing field layout element conditions into a fieldset labelled “Visibility Conditions”, and adds a new “Editability Conditions” fieldset below it for custom fields, with “Current User Condition”.

The two condition fieldsets

When a custom field has editability conditions, they will be matched against the current user. If the user isn’t a match, the field will be displayed statically (read-only).

Related issues

Copy link

linear bot commented Mar 1, 2025

@brandonkelly brandonkelly merged commit 884090b into 5.7 Mar 1, 2025
@brandonkelly brandonkelly deleted the feature/cms-1369-field-editabilitiy-conditions branch March 1, 2025 11:12
@AugustMiller
Copy link
Contributor

Safe to assume that the "visibility" of a field is still a prerequisite for editability, in the underlying controller? Say I were to POST directly to elements/save—historically, only fields that are “visible” are actually populated with request data.

(It looks to me like fields must be visible and editable, now, to be picked up, due to the implicit showInForm() check against user conditions—they're just applied at different stages.)

I think our current documentation on read-only field inputs should cover this, but I will expand the list of circumstances that a field might be rendered in static mode. ✌️

@brandonkelly
Copy link
Member Author

@AugustMiller Correct, a field must be both visible and editable to accept POST changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants