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

Uncaught RangeError: Maximum call stack size exceeded #7

Closed
icaxis opened this issue Apr 23, 2021 · 4 comments
Closed

Uncaught RangeError: Maximum call stack size exceeded #7

icaxis opened this issue Apr 23, 2021 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@icaxis
Copy link

icaxis commented Apr 23, 2021

The field cannot work with a dependable field that depends on another fields.
Here is the used
[{
"field": "display",
"container": ".hsel_display",
"action": "show",
"rules": [{
"name": "choice",
"operator": "is",
"value": "lca_debug"
}, {
"name": "choice",
"operator": "is",
"value": "lca_awm_debug"
}],
"logic": "or"
}, {
"field": "script",
"container": ".hsel_script",
"action": "hide",
"rules": [{
"name": "logpath",
"operator": "isnotempty",
"value": ""
}, {
"name": "display",
"operator": "is",
"value": "0"
}, {
"name": "log",
"operator": "is",
"value": "0"
}],
"logic": "or"
}]

For quicker test Here's the HTML

No — Thanks Yes — Agile only Yes — LCA only Yes — Both
Yes — Please! No — Thanks
No — Thanks Yes — Please!
No — Thanks Yes — Please!
@bomsn
Copy link
Owner

bomsn commented Apr 23, 2021

Hello,
Can you share the whole HTML code so I can replicate the issue?

@icaxis
Copy link
Author

icaxis commented Apr 23, 2021

My HTML is generated by a script.

<form method="post" id="mainform" action="" enctype="multipart/form-data"> <table class="form-table"> <tbody> <tr valign="top" class="hselchoice"> <th scope="row" class="titledesc"> <label for="choice">Enable </label> </th> <td class="forminp forminp-select"> <select name="choice" id="choice" style="min-width:350px;" class=""> <option value="0">No — Thanks</option> <option value="awm">Yes — Agile only</option> <option value="">Yes — only</option> <option value="awm">Yes — Both</option> </select> </td> </tr> <tr valign="top" class="hseldisplay"> <th scope="row" class="titledesc"> <label for="display"> display </label> </th> <td class="forminp forminp-select"> <select name="display" id="display" style="min-width:350px;" class=""> <option value="1">Yes — Please!</option> <option value="0">No — Thanks</option> </select> <p class="description">Disable display of errors and warnings</p> </td> </tr> <tr valign="top" class="hsellog"> <th scope="row" class="titledesc"> <label for="log"> log </label> </th> <td class="forminp forminp-select"> <select name="log" id="log" style="min-width:350px;" class=""> <option value="0">No — Thanks</option> <option value="1">Yes — Please!</option> </select> <p class="description">Enable logging to upload plugin directory</p> </td> </tr> <tr valign="top"> <th scope="row" class="titledesc"> <label for="logpath"> log path </label> </th> <td class="forminp forminp-text"> <input name="logpath" id="logpath" type="text" style="min-width:350px;" value="" class=""> <p class="description">Enable logging to different directory</p> </td> </tr> <tr valign="top" class="hselscript"> <th scope="row" class="titledesc"> <label for="script">Script </label> </th> <td class="forminp forminp-select"> <select name="script" id="script" style="min-width:350px;" class=""> <option value="0">No — Thanks</option> <option value="1">Yes — Please!</option> </select> <p class="description">Use dev versions of core JS and CSS files (only needed if you are modifying these core files)</p> </td> </tr> <tr valign="top" class="hselsavequeries"> <th scope="row" class="titledesc"> <label for="savequeries">Save Queries </label> </th> <td class="forminp forminp-select"> <select name="savequeries" id="savequeries" style="min-width:350px;" class=""> <option value="0">No — Thanks</option> <option value="1">Yes — Please!</option> </select> <p class="description">Each database query will be saved, the time that query took to execute, and what function called it</p> </td> </tr> </tbody> </table>
<script type="text/x-rules" id="rules-mf-conditional-fields">[{"field":"display","container":".hseldisplay","action":"show","rules":[{"name":"choice","operator":"is","value":""},{"name":"choice","operator":"is","value":"awm"}],"logic":"or"},{"field":"script","container":".hselscript","action":"show","rules":[{"name":"logpath","operator":"isnotempty","value":""},{"name":"display","operator":"is","value":"0"},{"name":"log","operator":"is","value":"0"}],"logic":"or"}]</script>


Save changes

@bomsn
Copy link
Owner

bomsn commented Apr 23, 2021

Thanks, I'm going to review and get back to you.

@bomsn bomsn added the bug Something isn't working label Apr 23, 2021
@bomsn bomsn self-assigned this Apr 23, 2021
@bomsn
Copy link
Owner

bomsn commented Apr 23, 2021

The issue was due to a recent update we did to support grouped rules. It's fixed now + we have added a new option to set how deep should the script go in showing/hiding dependent fields for additional safety, it's set to 3 levels of depth by default.

@bomsn bomsn closed this as completed Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants