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

Returning object from field condition causes it to be run infinitely #4577

Closed
AlessioGr opened this issue Dec 20, 2023 · 2 comments · Fixed by #4579
Closed

Returning object from field condition causes it to be run infinitely #4577

AlessioGr opened this issue Dec 20, 2023 · 2 comments · Fixed by #4579
Assignees
Labels
status: verified If an issue has been reproduced

Comments

@AlessioGr
Copy link
Member

AlessioGr commented Dec 20, 2023

Describe the Bug

{
      type: 'text',
      name: 'textField',
      admin: {
        condition: (props) => {
          return {
            someObject: true
          }
        },
      },
 },

Having a field like this causes the condition function to endlessly run over and over again.

Yes, you are supposed to return a boolean, but I still find it weird that returning an object is causing this to happen.

This issue was found in #4410

Payload Version

2.5.0

@AlessioGr AlessioGr added the status: verified If an issue has been reproduced label Dec 20, 2023
@AlessioGr AlessioGr self-assigned this Dec 20, 2023
@AlessioGr
Copy link
Member Author

@patricsgamma I've created a new issue for #4410 if you're interested in following it

Copy link
Contributor

github-actions bot commented Sep 7, 2024

This issue has been automatically locked.
Please open a new issue if this issue persists with any additional detail.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: verified If an issue has been reproduced
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant