Skip to content

dependsOn triggers infinite loop #421

@Mrkbingham

Description

@Mrkbingham

Winter CMS Build

1.1

PHP Version

7.4

Database engine

MySQL/MariaDB

Plugins installed

No response

Issue description

When a model has two fields that are dependent upon one another, an infinite loop occurs when the dependants are refreshed (line ~189 of winter.form.js: $('[data-field-name="' + toRefresh.fields[0] + '"]').trigger('change')

Appears to be related to this update: 712843d#diff-cf4c08be53eb135693cb4e0424261e5d15c7475d92abc4c87aff32cb81266413

Steps to replicate

Model setup:

alpha_field_one:
    type: switch
    dependsOn:
        - alpha_field_two
alpha_field_two:
    type: switch
    dependsOn:
        - alpha_field_one

Workaround

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs reviewIssues/PRs that require a review from a maintainerstaleIssues/PRs that have had no activity and may be archived

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions