Skip to content

[5.x]: Links in error summaries no longer work with Matrix fields #15797

@MoritzLost

Description

@MoritzLost

What happened?

Description

When saving an entry causes validation errors, the error messages in the summary above the form are anchor links that should scroll to the field in question:

Screenshot 2024-09-26 at 16 35 19

I found that this no longer words if the error is inside a Matrix field. I've only checked Matrix fields that are set to display as inline blocks. Might also be an issue if the field is set to card or element index view.

Steps to reproduce

  1. Create a Matrix field set to inline view and select an entry type with a required field.
  2. On a new entry, create an entry in the Matrix field and leave the required field empty.
  3. Save the entry.
  4. Click on the link in the error summary about the empty required field.

Expected behavior

The links should always scroll to the field in question, even inside an inline matrix block.

Actual behavior

Clicking on the links doesn't do anything.

Craft CMS version

5.4.5.1

PHP version

8.3

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions