Skip to content

Commit 97a4750

Browse files
Merge branch '2.3-develop' into MC-19585
2 parents 03287f0 + ebee07a commit 97a4750

File tree

52 files changed

+1062
-390
lines changed

Some content is hidden

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

52 files changed

+1062
-390
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/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/CatalogUrlRewrite/Observer/AfterImportDataObserver.php

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -299,12 +299,16 @@ protected function _populateForUrlGeneration($rowData)
299299
*/
300300
private function isNeedToPopulateForUrlGeneration($rowData, $newSku, $oldSku): bool
301301
{
302-
if ((empty($newSku) || !isset($newSku['entity_id']))
303-
|| ($this->import->getRowScope($rowData) == ImportProduct::SCOPE_STORE
304-
&& empty($rowData[self::URL_KEY_ATTRIBUTE_CODE]))
305-
|| (array_key_exists($rowData[ImportProduct::COL_SKU], $oldSku)
306-
&& !isset($rowData[self::URL_KEY_ATTRIBUTE_CODE])
307-
&& $this->import->getBehavior() === ImportExport::BEHAVIOR_APPEND)) {
302+
if ((
303+
(empty($newSku) || !isset($newSku['entity_id']))
304+
|| ($this->import->getRowScope($rowData) == ImportProduct::SCOPE_STORE
305+
&& empty($rowData[self::URL_KEY_ATTRIBUTE_CODE]))
306+
|| (array_key_exists(strtolower($rowData[ImportProduct::COL_SKU]), $oldSku)
307+
&& !isset($rowData[self::URL_KEY_ATTRIBUTE_CODE])
308+
&& $this->import->getBehavior() === ImportExport::BEHAVIOR_APPEND)
309+
)
310+
&& !isset($rowData["categories"])
311+
) {
308312
return false;
309313
}
310314
return true;
@@ -477,7 +481,7 @@ protected function currentUrlRewritesRegenerate()
477481
$url = $currentUrlRewrite->getIsAutogenerated()
478482
? $this->generateForAutogenerated($currentUrlRewrite, $category)
479483
: $this->generateForCustom($currentUrlRewrite, $category);
480-
$urlRewrites = array_merge($urlRewrites, $url);
484+
$urlRewrites = $url + $urlRewrites;
481485
}
482486

483487
$this->product = null;

app/code/Magento/Checkout/view/frontend/templates/cart/item/default.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ $canApplyMsrp = $helper->isShowBeforeOrderConfirm($product) && $helper->isMinima
5050
<?php if (isset($_formatedOptionValue['full_view'])) :?>
5151
<?= $block->escapeHtml($_formatedOptionValue['full_view']) ?>
5252
<?php else :?>
53-
<?= $block->escapeHtml($_formatedOptionValue['value'], ['span']) ?>
53+
<?= $block->escapeHtml($_formatedOptionValue['value'], ['span', 'a']) ?>
5454
<?php endif; ?>
5555
</dd>
5656
<?php endforeach; ?>

app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@
4444
<!-- ko if: Array.isArray(option.value) -->
4545
<span data-bind="html: option.value.join('<br>')"></span>
4646
<!-- /ko -->
47-
<!-- ko ifnot: Array.isArray(option.value) -->
47+
<!-- ko if: (!Array.isArray(option.value) && option.option_type == 'file') -->
48+
<span data-bind="html: option.value"></span>
49+
<!-- /ko -->
50+
<!-- ko if: (!Array.isArray(option.value) && option.option_type != 'file') -->
4851
<span data-bind="text: option.value"></span>
4952
<!-- /ko -->
5053
</dd>

app/code/Magento/Cron/Console/Command/CronInstallCommand.php

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Cron\Console\Command;
79

810
use Magento\Framework\Crontab\CrontabManagerInterface;
@@ -19,6 +21,9 @@
1921
*/
2022
class CronInstallCommand extends Command
2123
{
24+
private const COMMAND_OPTION_FORCE = 'force';
25+
private const COMMAND_OPTION_NON_OPTIONAL = 'non-optional';
26+
2227
/**
2328
* @var CrontabManagerInterface
2429
*/
@@ -44,19 +49,27 @@ public function __construct(
4449
}
4550

4651
/**
47-
* {@inheritdoc}
52+
* @inheritdoc
4853
*/
4954
protected function configure()
5055
{
5156
$this->setName('cron:install')
5257
->setDescription('Generates and installs crontab for current user')
53-
->addOption('force', 'f', InputOption::VALUE_NONE, 'Force install tasks');
58+
->addOption(self::COMMAND_OPTION_FORCE, 'f', InputOption::VALUE_NONE, 'Force install tasks')
59+
// @codingStandardsIgnoreStart
60+
->addOption(self::COMMAND_OPTION_NON_OPTIONAL, 'd', InputOption::VALUE_NONE, 'Install only the non-optional (default) tasks');
61+
// @codingStandardsIgnoreEnd
5462

5563
parent::configure();
5664
}
5765

5866
/**
59-
* {@inheritdoc}
67+
* Executes "cron:install" command.
68+
*
69+
* @param InputInterface $input
70+
* @param OutputInterface $output
71+
* @return int|null
72+
* @throws LocalizedException
6073
*/
6174
protected function execute(InputInterface $input, OutputInterface $output)
6275
{
@@ -65,8 +78,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
6578
return Cli::RETURN_FAILURE;
6679
}
6780

81+
$tasks = $this->tasksProvider->getTasks();
82+
if ($input->getOption(self::COMMAND_OPTION_NON_OPTIONAL)) {
83+
$tasks = $this->extractNonOptionalTasks($tasks);
84+
}
85+
6886
try {
69-
$this->crontabManager->saveTasks($this->tasksProvider->getTasks());
87+
$this->crontabManager->saveTasks($tasks);
7088
} catch (LocalizedException $e) {
7189
$output->writeln('<error>' . $e->getMessage() . '</error>');
7290
return Cli::RETURN_FAILURE;
@@ -76,4 +94,23 @@ protected function execute(InputInterface $input, OutputInterface $output)
7694

7795
return Cli::RETURN_SUCCESS;
7896
}
97+
98+
/**
99+
* Returns an array of non-optional tasks
100+
*
101+
* @param array $tasks
102+
* @return array
103+
*/
104+
private function extractNonOptionalTasks(array $tasks = []): array
105+
{
106+
$defaultTasks = [];
107+
108+
foreach ($tasks as $taskCode => $taskParams) {
109+
if (!$taskParams['optional']) {
110+
$defaultTasks[$taskCode] = $taskParams;
111+
}
112+
}
113+
114+
return $defaultTasks;
115+
}
79116
}

0 commit comments

Comments
 (0)