codeeffects

Quotes in CodeEffects Rule Editor values always fails


I'm working on an issue where our users are creating a CodeEffects rule and when adding in a string expression to be evaluated sometimes use quotes in the text, this causes an error when the rule is loaded in the controller and can be seen in the CodeEffects MVC demo app (CodeEffects.Rule.Mvc.Demo.sln downloadable from the CodeEffects website):

Save fails with quotes

Specifically it fails on this line in the controller.

editor.LoadClientData(ruleData);

Newtonsoft.Json.JsonReaderException: 'After parsing a value an unexpected character was encountered: T. Path 'Elements[3].Value', line 1, position 424.'

The codeffects.com website also doesn't allow quotes and returns a generic server error.

I've had a look through the docs, but can't see any config setting that either allows quotes, or stops invalid characters being entered in the rule builder.

When I remove the quotes on the demo app, and click save, I get a successful message:

save succeeds without quotes

I would imagine we can't be the first to hit this, as adding quotes can be a natural thing for some people when creating clauses like this.

Thanks for any help - at the least it would be nice to be able to tie in some code on the editor to ignore special characters, or a client side validation (that can be hooked-in whilst using the HTML Helpers so the rule can be validated before submission)


Solution

  • This issue has already been reported in minor versions 5.0.9.x. The fix is going to be included in the next minor version due for release this month.