Catalog Client Script

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2016 12:42 PM
Hello, I tried to create a catalog client script but this error appeared when i submitted;
Here is an attachment about this issue:
Note: The last catalog client script that I created was on March 22 of this year.
I checked if this might be related with an upgrade on my instance in the "upgrade history", and i noticed that the last upgrade was on April.
Here an attachment as an evidence.
Now I have upgraded my instance to Helsinki, I did it to check if this issue was related with the last upgrade in the Geneva version, but the same issue appeared when i tried to create the catalog client script on Helsinki.
Could anybody tell me what is happening with my catalog client scripts?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2016 01:55 PM
The client script Validate Client Script Func Declaration is what is doing that. Deactivate that for now.
Of course, now your catalog clients scripts won't be validated that they are the "correct" function declaration (onChange for onChange, etc). But at least you'll be able to do work if this is off.
If you toString the function, you get this:
function validateFunctionDeclaration(fieldName, functionName) {
var code = g_form.getValue(fieldName);
if (code == "")
return true;
code = removeCommentsFromClientScript(code);
var patternString = "function(\\s+)" + functionName + "((\\s+)|\\(|\\[\r\n])";
var validatePattern = new RegExp(patternString);
if (!validatePattern.test(code)) {
var msg = new GwtMessage().getMessage('Missing function declaration for') + ' ' + functionName;
g_form.showErrorBox(fieldName, msg);
return false;
}
return true;
}
So make sure your validateFunctionDeclaration reads as that, because mine is working fine in Geneva Patch 5.