Skip to content

[6.x] Fix numbers being considered empty by field conditions - #15257

Merged
jasonvarga merged 1 commit into
6.xfrom
fix-numeric-empty-conditions
Aug 26, 2026
Merged

[6.x] Fix numbers being considered empty by field conditions#15257
jasonvarga merged 1 commit into
6.xfrom
fix-numeric-empty-conditions

Conversation

@duncanmcclean

Copy link
Copy Markdown
Member

This pull request fixes an issue where fields with empty/not empty conditions targeting an integer field would be hidden, even when the target field had a value.

This was happening because the validator's isEmpty helper falls through to Object.keys(value).length === 0, and Object.keys() of a number is always an empty array — so any number was considered empty. It only ever appeared to work while typing, since text inputs produce strings (whose Object.keys() are their character indexes).

This PR fixes it by treating numbers as never empty — including 0, since a saved zero is a value rather than an absence.

@jasonvarga
jasonvarga merged commit af54ef5 into 6.x Aug 26, 2026
65 checks passed
@jasonvarga
jasonvarga deleted the fix-numeric-empty-conditions branch August 26, 2026 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants