File tree Expand file tree Collapse file tree 1 file changed +18
-5
lines changed
app/code/Magento/Catalog/view/adminhtml/web/js/components Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -24,10 +24,24 @@ define([
24
24
identificationDRProperty : 'option_id'
25
25
} ,
26
26
27
+ /**
28
+ * Cleans options' values from IDs because otherwise wrong IDs will be assigned.
29
+ *
30
+ * @param {Array } values
31
+ * @private
32
+ */
33
+ __cleanOptionValuesUp : function ( values ) {
34
+ values . each ( function ( value ) {
35
+ delete value [ 'option_id' ] ;
36
+ delete value [ 'option_type_id' ] ;
37
+ } )
38
+ } ,
39
+
27
40
/** @inheritdoc */
28
41
processingInsertData : function ( data ) {
29
42
var options = [ ] ,
30
- currentOption ;
43
+ currentOption ,
44
+ self = this ;
31
45
32
46
if ( ! data ) {
33
47
return ;
@@ -42,14 +56,13 @@ define([
42
56
if ( currentOption . hasOwnProperty ( 'sort_order' ) ) {
43
57
delete currentOption [ 'sort_order' ] ;
44
58
}
59
+
45
60
if ( currentOption . hasOwnProperty ( 'option_id' ) ) {
46
61
delete currentOption [ 'option_id' ] ;
47
62
}
63
+
48
64
if ( currentOption . values . length > 0 ) {
49
- currentOption . values . each ( function ( optionValue ) {
50
- delete optionValue [ 'option_id' ] ;
51
- delete optionValue [ 'option_type_id' ] ;
52
- } )
65
+ this . __cleanOptionValuesUp ( currentOption . values ) ;
53
66
}
54
67
55
68
options . push ( currentOption ) ;
You can’t perform that action at this time.
0 commit comments