Skip to content

4.1 Fix screen validation for multiple loops referencing the same variable#1177

Closed
sanjacornelius wants to merge 6 commits into4.1-developfrom
bugfix/FOUR-5188-4.1
Closed

4.1 Fix screen validation for multiple loops referencing the same variable#1177
sanjacornelius wants to merge 6 commits into4.1-developfrom
bugfix/FOUR-5188-4.1

Conversation

@sanjacornelius
Copy link
Copy Markdown
Contributor

@sanjacornelius sanjacornelius commented Jan 26, 2022

Issue & Reproduction Steps

Ticket: FOUR-5188

Steps to Reproduce:

  1. Add a loop to the screen; This will be Loop A
  2. Set the Data Source for Loop A to be 'Existing'
  3. Set the variable name to 'accounts'
  4. Add an input field with the required validation to the loop
  5. Add a second loop to the screen; This will be Loop B
  6. Replicate steps 2-4 for Loop B (Ensure Loop B has the same variable name as Loop A )
  7. Add a submit button
  8. Preview the form and set the Data Input to
{
	"accounts": [
		{
			"foo": "foobar"
		}
	]
}
  1. Fill out Loop B input field
  2. Submit the form

Expected behavior:
The form should not submit with validation errors.

Actual behavior:
The form submits with validation errors in Loop A

Solution

  • Check for sibling loops on the screen that reference the same variable. If siblings are found, merge the validations so all fields are included.

How to Test

  1. Test the steps above
  2. Run the cypress test Loop.spec

Related Tickets & Packages

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.

@sanjacornelius sanjacornelius changed the title Fix screen validation for multiple loops referencing the same variable Fix screen validation for multiple loops referencing the same variable 4.1 Jan 26, 2022
@sanjacornelius sanjacornelius changed the title Fix screen validation for multiple loops referencing the same variable 4.1 4.1 Fix screen validation for multiple loops referencing the same variable Jan 26, 2022
@caleeli caleeli removed their request for review May 9, 2022 16:44
@boliviacoca boliviacoca self-requested a review May 9, 2022 18:23
@sanjacornelius
Copy link
Copy Markdown
Contributor Author

Closing no longer needed

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