Skip to content
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

Feature/cms 1177 map element errors to field containers with data error key #14212

Conversation

i-just
Copy link
Contributor

@i-just i-just commented Jan 26, 2024

Description

Fields now have a data-error-key attribute, which allows us to identify the key their validation errors have. This way, JS can accurately find and display errors for the correct fields. It simplifies deep linking from the error summary and improves the visibility of errors in the slideouts (e.g. for the matrix field).

The key is added primarily via fieldlayoutelements/BaseField.
Additionally, models/FieldLayoutForm gets a new $errorKeyPrefix property, which is used to prefix the attribute value (e.g. for nested fields, like matrix).

Screenshot 2024-01-26 at 07 51 54 Screenshot 2024-01-26 at 07 53 15 Screenshot 2024-01-26 at 07 53 43

Related issues

cms-1177
#12290

Copy link

linear bot commented Jan 26, 2024

…containers-with-data-error-key

# Conflicts:
#	src/web/assets/cp/dist/cp.js
#	src/web/assets/cp/dist/cp.js.map
…containers-with-data-error-key

# Conflicts:
#	src/fields/Matrix.php
[ci skip]
@brandonkelly brandonkelly merged commit 7838c9b into 5.0 Jan 31, 2024
@brandonkelly brandonkelly deleted the feature/cms-1177-map-element-errors-to-field-containers-with-data-error-key branch January 31, 2024 00:07
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