Skip to content

Commit 74a6a6d

Browse files
author
Lukasz Borowiec
committed
#422: Adding Conditions Combination to Conditions Filter Will Cause Server Errors, Condition Filter to Break, & Infinite Loading Mask - The Combine Condition rule needs to have children, if does not have, we cannot parse the rule in the backend
1 parent e1facfc commit 74a6a6d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/js/form/provider/conditions-data-processor.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,22 @@ define([
2626
if (key.indexOf('parameters[' + attribute + ']') === 0) {
2727
// Remove the bad, un-normalized data.
2828
delete data[key];
29-
3029
pairs[key] = element;
3130
}
3231
});
3332

33+
/*
34+
* The Combine Condition rule needs to have children,
35+
* if does not have, we cannot parse the rule in the backend.
36+
*/
37+
_.each(pairs, function (element, key) {
38+
if ((element === 'Magento\\CatalogWidget\\Model\\Rule\\Condition\\Combine')
39+
// Check if The Combine Condition Rule has children
40+
&& pairs['parameters[condition_source][' + key.match(/([\d?-])+/g)[0] + '--1][type]'] === undefined) {
41+
pairs[key] = '';
42+
}
43+
});
44+
3445
/*
3546
* Add pairs in case conditions source is not rules configurator
3647
*/

0 commit comments

Comments
 (0)