File tree Expand file tree Collapse file tree 3 files changed +10
-50
lines changed
Ui/view/base/web/js/form/components Expand file tree Collapse file tree 3 files changed +10
-50
lines changed Original file line number Diff line number Diff line change @@ -1120,7 +1120,6 @@ protected function _saveProductAttributes(array $attributesData)
1120
1120
{
1121
1121
foreach ($ attributesData as $ tableName => $ skuData ) {
1122
1122
$ tableData = [];
1123
- $ where = [];
1124
1123
foreach ($ skuData as $ sku => $ attributes ) {
1125
1124
$ productId = $ this ->skuProcessor ->getNewSku ($ sku )['entity_id ' ];
1126
1125
@@ -1133,30 +1132,8 @@ protected function _saveProductAttributes(array $attributesData)
1133
1132
'value ' => $ storeValue ,
1134
1133
];
1135
1134
}
1136
- /*
1137
- If the store based values are not provided for a particular store,
1138
- we default to the default scope values.
1139
- In this case, remove all the existing store based values stored in the table.
1140
- */
1141
- $ where [] = $ this ->_connection ->quoteInto (
1142
- '(store_id NOT IN (?) ' ,
1143
- array_keys ($ storeValues )
1144
- ) . $ this ->_connection ->quoteInto (
1145
- ' AND attribute_id = ? ' ,
1146
- $ attributeId
1147
- ) . $ this ->_connection ->quoteInto (
1148
- ' AND entity_id = ?) ' ,
1149
- $ productId
1150
- );
1151
- if (count ($ where ) >= self ::ATTRIBUTE_DELETE_BUNCH ) {
1152
- $ this ->_connection ->delete ($ tableName , implode (' OR ' , $ where ));
1153
- $ where = [];
1154
- }
1155
1135
}
1156
1136
}
1157
- if (!empty ($ where )) {
1158
- $ this ->_connection ->delete ($ tableName , implode (' OR ' , $ where ));
1159
- }
1160
1137
$ this ->_connection ->insertOnDuplicate ($ tableName , $ tableData , ['value ' ]);
1161
1138
}
1162
1139
return $ this ;
Original file line number Diff line number Diff line change @@ -504,18 +504,6 @@ public function testSaveProductAttributes()
504
504
$ this ->_connection ->expects ($ this ->any ())
505
505
->method ('quoteInto ' )
506
506
->willReturnCallback ([$ this , 'returnQuoteCallback ' ]);
507
- $ this ->_connection
508
- ->expects ($ this ->once ())
509
- ->method ('delete ' )
510
- ->with (
511
- $ this ->equalTo ($ testTable ),
512
- $ this ->equalTo (
513
- '(store_id NOT IN ( '
514
- . $ storeId . ') AND attribute_id = '
515
- . $ attributeId . ' AND entity_id = '
516
- . self ::ENTITY_ID . ') '
517
- )
518
- );
519
507
520
508
$ tableData [] = [
521
509
'entity_id ' => self ::ENTITY_ID ,
Original file line number Diff line number Diff line change @@ -57,34 +57,29 @@ define([
57
57
* @param {Object } elem
58
58
*/
59
59
validate : function ( elem ) {
60
- var source = this . source ,
61
- result = elem . delegate ( 'validate' ) ,
62
- invalid = false ;
60
+ var result = elem . delegate ( 'validate' ) ,
61
+ invalid ;
63
62
64
- _ . some ( result , function ( item ) {
65
- return ! item . valid && ( invalid = item . target ) ;
63
+ invalid = _ . find ( result , function ( item ) {
64
+ return ! item . valid ;
66
65
} ) ;
67
66
68
- if ( invalid && ! source . get ( 'params.invalid' ) ) {
69
- source . set ( 'params.invalid' , true ) ;
70
-
67
+ if ( invalid ) {
71
68
elem . activate ( ) ;
72
- invalid . focused ( true ) ;
69
+ invalid . target . focused ( true ) ;
73
70
}
71
+
72
+ return invalid ;
74
73
} ,
75
74
76
75
/**
77
76
* Sets 'allValid' property of instance to true, then calls 'validate' method
78
77
* of instance for each element.
79
78
*/
80
79
onValidate : function ( ) {
81
- var elems ;
82
-
83
- elems = this . elems . sortBy ( function ( elem ) {
80
+ this . elems . sortBy ( function ( elem ) {
84
81
return ! elem . active ( ) ;
85
- } ) ;
86
-
87
- elems . forEach ( this . validate , this ) ;
82
+ } ) . some ( this . validate , this ) ;
88
83
}
89
84
} ) ;
90
85
} ) ;
You can’t perform that action at this time.
0 commit comments