Skip to content

Commit de9a09d

Browse files
author
Lukasz Borowiec
committed
#422: Adding Conditions Combination to Conditions Filter Will Cause Server Errors, Condition Filter to Break, & Infinite Loading Mask - Fixes for Unit tests
1 parent c8310ed commit de9a09d

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,10 @@ define([
3636
*/
3737
_.each(pairs, function (element, key) {
3838
var keyIds = key.match(/[\d?-]+/g),
39-
combine = 'Magento\\CatalogWidget\\Model\\Rule\\Condition\\Combine',
40-
nexPairsExist;
39+
nextPairsExistKey = 'parameters[condition_source][NEXT_ITEM--1][type]';
4140

42-
if (typeof keyIds === 'object') {
43-
nexPairsExist = pairs['parameters[condition_source][' + keyIds[0] + '--1][type]'];
44-
45-
if (element === combine && nexPairsExist === undefined) {
41+
if (keyIds !== null && element === 'Magento\\CatalogWidget\\Model\\Rule\\Condition\\Combine') {
42+
if (pairs[nextPairsExistKey.replace('NEXT_ITEM', keyIds[0])] === undefined) {
4643
pairs[key] = '';
4744
}
4845
}

0 commit comments

Comments
 (0)