Skip to content

Commit 880c3a6

Browse files
authored
Merge pull request #161 from episerver/user/thng/AFORM-4451-Error-when-going-to-back-next-step-on-depend-form
AFORM-4451: error when going to back next step on depend form
2 parents 9b59ff1 + 54736a1 commit 880c3a6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/@episerver/forms-sdk/src/form-depend-conditions/ConditionFunctions.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function Equals(actualValue: any, dependencyFieldValue: string): boolean {
2929
* @returns
3030
*/
3131
function NotEquals(actualValue: any, dependencyFieldValue: string): boolean {
32-
const _actualValue = !actualValue ? "" : getConcatString(actualValue, ",").toLocaleUpperCase();
32+
const _actualValue = !actualValue ? "" : getConcatString(actualValue.toString(), ",").toLocaleUpperCase();
3333
dependencyFieldValue = !dependencyFieldValue ? "" : dependencyFieldValue.toLocaleUpperCase();
3434
return _actualValue !== dependencyFieldValue;
3535
}
@@ -40,7 +40,7 @@ function NotEquals(actualValue: any, dependencyFieldValue: string): boolean {
4040
* @returns
4141
*/
4242
function Contains(actualValue: any, dependencyFieldValue: string): boolean {
43-
const _actualValue = isNull(actualValue) ? "" : getConcatString(actualValue, ",").toLocaleUpperCase();
43+
const _actualValue = isNull(actualValue) ? "" : getConcatString(actualValue.toString(), ",").toLocaleUpperCase();
4444
dependencyFieldValue = !dependencyFieldValue ? "" : dependencyFieldValue.toLocaleUpperCase();
4545
return _actualValue.indexOf(dependencyFieldValue) >= 0;
4646
}
@@ -51,7 +51,7 @@ function Contains(actualValue: any, dependencyFieldValue: string): boolean {
5151
* @returns
5252
*/
5353
function NotContains(actualValue: any, dependencyFieldValue: string): boolean {
54-
const _actualValue = !actualValue ? "" : getConcatString(actualValue, ",").toLocaleUpperCase();
54+
const _actualValue = !actualValue ? "" : getConcatString(actualValue.toString(), ",").toLocaleUpperCase();
5555
const actualValueNull = isNullOrEmpty(_actualValue)
5656
const dependencyFieldValueNull = isNullOrEmpty(dependencyFieldValue)
5757
return (!actualValueNull && dependencyFieldValueNull) ||
@@ -66,6 +66,6 @@ function NotContains(actualValue: any, dependencyFieldValue: string): boolean {
6666
*/
6767
function MatchRegularExpression(actualValue: any, patternOfExpected: string): boolean {
6868
var regex = new RegExp(patternOfExpected, "igm");
69-
const _actualValue = !actualValue ? "" : getConcatString(actualValue, ",");
69+
const _actualValue = !actualValue ? "" : getConcatString(actualValue.toString(), ",");
7070
return isNullOrEmpty(patternOfExpected) || (!isNullOrEmpty(patternOfExpected) && regex.test(_actualValue));
7171
}

0 commit comments

Comments
 (0)