[4.x]: Twig template relation condition rules bug in a matrix field
@i-just is already working on this.
Since Jun 2, 2023.
- Dominant language
- PHP
- Stars
- 3.6k
- Forks
- 705
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 134
Description
What happened?
Description
When I set-up a Matrix field with one block with functionality as per #12679 , it works as expected: one relation-field filters the second. When I use this set-up on a second block, the page needs to be saved and refreshed before filters apply.
Steps to reproduce
- Make a matrix field with one block with 2 relation fields of entry types that are related to eachother.
- Test the matrix field and see the filter working
- Add another block with the same functionality
- See that the filter is only applied after saving / refreshing
Expected behavior
When I have two relation-fields, I want to select the first one, which then acts as a filter for the second one. When the first one is selected, the second one must be filtered on opening.
Actual behavior
This works flawlessly when I have this set-up on only one of the matrix blocks I created. When I add this functionality to a second block, the filter stops working on both blocks, until I save the project and the page reloads, then the second field is filtered again.
https://github.com/craftcms/cms/assets/6756174/67f387e5-4dfd-4def-8a77-245f1cc4a8fd
Craft CMS version
4.4.13
PHP version
8.1
Operating system and version
No response
Database type and version
Mysql
Image driver and version
No response
Installed plugins and versions
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.