Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rule boolean parameter conversion error #8

Open
howkymike opened this issue Jan 25, 2023 · 0 comments
Open

Rule boolean parameter conversion error #8

howkymike opened this issue Jan 25, 2023 · 0 comments

Comments

@howkymike
Copy link

howkymike commented Jan 25, 2023

Description

When editing a rule with an action which has a boolean parameter, the error is thrown which prevents proper form rendering (especially "Save" button action is not assigned).

Error

TypeError: paramValue.toLowerCase is not a function
    at Alfresco.RuleConfigActionCustom._convertType (rule-config_4a306578c85215e54534b99e5391c237.js:2023:31)
    at Alfresco.RuleConfigActionCustom._createCheckbox (rule-config_4a306578c85215e54534b99e5391c237.js:1596:37)
    at Alfresco.RuleConfigActionCustom.edit (rule-config_4a306578c85215e54534b99e5391c237.js:1375:28)
    at Alfresco.RuleConfigActionCustom.RuleConfig__createConfigParameterUI [as _createConfigParameterUI] (rule-config_4a306578c85215e54534b99e5391c237.js:950:40)
    at Alfresco.RuleConfigActionCustom.RuleConfig__createConfigUI [as _createConfigUI] (rule-config_4a306578c85215e54534b99e5391c237.js:772:15)
    at Alfresco.RuleConfigActionCustom.RuleConfig_displayRulConfigs [as displayRuleConfigs] (rule-config_4a306578c85215e54534b99e5391c237.js:394:18)
    at RuleEdit_constructor.RuleEditUtil_displayRuleConfigs [as displayRuleConfigs] (rule-config-util_c10402243abfc520abac3eaed8927dd7.js:290:21)
    at RuleEdit_constructor.RuleEdit_displayRule [as displayRule] (rule-edit_e5e6ad389f43182b4768920572895dbf.js:383:15)
    at RuleEdit_constructor.RuleEdit_onRuleConfigsReady [as onRuleConfigsReady] (rule-edit_e5e6ad389f43182b4768920572895dbf.js:344:18)
    at RuleEdit_constructor.RuleEditUtil_onRuleConfigReady [as onRuleConfigReady] (rule-config-util_c10402243abfc520abac3eaed8927dd7.js:173:15)

Steps to reproduce

  1. Go to Repository and Manage rules
  2. Create a new rule with action "Copy" (which contains a checkbox parameter)
  3. Edit an action

Proposed solution

In the rule-config.js file in the _convertType() function in the "d:boolean" if, add the following code:

if (typeof paramValue === "boolean") {
    return paramValue;
}

Affected file

rule-config.js

Affected version

Tested on Alfresco Community 7.2.0.

Background

It seems the connected error has been already reported by the Seng Liaw (MNT-22238) and @alexbalmus tried to fix it here which is the cause of this error.
@alexbalmus boolean values from "Set property" action are strings, whereas boolean values from action parameters are boolean values - probably this led to the mistake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant