Skip to content

Commit 5a5fb6d

Browse files
committed
Merge branch '2.3-develop' of https://github.com/magento/magento2ce into MC-31089
2 parents 82f1b68 + 5b9be66 commit 5a5fb6d

File tree

10 files changed

+302
-168
lines changed

10 files changed

+302
-168
lines changed

app/code/Magento/Catalog/Ui/Component/Listing/Columns/Websites.php

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
76
declare(strict_types=1);
87

98
namespace Magento\Catalog\Ui\Component\Listing\Columns;
@@ -121,31 +120,32 @@ protected function applySorting()
121120
&& !empty($sorting['direction'])
122121
&& $sorting['field'] === $this->getName()
123122
) {
123+
/** @var \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection $collection */
124124
$collection = $this->getContext()->getDataProvider()->getCollection();
125-
$collection
126-
->joinField(
127-
'websites_ids',
128-
'catalog_product_website',
129-
'website_id',
130-
'product_id=entity_id',
131-
null,
132-
'left'
133-
)
134-
->joinTable(
135-
'store_website',
136-
'website_id = websites_ids',
137-
['name'],
138-
null,
139-
'left'
140-
)
141-
->groupByAttribute('entity_id');
142-
$this->resourceHelper->addGroupConcatColumn(
143-
$collection->getSelect(),
144-
$this->websiteNames,
145-
'name'
125+
126+
$select = $collection->getConnection()->select();
127+
$select->from(
128+
['cpw' => $collection->getTable('catalog_product_website')],
129+
['product_id']
130+
)->joinLeft(
131+
['sw' => $collection->getTable('store_website')],
132+
'cpw.website_id = sw.website_id',
133+
[
134+
$this->websiteNames => new \Zend_Db_Expr(
135+
'GROUP_CONCAT(sw.name ORDER BY sw.website_id ASC SEPARATOR \',\')'
136+
)
137+
]
138+
)->group(
139+
'cpw.product_id'
146140
);
147141

148-
$collection->getSelect()->order($this->websiteNames . ' ' . $sorting['direction']);
142+
$collection->getSelect()->joinLeft(
143+
['product_websites' => $select],
144+
'product_websites.product_id = e.entity_id',
145+
[$this->websiteNames]
146+
)->order(
147+
'product_websites.' . $this->websiteNames . ' ' . $sorting['direction']
148+
);
149149
}
150150
}
151151
}

app/code/Magento/Cms/Model/ResourceModel/Block.php

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -185,13 +185,9 @@ public function getIsUniqueBlockToStores(AbstractModel $object)
185185
$entityMetadata = $this->metadataPool->getMetadata(BlockInterface::class);
186186
$linkField = $entityMetadata->getLinkField();
187187

188-
$stores = (array)$object->getData('store_id');
189-
$isDefaultStore = $this->_storeManager->isSingleStoreMode()
190-
|| array_search(Store::DEFAULT_STORE_ID, $stores) !== false;
191-
192-
if (!$isDefaultStore) {
193-
$stores[] = Store::DEFAULT_STORE_ID;
194-
}
188+
$stores = $this->_storeManager->isSingleStoreMode()
189+
? [Store::DEFAULT_STORE_ID]
190+
: (array)$object->getData('store_id');
195191

196192
$select = $this->getConnection()->select()
197193
->from(['cb' => $this->getMainTable()])
@@ -200,11 +196,8 @@ public function getIsUniqueBlockToStores(AbstractModel $object)
200196
'cb.' . $linkField . ' = cbs.' . $linkField,
201197
[]
202198
)
203-
->where('cb.identifier = ? ', $object->getData('identifier'));
204-
205-
if (!$isDefaultStore) {
206-
$select->where('cbs.store_id IN (?)', $stores);
207-
}
199+
->where('cb.identifier = ? ', $object->getData('identifier'))
200+
->where('cbs.store_id IN (?)', $stores);
208201

209202
if ($object->getId()) {
210203
$select->where('cb.' . $entityMetadata->getIdentifierField() . ' <> ?', $object->getId());

app/code/Magento/Cms/Test/Mftf/Test/CheckStaticBlocksTest.xml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,23 @@
5656
<seeInCurrentUrl url="cms/block/new" stepKey="VerifyNewBlockPageIsOpened1"/>
5757
<!--Add new BLock with the same data-->
5858
<actionGroup ref="FillOutBlockContent" stepKey="FillOutBlockContent1"/>
59-
<selectOption selector="{{BlockNewPageBasicFieldsSection.storeView}}" userInput="Default Store View" stepKey="selectDefaultStoreView" />
60-
<selectOption selector="{{BlockNewPageBasicFieldsSection.storeView}}" userInput="{{customStore.name}}" stepKey="selectSecondStoreView1" />
6159
<click selector="{{BlockNewPagePageActionsSection.saveBlock}}" stepKey="ClickToSaveBlock1"/>
6260
<waitForPageLoad stepKey="waitForPageLoad6"/>
6361
<!--Verify that corresponding message is displayed-->
6462
<see userInput="A block identifier with the same properties already exists in the selected store." stepKey="VerifyBlockIsSaved1"/>
63+
<!--Click to go back and add new block-->
64+
<click selector="{{BlockNewPagePageActionsSection.back}}" stepKey="ClickToGoBack1"/>
65+
<waitForPageLoad stepKey="waitForPageLoad7"/>
66+
<click selector="{{BlockPageActionsSection.addNewBlock}}" stepKey="ClickToAddNewBlock2"/>
67+
<waitForPageLoad stepKey="waitForPageLoad8"/>
68+
<seeInCurrentUrl url="cms/block/new" stepKey="VerifyNewBlockPageIsOpened2"/>
69+
<!--Add new BLock with the same data for another store view-->
70+
<actionGroup ref="FillOutBlockContent" stepKey="FillOutBlockContent2"/>
71+
<selectOption selector="{{BlockNewPageBasicFieldsSection.storeView}}" userInput="Default Store View" stepKey="selectDefaultStoreView" />
72+
<selectOption selector="{{BlockNewPageBasicFieldsSection.storeView}}" userInput="{{customStore.name}}" stepKey="selectSecondStoreView1" />
73+
<click selector="{{BlockNewPagePageActionsSection.saveBlock}}" stepKey="ClickToSaveBlock2"/>
74+
<waitForPageLoad stepKey="waitForPageLoad9"/>
75+
<see userInput="You saved the block." stepKey="VerifyBlockIsSaved2"/>
6576

6677
<after>
6778
<actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="DeleteWebsite">

app/code/Magento/Config/Model/Config/Importer/SaveProcessor.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,18 +91,21 @@ public function process(array $data)
9191
* @param string $scope The configuration scope (default, website, or store)
9292
* @param string $scopeCode The scope code
9393
* @return void
94+
* @throws \Magento\Framework\Exception\RuntimeException
9495
*/
9596
private function invokeSave(array $scopeData, $scope, $scopeCode = null)
9697
{
9798
$scopeData = array_keys($this->arrayUtils->flatten($scopeData));
9899

99100
foreach ($scopeData as $path) {
100101
$value = $this->scopeConfig->getValue($path, $scope, $scopeCode);
101-
$backendModel = $this->valueFactory->create($path, $value, $scope, $scopeCode);
102+
if ($value !== null) {
103+
$backendModel = $this->valueFactory->create($path, $value, $scope, $scopeCode);
102104

103-
if ($backendModel instanceof Value) {
104-
$backendModel->beforeSave();
105-
$backendModel->afterSave();
105+
if ($backendModel instanceof Value) {
106+
$backendModel->beforeSave();
107+
$backendModel->afterSave();
108+
}
106109
}
107110
}
108111
}

app/code/Magento/Config/Test/Unit/Model/Config/Importer/SaveProcessorTest.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,4 +136,37 @@ public function testProcess()
136136

137137
$this->assertSame(null, $this->model->process($data));
138138
}
139+
140+
public function testProcessWithNullValues()
141+
{
142+
$data = [
143+
'default' => [
144+
'advanced' => ['modules_disable_output' => ['Test_Module' => '1']]
145+
],
146+
'websites' => ['test_website' => ['general' => ['locale' => ['timezone' => 'America/Rio_Branco']]]],
147+
];
148+
$this->arrayUtilsMock->expects($this->exactly(2))
149+
->method('flatten')
150+
->willReturnMap([
151+
[
152+
[
153+
'advanced' => ['modules_disable_output' => ['Test_Module' => '1']]
154+
],
155+
'',
156+
'/',
157+
['advanced/modules_disable_output/Test_Module' => '1']
158+
],
159+
[
160+
['general' => ['locale' => ['timezone' => 'America/Rio_Branco']]],
161+
'',
162+
'/',
163+
['general/locale/timezone' => 'America/Rio_Branco']
164+
]
165+
]);
166+
$this->scopeConfigMock->expects($this->exactly(2))
167+
->method('getValue')
168+
->willReturn(null);
169+
170+
$this->assertSame(null, $this->model->process($data));
171+
}
139172
}

app/code/Magento/Paypal/Model/Payflowlink.php

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class Payflowlink extends \Magento\Paypal\Model\Payflowpro
3636
*
3737
* @var string
3838
*/
39-
protected $_code = \Magento\Paypal\Model\Config::METHOD_PAYFLOWLINK;
39+
protected $_code = Config::METHOD_PAYFLOWLINK;
4040

4141
/**
4242
* @var string
@@ -116,6 +116,11 @@ class Payflowlink extends \Magento\Paypal\Model\Payflowpro
116116
*/
117117
private $mathRandom;
118118

119+
/**
120+
* @var \Magento\Framework\App\RequestInterface
121+
*/
122+
private $_requestHttp;
123+
119124
/**
120125
* @param \Magento\Framework\Model\Context $context
121126
* @param \Magento\Framework\Registry $registry
@@ -237,8 +242,8 @@ public function isActive($storeId = null)
237242
public function initialize($paymentAction, $stateObject)
238243
{
239244
switch ($paymentAction) {
240-
case \Magento\Paypal\Model\Config::PAYMENT_ACTION_AUTH:
241-
case \Magento\Paypal\Model\Config::PAYMENT_ACTION_SALE:
245+
case Config::PAYMENT_ACTION_AUTH:
246+
case Config::PAYMENT_ACTION_SALE:
242247
$payment = $this->getInfoInstance();
243248
/** @var Order $order */
244249
$order = $payment->getOrder();
@@ -345,6 +350,7 @@ protected function _processOrder(\Magento\Sales\Model\Order $order)
345350
$payment->registerAuthorizationNotification($payment->getBaseAmountAuthorized());
346351
break;
347352
case self::TRXTYPE_SALE:
353+
$order->setState(Order::STATE_PROCESSING);
348354
$payment->registerCaptureNotification($payment->getBaseAmountAuthorized());
349355
break;
350356
default:
@@ -500,14 +506,12 @@ public function buildBasicRequest()
500506
*/
501507
protected function _getTrxTokenType()
502508
{
503-
switch ($this->getConfigData('payment_action')) {
504-
case \Magento\Paypal\Model\Config::PAYMENT_ACTION_AUTH:
505-
return self::TRXTYPE_AUTH_ONLY;
506-
case \Magento\Paypal\Model\Config::PAYMENT_ACTION_SALE:
507-
return self::TRXTYPE_SALE;
508-
default:
509-
break;
510-
}
509+
$tokenTypes = [
510+
Config::PAYMENT_ACTION_AUTH => self::TRXTYPE_AUTH_ONLY,
511+
Config::PAYMENT_ACTION_SALE => self::TRXTYPE_SALE
512+
];
513+
514+
return $tokenTypes[$this->getConfigData('payment_action')] ?? '';
511515
}
512516

513517
/**

app/code/Magento/Sales/Model/Order/ProductOption.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public function add(OrderItemInterface $orderItem): void
6161
{
6262
/** @var DataObject $request */
6363
$request = $orderItem->getBuyRequest();
64+
$request->setProductOptions($orderItem->getProductOptions());
6465

6566
$productType = $orderItem->getProductType();
6667
if (isset($this->processorPool[$productType])

app/code/Magento/Tax/Model/Sales/Total/Quote/CommonTaxCollector.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,7 @@ public function mapItems(
383383
$priceIncludesTax,
384384
$useBaseCurrency
385385
);
386+
// phpcs:ignore Magento2.Performance.ForeachArrayMerge
386387
$itemDataObjects = array_merge($itemDataObjects, $extraTaxableItems);
387388
}
388389
} else {
@@ -394,6 +395,7 @@ public function mapItems(
394395
$priceIncludesTax,
395396
$useBaseCurrency
396397
);
398+
// phpcs:ignore Magento2.Performance.ForeachArrayMerge
397399
$itemDataObjects = array_merge($itemDataObjects, $extraTaxableItems);
398400
}
399401
}
@@ -591,7 +593,10 @@ protected function processProductItems(
591593
$total->setSubtotalInclTax($subtotalInclTax);
592594
$total->setBaseSubtotalTotalInclTax($baseSubtotalInclTax);
593595
$total->setBaseSubtotalInclTax($baseSubtotalInclTax);
594-
$shippingAssignment->getShipping()->getAddress()->setBaseSubtotalTotalInclTax($baseSubtotalInclTax);
596+
$address = $shippingAssignment->getShipping()->getAddress();
597+
$address->setBaseSubtotalTotalInclTax($baseSubtotalInclTax);
598+
$address->setSubtotal($total->getSubtotal());
599+
$address->setBaseSubtotal($total->getBaseSubtotal());
595600

596601
return $this;
597602
}
@@ -799,6 +804,7 @@ public function convertAppliedTaxes($appliedTaxes, $baseAppliedTaxes, $extraInfo
799804
'rates' => $rates,
800805
];
801806
if (!empty($extraInfo)) {
807+
// phpcs:ignore Magento2.Performance.ForeachArrayMerge
802808
$appliedTaxArray = array_merge($appliedTaxArray, $extraInfo);
803809
}
804810

0 commit comments

Comments
 (0)