When the component is reading the rules data, it fails with the following error:
TypeError: Cannot read properties of undefined (reading 'id')
at Rule.Node (query-builder.standalone.js:3694:22)
at new Rule (query-builder.standalone.js:4060:10)
at Group.addRule (query-builder.standalone.js:3951:28)
at QueryBuilder.addRule (query-builder.standalone.js:1376:24)
at query-builder.standalone.js:2231:30
at Array.forEach (<anonymous>)
at add (query-builder.standalone.js:2203:20)
at QueryBuilder.setRules (query-builder.standalone.js:2283:6)
at QueryBuilder.init (query-builder.standalone.js:853:14)
at $.fn.queryBuilder (query-builder.standalone.js:4153:17)
The data has not been changed. Follow the example:
Maybe the problem starts in the following line, as we don't have the attribute data inside the rule item:
model = self.addRule(group, item.data, self.parseRuleFlags(item));
But what is really causing the component to fail, is that inside the function setRoot(addRule, data, flags), the parsing to get the elements is returning a text node:
The code returning this empty node is $($.parseHTML(this.getGroupTemplate(group_id, 1)));
And follow below the JSON generated to build the component:
Error during component construction
When the component is reading the rules data, it fails with the following error:
model = self.addRule(group, item.data, self.parseRuleFlags(item));
But what is really causing the component to fail, is that inside the function setRoot(addRule, data, flags), the parsing to get the elements is returning a text node:
The code returning this empty node is
$($.parseHTML(this.getGroupTemplate(group_id, 1)));
And follow below the JSON generated to build the component:
In the meantime, is there any way for me to override this function to avoid waiting for this fix (if this is really a bug)? Thanks