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

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

Closed
MoritzLost opened this issue Sep 26, 2024 · 5 comments
Closed

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

MoritzLost opened this issue Sep 26, 2024 · 5 comments
Assignees
Labels

Comments

@MoritzLost
Copy link
Contributor

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

@MoritzLost MoritzLost added the bug label Sep 26, 2024
@i-just i-just self-assigned this Sep 27, 2024
@i-just
Copy link
Contributor

i-just commented Sep 27, 2024

Hi @MoritzLost, thanks for reporting!

I have tested this against a matrix field in an inline-editable blocks view mode, and it works as expected for the first-level matrix fields. However, it gets confused if the nesting gets deeper. I’ll have a look into that!

@MoritzLost
Copy link
Contributor Author

@i-just You're right, the errors occured in nested Matrix fields one level deep. Forgot to mention that, sorry!

@i-just
Copy link
Contributor

i-just commented Sep 27, 2024

Thanks for confirming!

@i-just
Copy link
Contributor

i-just commented Sep 30, 2024

I have raised a PR for this. Thanks again for reporting!

@brandonkelly
Copy link
Member

Craft 5.4.8 is out with that fix. Thanks again!

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

No branches or pull requests

3 participants