Skip to content

bugfix/FOUR-27646 First Financial Bank - Validation Rules for Hidden Required Fields Inside Loops Are Inconsistently Applied#1913

Open
gustavobascope wants to merge 2 commits into
developfrom
bugfix/FOUR-27646
Open

bugfix/FOUR-27646 First Financial Bank - Validation Rules for Hidden Required Fields Inside Loops Are Inconsistently Applied#1913
gustavobascope wants to merge 2 commits into
developfrom
bugfix/FOUR-27646

Conversation

@gustavobascope

@gustavobascope gustavobascope commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Issue & Reproduction Steps

First Financial Bank - Validation Rules for Hidden Required Fields Inside Loops Are Inconsistently Applied

Expected behavior:
Hidden required fields should not be validated.
Validation should only apply to inputs that are visible and active at the time of submission.

Actual behavior:
When the screen loads, all three loop instances are created (because the default count is 3).
Even if the input fields are hidden (checkbox unchecked), the system still tries to validate them.
As a result:

Clicking Submit triggers “The field is required” errors for all hidden inputs.
If you check only the second or third checkbox and fill that input, the hidden ones still fail validation.
If you check and fill only the first input, the form submits successfully — even though the others remain hidden and empty.

This makes validation inconsistent depending on which iteration is visible or filled.

Solution

Added isVisible and insideLoop validation
image

How to Test

Create a new screen.

Add a Loop container loop_1.
Set Default Loop Count: 3

Inside loop_1, add:

A Checkbox form_checkbox_1.
A Required Line Input form_input_1.

For the Visibility Rule of form_input_1, set:

form_checkbox_1
(so the input only appears when the checkbox is checked).
Add a Submit button outside the loop.

In Preview mode:

Leave all checkboxes unchecked
Click Submit → all hidden required fields fail validation.
Check only the second or third checkbox and fill the input → hidden instances still fail validation.
Check and fill only the first instance → submission succeeds, even if other hidden fields exist.

Related Tickets & Packages

https://processmaker.atlassian.net/browse/FOUR-27646

@cypress

cypress Bot commented Jun 1, 2026

Copy link
Copy Markdown

screen-builder    Run #2305

Run Properties:  status check failed Failed #2305  •  git commit 33c19fb691: bugfix/FOUR-27646 First Financial Bank - Validation Rules for Hidden Required Fi...
Project screen-builder
Branch Review bugfix/FOUR-27646
Run status status check failed Failed #2305
Run duration 42m 18s
Commit git commit 33c19fb691: bugfix/FOUR-27646 First Financial Bank - Validation Rules for Hidden Required Fi...
Committer gustavobascope
View all properties for this run ↗︎

Test results
Tests that failed  Failures 2
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 19
Tests that did not run due to a failure in a mocha hook  Skipped 2
Tests that passed  Passing 385
View all changes introduced in this branch ↗︎

Tests for review

Failed  TCP4-4447VerifyUpdateConfigurationClipboard.spec.js • 1 failed test • CI - Chrome

View Output

Test Artifacts
TCP4-4474 Verify that the configuration made in line controls > Verify FormSelectList configuration updates sync with clipboard Test Replay Screenshots
Failed  DefaultValues.spec.js • 1 failed test • CI - Chrome

View Output

Test Artifacts
Default values > Javascript default value Test Replay Screenshots

@processmaker-sonarqube

Copy link
Copy Markdown

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.

1 participant