Skip to content

Commit d6fbba2

Browse files
author
Lukasz Borowiec
committed
#422: Adding Conditions Combination to Conditions Filter Will Cause Server Errors, Condition Filter to Break, & Infinite Loading Mask - Added QA fixes part III
1 parent fc83111 commit d6fbba2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

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

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

41-
if (keyIds !== null && element === 'Magento\\CatalogWidget\\Model\\Rule\\Condition\\Combine') {
42-
if (pairs[nextPairsExistKey.replace('NEXT_ITEM', keyIds[0])] === undefined) {
43+
if (keyIds !== null && element === combineElement) {
44+
if (pairs[nextPairsFirstKey.replace('NEXT_ITEM', keyIds[0])] === undefined ||
45+
pairs[nextPairsFirstKey.replace('NEXT_ITEM', keyIds[0])] === combineElement &&
46+
pairs[nextPairsSecondKey.replace('NEXT_ITEM', keyIds[0])] === undefined) {
4347
pairs[key] = '';
4448
}
4549
}

0 commit comments

Comments
 (0)