Skip to content

Commit 217ee88

Browse files
committed
Merge remote-tracking branch 'origin/2.3-develop' into MC-19242
2 parents 57a3eca + 63cf5b3 commit 217ee88

File tree

96 files changed

+1712
-1104
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+1712
-1104
lines changed

app/code/Magento/AmqpStore/README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1-
# Amqp Store
1+
# Magento_AmqpStore module
22

3-
**AmqpStore** provides ability to specify store before publish messages with Amqp.
3+
The Magento_AmqpStore module provides the ability to specify a store before publishing messages with the Advanced Message Queuing Protocol (AMQP).
4+
5+
## Extensibility
6+
7+
Extension developers can interact with the Magento_AmqpStore module using plugins. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html).
8+
9+
[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_AmqpStore module.

app/code/Magento/Backend/Block/System/Store/Edit/Form/Store.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
7+
declare(strict_types=1);
8+
69
namespace Magento\Backend\Block\System\Store\Edit\Form;
710

811
/**
@@ -129,6 +132,7 @@ protected function _prepareStoreFieldset(\Magento\Framework\Data\Form $form)
129132
'label' => __('Sort Order'),
130133
'value' => $storeModel->getSortOrder(),
131134
'required' => false,
135+
'class' => 'validate-number validate-zero-or-greater',
132136
'disabled' => $storeModel->isReadOnly()
133137
]
134138
);

app/code/Magento/Backend/Block/System/Store/Edit/Form/Website.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
7+
declare(strict_types=1);
8+
69
namespace Magento\Backend\Block\System\Store\Edit\Form;
710

811
/**
@@ -85,6 +88,7 @@ protected function _prepareStoreFieldset(\Magento\Framework\Data\Form $form)
8588
'label' => __('Sort Order'),
8689
'value' => $websiteModel->getSortOrder(),
8790
'required' => false,
91+
'class' => 'validate-number validate-zero-or-greater',
8892
'disabled' => $websiteModel->isReadOnly()
8993
]
9094
);

app/code/Magento/Backend/i18n/en_US.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ Minute,Minute
258258
"To use this website you must first enable JavaScript in your browser.","To use this website you must first enable JavaScript in your browser."
259259
"This is only a demo store. You can browse and place orders, but nothing will be processed.","This is only a demo store. You can browse and place orders, but nothing will be processed."
260260
"Report an Issue","Report an Issue"
261-
"Store View:","Store View:"
261+
"Scope:","Scope:"
262262
"Stores Configuration","Stores Configuration"
263263
"Please confirm scope switching. All data that hasn't been saved will be lost.","Please confirm scope switching. All data that hasn't been saved will be lost."
264264
"Additional Cache Management","Additional Cache Management"

app/code/Magento/Backend/view/adminhtml/templates/store/switcher.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<?php if ($websites = $block->getWebsites()) : ?>
1010

1111
<div class="store-switcher store-view">
12-
<span class="store-switcher-label"><?= $block->escapeHtml(__('Store View:')) ?></span>
12+
<span class="store-switcher-label"><?= $block->escapeHtml(__('Scope:')) ?></span>
1313
<div class="actions dropdown closable">
1414
<input type="hidden" name="store_switcher" id="store_switcher"
1515
data-role="store-view-id" data-param="<?= $block->escapeHtmlAttr($block->getStoreVarName()) ?>"

app/code/Magento/Braintree/Model/Paypal/Helper/OrderPlace.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
/**
2020
* Class OrderPlace
2121
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
22+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
2223
*/
2324
class OrderPlace extends AbstractHelper
2425
{
@@ -79,9 +80,10 @@ public function __construct(
7980
public function execute(Quote $quote, array $agreement)
8081
{
8182
if (!$this->agreementsValidator->isValid($agreement)) {
82-
throw new LocalizedException(__(
83+
$errorMsg = __(
8384
"The order wasn't placed. First, agree to the terms and conditions, then try placing your order again."
84-
));
85+
);
86+
throw new LocalizedException($errorMsg);
8587
}
8688

8789
if ($this->getCheckoutMethod($quote) === Onepage::METHOD_GUEST) {
@@ -91,12 +93,7 @@ public function execute(Quote $quote, array $agreement)
9193
$this->disabledQuoteAddressValidation($quote);
9294

9395
$quote->collectTotals();
94-
try {
95-
$this->cartManagement->placeOrder($quote->getId());
96-
} catch (\Exception $e) {
97-
$this->orderCancellationService->execute($quote->getReservedOrderId());
98-
throw $e;
99-
}
96+
$this->cartManagement->placeOrder($quote->getId());
10097
}
10198

10299
/**

app/code/Magento/Braintree/Plugin/OrderCancellation.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ public function aroundPlaceOrder(
7272
];
7373
if (in_array($payment->getMethod(), $paymentCodes)) {
7474
$incrementId = $quote->getReservedOrderId();
75-
$this->orderCancellationService->execute($incrementId);
75+
if ($incrementId) {
76+
$this->orderCancellationService->execute($incrementId);
77+
}
7678
}
7779

7880
throw $e;

app/code/Magento/Catalog/Model/Product/Image/ParamsBuilder.php

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,12 @@ public function __construct(
6868
* Build image params
6969
*
7070
* @param array $imageArguments
71+
* @param int $scopeId
7172
* @return array
7273
* @SuppressWarnings(PHPMD.NPathComplexity)
7374
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
7475
*/
75-
public function build(array $imageArguments): array
76+
public function build(array $imageArguments, int $scopeId = null): array
7677
{
7778
$miscParams = [
7879
'image_type' => $imageArguments['type'] ?? null,
@@ -81,7 +82,7 @@ public function build(array $imageArguments): array
8182
];
8283

8384
$overwritten = $this->overwriteDefaultValues($imageArguments);
84-
$watermark = isset($miscParams['image_type']) ? $this->getWatermark($miscParams['image_type']) : [];
85+
$watermark = isset($miscParams['image_type']) ? $this->getWatermark($miscParams['image_type'], $scopeId) : [];
8586

8687
return array_merge($miscParams, $overwritten, $watermark);
8788
}
@@ -117,27 +118,32 @@ private function overwriteDefaultValues(array $imageArguments): array
117118
* Get watermark
118119
*
119120
* @param string $type
121+
* @param int $scopeId
120122
* @return array
121123
*/
122-
private function getWatermark(string $type): array
124+
private function getWatermark(string $type, int $scopeId = null): array
123125
{
124126
$file = $this->scopeConfig->getValue(
125127
"design/watermark/{$type}_image",
126-
ScopeInterface::SCOPE_STORE
128+
ScopeInterface::SCOPE_STORE,
129+
$scopeId
127130
);
128131

129132
if ($file) {
130133
$size = $this->scopeConfig->getValue(
131134
"design/watermark/{$type}_size",
132-
ScopeInterface::SCOPE_STORE
135+
ScopeInterface::SCOPE_STORE,
136+
$scopeId
133137
);
134138
$opacity = $this->scopeConfig->getValue(
135139
"design/watermark/{$type}_imageOpacity",
136-
ScopeInterface::SCOPE_STORE
140+
ScopeInterface::SCOPE_STORE,
141+
$scopeId
137142
);
138143
$position = $this->scopeConfig->getValue(
139144
"design/watermark/{$type}_position",
140-
ScopeInterface::SCOPE_STORE
145+
ScopeInterface::SCOPE_STORE,
146+
$scopeId
141147
);
142148
$width = !empty($size['width']) ? $size['width'] : null;
143149
$height = !empty($size['height']) ? $size['height'] : null;

app/code/Magento/Catalog/Model/Product/Option.php

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ protected function _getResource()
167167
}
168168

169169
/**
170+
* Construct function
171+
*
170172
* @return void
171173
*/
172174
protected function _construct()
@@ -215,6 +217,8 @@ public function hasValues($type = null)
215217
}
216218

217219
/**
220+
* Get values
221+
*
218222
* @return ProductCustomOptionValuesInterface[]|null
219223
*/
220224
public function getValues()
@@ -345,7 +349,8 @@ public function groupFactory($type)
345349
}
346350

347351
/**
348-
* {@inheritdoc}
352+
* @inheritdoc
353+
*
349354
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
350355
* @since 101.0.0
351356
*/
@@ -396,6 +401,8 @@ public function beforeSave()
396401
}
397402

398403
/**
404+
* After save
405+
*
399406
* @return \Magento\Framework\Model\AbstractModel
400407
* @throws \Magento\Framework\Exception\LocalizedException
401408
*/
@@ -424,7 +431,8 @@ public function afterSave()
424431

425432
/**
426433
* Return price. If $flag is true and price is percent
427-
* return converted percent to price
434+
*
435+
* Return converted percent to price
428436
*
429437
* @param bool $flag
430438
* @return float
@@ -555,7 +563,7 @@ protected function _clearReferences()
555563
}
556564

557565
/**
558-
* {@inheritdoc}
566+
* @inheritdoc
559567
*/
560568
protected function _getValidationRulesBeforeSave()
561569
{
@@ -649,6 +657,8 @@ public function getSku()
649657
}
650658

651659
/**
660+
* Get file extension
661+
*
652662
* @return string|null
653663
*/
654664
public function getFileExtension()
@@ -657,6 +667,8 @@ public function getFileExtension()
657667
}
658668

659669
/**
670+
* Get Max Characters
671+
*
660672
* @return int|null
661673
*/
662674
public function getMaxCharacters()
@@ -665,6 +677,8 @@ public function getMaxCharacters()
665677
}
666678

667679
/**
680+
* Get image size X
681+
*
668682
* @return int|null
669683
*/
670684
public function getImageSizeX()
@@ -673,6 +687,8 @@ public function getImageSizeX()
673687
}
674688

675689
/**
690+
* Get image size Y
691+
*
676692
* @return int|null
677693
*/
678694
public function getImageSizeY()
@@ -780,6 +796,8 @@ public function setSku($sku)
780796
}
781797

782798
/**
799+
* Set File Extension
800+
*
783801
* @param string $fileExtension
784802
* @return $this
785803
*/
@@ -789,6 +807,8 @@ public function setFileExtension($fileExtension)
789807
}
790808

791809
/**
810+
* Set Max Characters
811+
*
792812
* @param int $maxCharacters
793813
* @return $this
794814
*/
@@ -798,6 +818,8 @@ public function setMaxCharacters($maxCharacters)
798818
}
799819

800820
/**
821+
* Set Image Size X
822+
*
801823
* @param int $imageSizeX
802824
* @return $this
803825
*/
@@ -807,6 +829,8 @@ public function setImageSizeX($imageSizeX)
807829
}
808830

809831
/**
832+
* Set Image Size Y
833+
*
810834
* @param int $imageSizeY
811835
* @return $this
812836
*/
@@ -816,6 +840,8 @@ public function setImageSizeY($imageSizeY)
816840
}
817841

818842
/**
843+
* Set value
844+
*
819845
* @param ProductCustomOptionValuesInterface[] $values
820846
* @return $this
821847
*/
@@ -826,7 +852,7 @@ public function setValues(array $values = null)
826852
}
827853

828854
/**
829-
* {@inheritdoc}
855+
* @inheritdoc
830856
*
831857
* @return \Magento\Catalog\Api\Data\ProductCustomOptionExtensionInterface|null
832858
*/
@@ -852,6 +878,8 @@ public function getRegularPrice()
852878
}
853879

854880
/**
881+
* Get Product Option Collection
882+
*
855883
* @param Product $product
856884
* @return \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
857885
*/
@@ -882,7 +910,7 @@ public function getProductOptionCollection(Product $product)
882910
}
883911

884912
/**
885-
* {@inheritdoc}
913+
* @inheritdoc
886914
*
887915
* @param \Magento\Catalog\Api\Data\ProductCustomOptionExtensionInterface $extensionAttributes
888916
* @return $this
@@ -894,6 +922,8 @@ public function setExtensionAttributes(
894922
}
895923

896924
/**
925+
* Get option repository
926+
*
897927
* @return Option\Repository
898928
*/
899929
private function getOptionRepository()
@@ -906,6 +936,8 @@ private function getOptionRepository()
906936
}
907937

908938
/**
939+
* Get metadata pool
940+
*
909941
* @return \Magento\Framework\EntityManager\MetadataPool
910942
*/
911943
private function getMetadataPool()
@@ -931,7 +963,7 @@ private function cleanFileExtensions()
931963
preg_match_all('/(?<extensions>[a-z0-9]+)/i', strtolower($rawExtensions), $matches);
932964
if (!empty($matches)) {
933965
$extensions = implode(', ', array_unique($matches['extensions']));
966+
$this->setFileExtension($extensions);
934967
}
935-
$this->setFileExtension($extensions);
936968
}
937969
}

0 commit comments

Comments
 (0)