Skip to content

Conversation

@mcraeteisha
Copy link
Contributor

@mcraeteisha mcraeteisha commented Nov 24, 2025

Issue

When checkboxes with initiallyChecked: true are unchecked in a loop and the user returns to the process task, all checkboxes appear checked despite correct false values in the data.

Solution

Two locations in DataManager.js and DefaultValues.js used falsy checks instead of explicit undefined checks. Replaced falsy checks with explicit undefined checks to preserve false boolean values.

How To Test

  1. Create a Process with a Task that has a Screen
  2. Add a Gateway after the Task that routes back to the same Task (creating a loop)
  3. Within the Task Screen, add a Form Loop component
  4. Inside the Form Loop, add one or more Checkbox components
  5. Configure the Checkboxes with initiallyChecked: true (checkboxes should appear checked by default)
  6. Save and start a new Process Request
  7. On the initial Task screen, observe that all checkboxes within the loop are checked (as expected)
  8. Uncheck some (but not all) checkboxes
  9. Submit the Task to proceed to the Gateway
  10. Complete the Gateway to route back to the same Task
  11. Expected Result: When the Task screen loads again, the checkbox states should be preserved:
    • Checkboxes that were unchecked should remain unchecked
    • Checkboxes that were checked should remain checked

Code Review Checklist

  • I have pulled this code locally and tested it on my instance, along with any associated packages.
  • This code adheres to ProcessMaker Coding Guidelines.
  • This code includes a unit test or an E2E test that tests its functionality, or is covered by an existing test.
  • This solution fixes the bug reported in the original ticket.
  • This solution does not alter the expected output of a component in a way that would break existing Processes.
  • This solution does not implement any breaking changes that would invalidate documentation or cause existing Processes to fail.
  • This solution has been tested with enterprise packages that rely on its functionality and does not introduce bugs in those packages.
  • This code does not duplicate functionality that already exists in the framework or in ProcessMaker.
  • This ticket conforms to the PRD associated with this part of ProcessMaker.

Note

Use explicit undefined checks (instead of falsy) when resolving variable values and defaults to prevent overwriting false booleans, ensuring checkbox states persist.

  • Mixins:
    • src/mixins/extensions/DataManager.js:
      • Resolve each variable via IIFE: check vdata then data for !== undefined before falling back to initialValue.
    • src/mixins/extensions/DefaultValues.js:
      • Track ${name}_was_filled__ using !== undefined checks for both vdata and data.
      • On mount, only apply default when the bound value is === undefined (not falsy).

Written by Cursor Bugbot for commit 735ab9c. This will update automatically on new commits. Configure here.

@cypress
Copy link

cypress bot commented Nov 25, 2025

screen-builder    Run #2106

Run Properties:  status check failed Failed #2106  •  git commit 735ab9cfd8: FOUR-23542 | Checkboxes Are Not Visually Unchecked
Project screen-builder
Branch Review defect/FOUR-23542
Run status status check failed Failed #2106
Run duration 09m 50s
Commit git commit 735ab9cfd8: FOUR-23542 | Checkboxes Are Not Visually Unchecked
Committer Teisha McRae
View all properties for this run ↗︎

Test results
Tests that failed  Failures 26
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 0
Tests that passed  Passing 363
View all changes introduced in this branch ↗︎

Tests for review

Failed  DatePicker.spec.js • 2 failed tests • CI - Chrome

View Output

Test Artifacts
Date Picker > Date type with readOnly as true shouldn't be able to clear the date Test Replay Screenshots
Date Picker > Date picker with default value should show the default value on input and data Test Replay Screenshots
Failed  ComplexScreen.spec.js • 1 failed test • CI - Chrome

View Output

Test Artifacts
Complex screen > Fill page 1 Test Replay Screenshots
Failed  FormTextArea.spec.js • 1 failed test • CI - Chrome

View Output

Test Artifacts
Form Text Area Field > Default Value Test Replay Screenshots
Failed  ComputedFields.spec.js • 1 failed test • CI - Chrome

View Output

Test Artifacts
Computed fields > Make sure that test calc was not bypassed Test Replay Screenshots
Failed  DefaultValues.spec.js • 6 failed tests • CI - Chrome

View Output

Test Artifacts
Default values > Basic default value Test Replay Screenshots
Default values > Text Input Default value if the variable has the next format "people.firstName" Test Replay Screenshots
Default values > Select List- Default if the variable has the next format "numbers.int" Test Replay Screenshots
Default values > Javascript default value Test Replay Screenshots
Default values > Dynamic Basic default value Test Replay Screenshots
Default values > Dynamic Javascript default value Test Replay Screenshots

The first 5 failed specs are shown, see all 17 specs in Cypress Cloud.

@processmaker-sonarqube
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

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