Skip to content

Commit b2a8085

Browse files
committed
Merge remote-tracking branch 'origin/2.3-develop' into graphQl-292-payment-method-list
# Conflicts: # app/code/Magento/QuoteGraphQl/etc/schema.graphqls
2 parents fe8cc05 + 192e28a commit b2a8085

File tree

532 files changed

+13672
-7657
lines changed

Some content is hidden

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

532 files changed

+13672
-7657
lines changed

app/code/Magento/AsynchronousOperations/Model/MassConsumer.php

+16-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
namespace Magento\AsynchronousOperations\Model;
1010

1111
use Magento\Framework\App\ResourceConnection;
12+
use Magento\Framework\Registry;
1213
use Psr\Log\LoggerInterface;
1314
use Magento\Framework\MessageQueue\MessageLockException;
1415
use Magento\Framework\MessageQueue\ConnectionLostException;
@@ -58,6 +59,11 @@ class MassConsumer implements ConsumerInterface
5859
*/
5960
private $operationProcessor;
6061

62+
/**
63+
* @var Registry
64+
*/
65+
private $registry;
66+
6167
/**
6268
* Initialize dependencies.
6369
*
@@ -67,14 +73,16 @@ class MassConsumer implements ConsumerInterface
6773
* @param ConsumerConfigurationInterface $configuration
6874
* @param OperationProcessorFactory $operationProcessorFactory
6975
* @param LoggerInterface $logger
76+
* @param Registry $registry
7077
*/
7178
public function __construct(
7279
CallbackInvoker $invoker,
7380
ResourceConnection $resource,
7481
MessageController $messageController,
7582
ConsumerConfigurationInterface $configuration,
7683
OperationProcessorFactory $operationProcessorFactory,
77-
LoggerInterface $logger
84+
LoggerInterface $logger,
85+
Registry $registry = null
7886
) {
7987
$this->invoker = $invoker;
8088
$this->resource = $resource;
@@ -84,20 +92,26 @@ public function __construct(
8492
'configuration' => $configuration
8593
]);
8694
$this->logger = $logger;
95+
$this->registry = $registry ?? \Magento\Framework\App\ObjectManager::getInstance()
96+
->get(Registry::class);
8797
}
8898

8999
/**
90-
* {@inheritdoc}
100+
* @inheritdoc
91101
*/
92102
public function process($maxNumberOfMessages = null)
93103
{
104+
$this->registry->register('isSecureArea', true, true);
105+
94106
$queue = $this->configuration->getQueue();
95107

96108
if (!isset($maxNumberOfMessages)) {
97109
$queue->subscribe($this->getTransactionCallback($queue));
98110
} else {
99111
$this->invoker->invoke($queue, $maxNumberOfMessages, $this->getTransactionCallback($queue));
100112
}
113+
114+
$this->registry->unregister('isSecureArea');
101115
}
102116

103117
/**

app/code/Magento/Backend/Block/Template/Context.php

+10-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* the classes they were introduced for.
1818
*
1919
* @api
20+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
2021
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2122
* @since 100.0.2
2223
*/
@@ -173,6 +174,8 @@ public function getAuthorization()
173174
}
174175

175176
/**
177+
* Get Backend Session
178+
*
176179
* @return \Magento\Backend\Model\Session
177180
*/
178181
public function getBackendSession()
@@ -181,6 +184,8 @@ public function getBackendSession()
181184
}
182185

183186
/**
187+
* Get Math Random
188+
*
184189
* @return \Magento\Framework\Math\Random
185190
*/
186191
public function getMathRandom()
@@ -189,6 +194,8 @@ public function getMathRandom()
189194
}
190195

191196
/**
197+
* Get Form Key
198+
*
192199
* @return \Magento\Framework\Data\Form\FormKey
193200
*/
194201
public function getFormKey()
@@ -197,7 +204,9 @@ public function getFormKey()
197204
}
198205

199206
/**
200-
* @return \Magento\Framework\Data\Form\FormKey
207+
* Get Class Name Builder
208+
*
209+
* @return \Magento\Framework\Code\NameBuilder
201210
*/
202211
public function getNameBuilder()
203212
{

app/code/Magento/Backend/Controller/Adminhtml/System/Design/Save.php

+10-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66
*/
77
namespace Magento\Backend\Controller\Adminhtml\System\Design;
88

9-
class Save extends \Magento\Backend\Controller\Adminhtml\System\Design
9+
use Magento\Framework\App\Action\HttpPostActionInterface;
10+
11+
/**
12+
* Save design action.
13+
*/
14+
class Save extends \Magento\Backend\Controller\Adminhtml\System\Design implements HttpPostActionInterface
1015
{
1116
/**
1217
* Filtering posted data. Converting localized data if needed
@@ -26,6 +31,8 @@ protected function _filterPostData($data)
2631
}
2732

2833
/**
34+
* Save design action.
35+
*
2936
* @return \Magento\Backend\Model\View\Result\Redirect
3037
*/
3138
public function execute()
@@ -54,10 +61,10 @@ public function execute()
5461
} catch (\Exception $e) {
5562
$this->messageManager->addErrorMessage($e->getMessage());
5663
$this->_objectManager->get(\Magento\Backend\Model\Session::class)->setDesignData($data);
57-
return $resultRedirect->setPath('adminhtml/*/', ['id' => $design->getId()]);
64+
return $resultRedirect->setPath('*/*/edit', ['id' => $design->getId()]);
5865
}
5966
}
6067

61-
return $resultRedirect->setPath('adminhtml/*/');
68+
return $resultRedirect->setPath('*/*/');
6269
}
6370
}

app/code/Magento/Backup/Model/Backup.php

+13-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* @method string getPath()
1515
* @method string getName()
1616
* @method string getTime()
17+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
1718
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1819
* @api
1920
* @since 100.0.2
@@ -80,6 +81,7 @@ class Backup extends \Magento\Framework\DataObject implements \Magento\Framework
8081
* @param \Magento\Framework\Encryption\EncryptorInterface $encryptor
8182
* @param \Magento\Framework\Filesystem $filesystem
8283
* @param array $data
84+
* @throws \Magento\Framework\Exception\FileSystemException
8385
*/
8486
public function __construct(
8587
\Magento\Backup\Helper\Data $helper,
@@ -242,7 +244,7 @@ public function setFile(&$content)
242244
/**
243245
* Return content of backup file
244246
*
245-
* @return string
247+
* @return array
246248
* @throws \Magento\Framework\Exception\LocalizedException
247249
*/
248250
public function &getFile()
@@ -275,8 +277,9 @@ public function deleteFile()
275277
*
276278
* @param bool $write
277279
* @return $this
278-
* @throws \Magento\Framework\Exception\InputException
279280
* @throws \Magento\Framework\Backup\Exception\NotEnoughPermissions
281+
* @throws \Magento\Framework\Exception\FileSystemException
282+
* @throws \Magento\Framework\Exception\InputException
280283
*/
281284
public function open($write = false)
282285
{
@@ -330,6 +333,7 @@ protected function _getStream()
330333
*
331334
* @param int $length
332335
* @return string
336+
* @throws \Magento\Framework\Exception\InputException
333337
*/
334338
public function read($length)
335339
{
@@ -340,6 +344,7 @@ public function read($length)
340344
* Check end of file.
341345
*
342346
* @return bool
347+
* @throws \Magento\Framework\Exception\InputException
343348
*/
344349
public function eof()
345350
{
@@ -370,6 +375,7 @@ public function write($string)
370375
* Close open backup file
371376
*
372377
* @return $this
378+
* @throws \Magento\Framework\Exception\InputException
373379
*/
374380
public function close()
375381
{
@@ -383,6 +389,8 @@ public function close()
383389
* Print output
384390
*
385391
* @return string
392+
* @return \Magento\Framework\Filesystem\Directory\ReadInterface|string|void
393+
* @throws \Magento\Framework\Exception\FileSystemException
386394
*/
387395
public function output()
388396
{
@@ -398,6 +406,8 @@ public function output()
398406
}
399407

400408
/**
409+
* Get Size
410+
*
401411
* @return int|mixed
402412
*/
403413
public function getSize()
@@ -419,6 +429,7 @@ public function getSize()
419429
*
420430
* @param string $password
421431
* @return bool
432+
* @throws \Exception
422433
*/
423434
public function validateUserPassword($password)
424435
{

app/code/Magento/Braintree/Test/Unit/Model/Report/BraintreeTransactionStub.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function __get($name)
4040
}
4141

4242
/**
43-
* Checks for the existance of a property stored in the private $_attributes property
43+
* Checks for the existence of a property stored in the private $_attributes property
4444
*
4545
* @ignore
4646
* @param string $name

app/code/Magento/Bundle/Block/Adminhtml/Sales/Order/Items/Renderer.php

+14
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ public function getChildren($item)
100100
}
101101

102102
/**
103+
* Check if item can be shipped separately
104+
*
103105
* @param mixed $item
104106
* @return bool
105107
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
@@ -136,6 +138,8 @@ public function isShipmentSeparately($item = null)
136138
}
137139

138140
/**
141+
* Check if child items calculated
142+
*
139143
* @param mixed $item
140144
* @return bool
141145
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
@@ -174,6 +178,8 @@ public function isChildCalculated($item = null)
174178
}
175179

176180
/**
181+
* Retrieve selection attributes values
182+
*
177183
* @param mixed $item
178184
* @return mixed|null
179185
*/
@@ -191,6 +197,8 @@ public function getSelectionAttributes($item)
191197
}
192198

193199
/**
200+
* Retrieve order item options array
201+
*
194202
* @return array
195203
*/
196204
public function getOrderOptions()
@@ -212,6 +220,8 @@ public function getOrderOptions()
212220
}
213221

214222
/**
223+
* Retrieve order item
224+
*
215225
* @return mixed
216226
*/
217227
public function getOrderItem()
@@ -223,6 +233,8 @@ public function getOrderItem()
223233
}
224234

225235
/**
236+
* Get html info for item
237+
*
226238
* @param mixed $item
227239
* @return string
228240
*/
@@ -245,6 +257,8 @@ public function getValueHtml($item)
245257
}
246258

247259
/**
260+
* Check if we can show price info for this item
261+
*
248262
* @param object $item
249263
* @return bool
250264
*/

app/code/Magento/Bundle/view/adminhtml/templates/catalog/product/edit/tab/attributes/extend.phtml

+7-7
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ $isElementReadonly = $block->getElement()
2020
->getReadonly();
2121
?>
2222

23-
<?php if (!($attributeCode === 'price' && $block->getCanReadPrice() === false)) { ?>
23+
<?php if (!($attributeCode === 'price' && $block->getCanReadPrice() === false)): ?>
2424
<div class="<?= /* @escapeNotVerified */ $attributeCode ?> "><?= /* @escapeNotVerified */ $elementHtml ?></div>
25-
<?php } ?>
25+
<?php endif; ?>
2626

2727
<?= $block->getExtendedElement($switchAttributeCode)->toHtml() ?>
2828

@@ -43,13 +43,13 @@ $isElementReadonly = $block->getElement()
4343
} else {
4444
if ($attribute) {
4545
<?php if ($attributeCode === 'price' && !$block->getCanEditPrice() && $block->getCanReadPrice()
46-
&& $block->getProduct()->isObjectNew()) { ?>
46+
&& $block->getProduct()->isObjectNew()): ?>
4747
<?php $defaultProductPrice = $block->getDefaultProductPrice() ?: "''"; ?>
4848
$attribute.value = <?= /* @escapeNotVerified */ $defaultProductPrice ?>;
49-
<?php } else { ?>
49+
<?php else: ?>
5050
$attribute.disabled = false;
5151
$attribute.addClassName('required-entry');
52-
<?php } ?>
52+
<?php endif; ?>
5353
}
5454
if ($('dynamic-price-warning')) {
5555
$('dynamic-price-warning').hide();
@@ -58,9 +58,9 @@ $isElementReadonly = $block->getElement()
5858
}
5959

6060
<?php if (!($attributeCode === 'price' && !$block->getCanEditPrice()
61-
&& !$block->getProduct()->isObjectNew())) { ?>
61+
&& !$block->getProduct()->isObjectNew())): ?>
6262
$('<?= /* @escapeNotVerified */ $switchAttributeCode ?>').observe('change', <?= /* @escapeNotVerified */ $switchAttributeCode ?>_change);
63-
<?php } ?>
63+
<?php endif; ?>
6464
Event.observe(window, 'load', function(){
6565
<?= /* @escapeNotVerified */ $switchAttributeCode ?>_change();
6666
});

app/code/Magento/Bundle/view/adminhtml/templates/sales/invoice/create/items/renderer.phtml

+12-3
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,17 @@
2828
<?php endif; ?>
2929

3030
<?php foreach ($items as $_item): ?>
31+
<?php
32+
$shipTogether = ($_item->getOrderItem()->getProductType() == \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE) ?
33+
!$_item->getOrderItem()->isShipSeparately() : !$_item->getOrderItem()->getParentItem()->isShipSeparately()
34+
?>
3135
<?php $block->setPriceDataObject($_item) ?>
3236
<?php if ($_item->getOrderItem()->getParentItem()): ?>
37+
<?php
38+
if ($shipTogether) {
39+
continue;
40+
}
41+
?>
3342
<?php $attributes = $block->getSelectionAttributes($_item) ?>
3443
<?php if ($_prevOptionId != $attributes['option_id']): ?>
3544
<tr>
@@ -60,14 +69,14 @@
6069
</td>
6170
<?php endif; ?>
6271
<td class="col-price">
63-
<?php if ($block->canShowPriceInfo($_item)): ?>
72+
<?php if ($block->canShowPriceInfo($_item) || $shipTogether): ?>
6473
<?= $block->getColumnHtml($_item, 'price') ?>
6574
<?php else: ?>
6675
&nbsp;
6776
<?php endif; ?>
6877
</td>
6978
<td class="col-qty">
70-
<?php if ($block->canShowPriceInfo($_item)): ?>
79+
<?php if ($block->canShowPriceInfo($_item) || $shipTogether): ?>
7180
<table class="qty-table">
7281
<tr>
7382
<th><?= /* @escapeNotVerified */ __('Ordered') ?></th>
@@ -116,7 +125,7 @@
116125
<?php endif; ?>
117126
</td>
118127
<td class="col-qty-invoice">
119-
<?php if ($block->canShowPriceInfo($_item)): ?>
128+
<?php if ($block->canShowPriceInfo($_item) || $shipTogether): ?>
120129
<?php if ($block->canEditQty()) : ?>
121130
<input type="text"
122131
class="input-text admin__control-text qty-input"

0 commit comments

Comments
 (0)