Skip to content

Commit 223ac52

Browse files
MAGETWO-48516: Most of category fields don't have Use Default Value option in Store/StoreView scope on the redesigned category page
1 parent 664258f commit 223ac52

File tree

3 files changed

+41
-12
lines changed

3 files changed

+41
-12
lines changed

app/code/Magento/Catalog/Model/Category/DataProvider.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ private function addUseDefaultValueCheckbox(Category $category, array $meta)
216216
)
217217
]
218218
);
219-
220219
}
221220

222221
return $meta;

lib/internal/Magento/Framework/Stdlib/ArrayManager.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class ArrayManager
3030
/**
3131
* Check if node exists
3232
*
33-
* @param string $path
33+
* @param array|string $path
3434
* @param array $data
3535
* @param string $delimiter
3636
* @return bool
@@ -43,7 +43,7 @@ public function exists($path, array $data, $delimiter = self::DEFAULT_PATH_DELIM
4343
/**
4444
* Retrieve node
4545
*
46-
* @param string $path
46+
* @param array|string $path
4747
* @param array $data
4848
* @param null $defaultValue
4949
* @param string $delimiter
@@ -57,7 +57,7 @@ public function get($path, array $data, $defaultValue = null, $delimiter = self:
5757
/**
5858
* Set value into node and return modified data
5959
*
60-
* @param string $path
60+
* @param array|string $path
6161
* @param array $data
6262
* @param mixed $value
6363
* @param string $delimiter
@@ -75,7 +75,7 @@ public function set($path, array $data, $value, $delimiter = self::DEFAULT_PATH_
7575
/**
7676
* Set value into existing node and return modified data
7777
*
78-
* @param string $path
78+
* @param array|string $path
7979
* @param array $data
8080
* @param mixed $value
8181
* @param string $delimiter
@@ -93,7 +93,7 @@ public function replace($path, array $data, $value, $delimiter = self::DEFAULT_P
9393
/**
9494
* Move value from one location to another
9595
*
96-
* @param string $path
96+
* @param array|string $path
9797
* @param string $targetPath
9898
* @param array $data
9999
* @param bool $overwrite
@@ -120,7 +120,7 @@ public function move($path, $targetPath, array $data, $overwrite = false, $delim
120120
/**
121121
* Merge value with node and return modified data
122122
*
123-
* @param string $path
123+
* @param array|string $path
124124
* @param array $data
125125
* @param array $value
126126
* @param string $delimiter
@@ -141,7 +141,7 @@ public function merge($path, array $data, array $value, $delimiter = self::DEFAU
141141
/**
142142
* Populate nested array if possible and needed
143143
*
144-
* @param string $path
144+
* @param array|string $path
145145
* @param array $data
146146
* @param string $delimiter
147147
* @return array
@@ -156,7 +156,7 @@ public function populate($path, array $data, $delimiter = self::DEFAULT_PATH_DEL
156156
/**
157157
* Remove node and return modified data
158158
*
159-
* @param string $path
159+
* @param array|string $path
160160
* @param array $data
161161
* @param string $delimiter
162162
* @return array

lib/internal/Magento/Framework/Stdlib/Test/Unit/ArrayManagerTest.php

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,12 @@ public function setDataProvider()
139139
'data' => ['existing' => ['path' => 1]],
140140
'value' => 'valuable data',
141141
'result' => ['existing' => ['path' => 1], 'new' => ['path' => [2 => 'valuable data']]]
142+
],
143+
3 => [
144+
'path' => ['new', 'path/2'],
145+
'data' => ['existing' => ['path' => 1]],
146+
'value' => 'valuable data',
147+
'result' => ['existing' => ['path' => 1], 'new' => ['path' => [2 => 'valuable data']]]
142148
]
143149
];
144150
}
@@ -178,6 +184,12 @@ public function setReplaceProvider()
178184
'data' => ['existing' => ['path' => 1]],
179185
'value' => 'valuable data',
180186
'result' => ['existing' => ['path' => 1]]
187+
],
188+
3 => [
189+
'path' => ['new', 'path', '2'],
190+
'data' => ['existing' => ['path' => 1]],
191+
'value' => 'valuable data',
192+
'result' => ['existing' => ['path' => 1]]
181193
]
182194
];
183195
}
@@ -228,6 +240,13 @@ public function moveDataProvider()
228240
'data' => ['valid' => ['path' => 'value'], 'target' => ['path' => 'exists']],
229241
'overwrite' => true,
230242
'result' => ['valid' => [], 'target' => ['path' => 'value']]
243+
],
244+
4 => [
245+
'path' => ['valid', 'path'],
246+
'targetPath' => 'target/path',
247+
'data' => ['valid' => ['path' => 'value'], 'target' => ['path' => 'exists']],
248+
'overwrite' => true,
249+
'result' => ['valid' => [], 'target' => ['path' => 'value']]
231250
]
232251
];
233252
}
@@ -267,7 +286,13 @@ public function mergeDataProvider()
267286
'data' => [],
268287
'value' => [true],
269288
'result' => []
270-
]
289+
],
290+
3 => [
291+
'path' => ['0', 'path/1'],
292+
'data' => [['path' => [false, ['value' => false]]]],
293+
'value' => ['value' => true, 'new_value' => false],
294+
'result' => [['path' => [false, ['value' => true, 'new_value' => false]]]]
295+
],
271296
];
272297
}
273298

@@ -337,7 +362,12 @@ public function removeDataProvider()
337362
'path' => 'invalid',
338363
'data' => [true],
339364
'result' => [true]
340-
]
365+
],
366+
3 => [
367+
'path' => ['simple'],
368+
'data' => ['simple' => true, 'complex' => false],
369+
'result' => ['complex' => false]
370+
],
341371
];
342372
}
343373

@@ -550,7 +580,7 @@ public function slicePathDataProvider()
550580
'offset' => -6,
551581
'length' => 3,
552582
'result' => 'path/0/goes'
553-
]
583+
],
554584
];
555585
}
556586

0 commit comments

Comments
 (0)