From 6ff4457f1a8ba95de732f222a48c09983e0562c2 Mon Sep 17 00:00:00 2001 From: Travis Tidwell Date: Sun, 17 Nov 2024 19:50:27 -0600 Subject: [PATCH] Adding other scope options to the processors. --- src/components/_classes/component/Component.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/_classes/component/Component.js b/src/components/_classes/component/Component.js index 771a1f89f2..23058c9614 100644 --- a/src/components/_classes/component/Component.js +++ b/src/components/_classes/component/Component.js @@ -8,7 +8,7 @@ import { processOne, processOneSync, validateProcessInfo } from '@formio/core/pr import { Formio } from '../../../Formio'; import * as FormioUtils from '../../../utils/utils'; import { - fastCloneDeep, boolValue, isInsideScopingComponent, currentTimezone, getScriptPlugin + fastCloneDeep, boolValue, isInsideScopingComponent, currentTimezone, getScriptPlugin, getContextualRowData } from '../../../utils/utils'; import Element from '../../../Element'; import ComponentModal from '../componentModal/ComponentModal'; @@ -3342,6 +3342,9 @@ export default class Component extends Element { * @returns {string} - The message to show when the component is invalid. */ invalidMessage(data, dirty, ignoreCondition, row) { + if (!row) { + row = getContextualRowData(this.component, data, this.paths); + } if (!ignoreCondition && !this.checkCondition(row, data)) { return ''; } @@ -3362,6 +3365,8 @@ export default class Component extends Element { data, row, path: this.path || this.component.key, + parent: this.parent?.component, + paths: this.paths, scope: validationScope, instance: this, processors: [ @@ -3446,6 +3451,7 @@ export default class Component extends Element { data, row, value: this.validationValue, + parent: this.parent?.component, paths: this.paths, path: this.path || this.component.key, instance: this,