Skip to content

Commit ae6e243

Browse files
committed
Merge branch '2.3-develop' of github.com:magento/magento2ce into 2.3-develop-pangolin
2 parents b297db8 + f16c0c4 commit ae6e243

File tree

28 files changed

+165
-60
lines changed

28 files changed

+165
-60
lines changed

app/code/Magento/Bundle/etc/db_schema.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@
4545
<constraint xsi:type="foreign" name="CAT_PRD_BNDL_OPT_VAL_OPT_ID_CAT_PRD_BNDL_OPT_OPT_ID"
4646
table="catalog_product_bundle_option_value" column="option_id"
4747
referenceTable="catalog_product_bundle_option" referenceColumn="option_id" onDelete="CASCADE"/>
48-
<constraint xsi:type="unique" name="CATALOG_PRODUCT_BUNDLE_OPTION_VALUE_OPTION_ID_STORE_ID">
49-
<column name="option_id"/>
50-
<column name="store_id"/>
51-
</constraint>
5248
<constraint xsi:type="unique" name="CAT_PRD_BNDL_OPT_VAL_OPT_ID_PARENT_PRD_ID_STORE_ID">
5349
<column name="option_id"/>
5450
<column name="parent_product_id"/>

app/code/Magento/BundleImportExport/Model/Export/RowCustomizer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,8 @@ protected function getFormattedBundleSelections($optionValues, SelectionCollecti
242242
'price' => $selection->getSelectionPriceValue(),
243243
'default' => $selection->getIsDefault(),
244244
'default_qty' => $selection->getSelectionQty(),
245-
'price_type' => $this->getPriceTypeValue($selection->getSelectionPriceType())
245+
'price_type' => $this->getPriceTypeValue($selection->getSelectionPriceType()),
246+
'can_change_qty' => $selection->getSelectionCanChangeQty(),
246247
];
247248
$bundleData .= $optionValues
248249
. ImportModel::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR

app/code/Magento/BundleImportExport/Model/Import/Product/Type/Bundle.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ protected function populateSelectionTemplate($selection, $optionId, $parentId, $
299299
} else {
300300
$productId = $selection['product_id'];
301301
}
302+
302303
$populatedSelection = [
303304
'selection_id' => null,
304305
'option_id' => (int)$optionId,
@@ -310,7 +311,8 @@ protected function populateSelectionTemplate($selection, $optionId, $parentId, $
310311
? self::SELECTION_PRICE_TYPE_FIXED : self::SELECTION_PRICE_TYPE_PERCENT,
311312
'selection_price_value' => (isset($selection['price'])) ? (float)$selection['price'] : 0.0,
312313
'selection_qty' => (isset($selection['default_qty'])) ? (float)$selection['default_qty'] : 1.0,
313-
'selection_can_change_qty' => 1,
314+
'selection_can_change_qty' => isset($selection['can_change_qty'])
315+
? ($selection['can_change_qty'] ? 1 : 0) : 1,
314316
];
315317
if (isset($selection['selection_id'])) {
316318
$populatedSelection['selection_id'] = $selection['selection_id'];

app/code/Magento/BundleImportExport/Test/Unit/Model/Export/Product/RowCustomizerTest.php

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,20 @@ protected function setUp()
105105
);
106106
$this->selection = $this->createPartialMock(
107107
\Magento\Catalog\Model\Product::class,
108-
['getSku', 'getSelectionPriceValue', 'getIsDefault', 'getSelectionQty', 'getSelectionPriceType']
108+
[
109+
'getSku',
110+
'getSelectionPriceValue',
111+
'getIsDefault',
112+
'getSelectionQty',
113+
'getSelectionPriceType',
114+
'getSelectionCanChangeQty'
115+
]
109116
);
110117
$this->selection->expects($this->any())->method('getSku')->willReturn(1);
111118
$this->selection->expects($this->any())->method('getSelectionPriceValue')->willReturn(1);
112119
$this->selection->expects($this->any())->method('getSelectionQty')->willReturn(1);
113120
$this->selection->expects($this->any())->method('getSelectionPriceType')->willReturn(1);
121+
$this->selection->expects($this->any())->method('getSelectionCanChangeQty')->willReturn(1);
114122
$this->selectionsCollection = $this->createPartialMock(
115123
\Magento\Bundle\Model\ResourceModel\Selection\Collection::class,
116124
['getIterator', 'addAttributeToSort']
@@ -168,6 +176,19 @@ public function testAddData()
168176
'additional_attributes' => $attributes
169177
];
170178
$preparedRow = $preparedData->addData($dataRow, 1);
179+
180+
$bundleValues = [
181+
'name=title',
182+
'type=1',
183+
'required=1',
184+
'sku=1',
185+
'price=1',
186+
'default=',
187+
'default_qty=1',
188+
'price_type=percent',
189+
'can_change_qty=1',
190+
];
191+
171192
$expected = [
172193
'sku' => 'sku1',
173194
'additional_attributes' => 'attribute=1,attribute2="Text",attribute3=One,Two,Three',
@@ -176,7 +197,7 @@ public function testAddData()
176197
'bundle_sku_type' => 'fixed',
177198
'bundle_price_view' => 'As low as',
178199
'bundle_weight_type' => 'fixed',
179-
'bundle_values' => 'name=title,type=1,required=1,sku=1,price=1,default=,default_qty=1,price_type=percent'
200+
'bundle_values' => implode(',', $bundleValues)
180201
];
181202
$this->assertEquals($expected, $preparedRow);
182203
}

app/code/Magento/Config/App/Config/Type/System.php

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public function get($path = '')
141141
$pathParts = explode('/', $path);
142142
if (count($pathParts) === 1 && $pathParts[0] !== 'default') {
143143
if (!isset($this->data[$pathParts[0]])) {
144-
$data = $this->reader->read();
144+
$data = $this->readData();
145145
$this->data = array_replace_recursive($data, $this->data);
146146
}
147147
return $this->data[$pathParts[0]];
@@ -171,7 +171,7 @@ private function loadAllData()
171171
{
172172
$cachedData = $this->cache->load($this->configType);
173173
if ($cachedData === false) {
174-
$data = $this->reader->read();
174+
$data = $this->readData();
175175
} else {
176176
$data = $this->serializer->unserialize($cachedData);
177177
}
@@ -188,7 +188,7 @@ private function loadDefaultScopeData($scopeType)
188188
{
189189
$cachedData = $this->cache->load($this->configType . '_' . $scopeType);
190190
if ($cachedData === false) {
191-
$data = $this->reader->read();
191+
$data = $this->readData();
192192
$this->cacheData($data);
193193
} else {
194194
$data = [$scopeType => $this->serializer->unserialize($cachedData)];
@@ -216,7 +216,7 @@ private function loadScopeData($scopeType, $scopeId)
216216
if (is_array($this->availableDataScopes) && !isset($this->availableDataScopes[$scopeType][$scopeId])) {
217217
return [$scopeType => [$scopeId => []]];
218218
}
219-
$data = $this->reader->read();
219+
$data = $this->readData();
220220
$this->cacheData($data);
221221
} else {
222222
$data = [$scopeType => [$scopeId => $this->serializer->unserialize($cachedData)]];
@@ -282,6 +282,21 @@ private function getDataByPathParts($data, $pathParts)
282282
return $data;
283283
}
284284

285+
/**
286+
* The freshly read data.
287+
*
288+
* @return array
289+
*/
290+
private function readData(): array
291+
{
292+
$this->data = $this->reader->read();
293+
$this->data = $this->postProcessor->process(
294+
$this->data
295+
);
296+
297+
return $this->data;
298+
}
299+
285300
/**
286301
* Clean cache and global variables cache
287302
*

app/code/Magento/Config/App/Config/Type/System/Reader.php

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,13 @@ class Reader
2727
*/
2828
private $preProcessor;
2929

30-
/**
31-
* @var \Magento\Framework\App\Config\Spi\PostProcessorInterface
32-
*/
33-
private $postProcessor;
34-
3530
/**
3631
* Reader constructor.
3732
* @param \Magento\Framework\App\Config\ConfigSourceInterface $source
3833
* @param \Magento\Store\Model\Config\Processor\Fallback $fallback
3934
* @param \Magento\Framework\App\Config\Spi\PreProcessorInterface $preProcessor
4035
* @param \Magento\Framework\App\Config\Spi\PostProcessorInterface $postProcessor
36+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
4137
*/
4238
public function __construct(
4339
\Magento\Framework\App\Config\ConfigSourceInterface $source,
@@ -48,7 +44,6 @@ public function __construct(
4844
$this->source = $source;
4945
$this->fallback = $fallback;
5046
$this->preProcessor = $preProcessor;
51-
$this->postProcessor = $postProcessor;
5247
}
5348

5449
/**
@@ -60,11 +55,9 @@ public function __construct(
6055
*/
6156
public function read()
6257
{
63-
return $this->postProcessor->process(
64-
$this->fallback->process(
65-
$this->preProcessor->process(
66-
$this->source->get()
67-
)
58+
return $this->fallback->process(
59+
$this->preProcessor->process(
60+
$this->source->get()
6861
)
6962
);
7063
}

app/code/Magento/Config/Test/Unit/App/Config/Type/System/ReaderTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,6 @@ public function testGetCachedWithLoadDefaultScopeData()
8484
->method('process')
8585
->with($data)
8686
->willReturn($data);
87-
$this->postProcessor->expects($this->once())
88-
->method('process')
89-
->with($data)
90-
->willReturn($data);
9187
$this->assertEquals($data, $this->model->read());
9288
}
9389
}

app/code/Magento/Config/Test/Unit/App/Config/Type/SystemTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,12 @@ public function testGetNotCached()
170170
$this->reader->expects($this->once())
171171
->method('read')
172172
->willReturn($data);
173+
$this->postProcessor->expects($this->once())
174+
->method('process')
175+
->with($data)
176+
->willReturn($data);
173177

174178
$this->assertEquals($url, $this->configType->get($path));
179+
$this->assertEquals($url, $this->configType->get($path));
175180
}
176181
}

app/code/Magento/Deploy/Console/ConsoleLogger.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ class ConsoleLogger extends AbstractLogger
8282
LogLevel::CRITICAL => OutputInterface::VERBOSITY_NORMAL,
8383
LogLevel::ERROR => OutputInterface::VERBOSITY_NORMAL,
8484
LogLevel::WARNING => OutputInterface::VERBOSITY_NORMAL,
85-
LogLevel::NOTICE => OutputInterface::VERBOSITY_VERBOSE,
86-
LogLevel::INFO => OutputInterface::VERBOSITY_VERY_VERBOSE,
85+
LogLevel::NOTICE => OutputInterface::VERBOSITY_NORMAL,
86+
LogLevel::INFO => OutputInterface::VERBOSITY_VERBOSE,
8787
LogLevel::DEBUG => OutputInterface::VERBOSITY_DEBUG
8888
];
8989

app/code/Magento/Deploy/Process/Queue.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public function process()
161161
foreach ($packages as $name => $packageJob) {
162162
$this->assertAndExecute($name, $packages, $packageJob);
163163
}
164-
$this->logger->notice('.');
164+
$this->logger->info('.');
165165
sleep(3);
166166
foreach ($this->inProgress as $name => $package) {
167167
if ($this->isDeployed($package)) {
@@ -214,7 +214,7 @@ private function awaitForAllProcesses()
214214
unset($this->inProgress[$name]);
215215
}
216216
}
217-
$this->logger->notice('.');
217+
$this->logger->info('.');
218218
sleep(5);
219219
}
220220
if ($this->isCanBeParalleled()) {

0 commit comments

Comments
 (0)