CQ5.6 xtype:pathfield regex "Uncaught TypeError"
Hi there, I'm using the CQ5.6.1 and try to create a component config dialog with a "pathfield" item,
I configured "regex" & "regexText" for this pathfield for the validation purpose, however when I saved code change
and tried to update&save this pathfield, I got a JS error "Uncaught TypeError: undefined is not a function".
Then I checked the JS source code, seems related with the following code section from libs/cq/ui/widgets.min.js:
-----------------------------
if (this.regex && !this.regex.test(a)) {
g.push(this.regexText)
}
return g
-----------------------------
With the debug info I found the regex is String instead of RegExp object, so caused ".test" method with "undefined" error.
It should be a defect, please take a look and give a fix patch for the later release.
Regards.