Skip to content

Commit 2e676bf

Browse files
committed
Merge branch '2.3-develop' of github.com:magento/graphql-ce into 2.3-develop#354
2 parents e18e4ac + 908ed15 commit 2e676bf

File tree

348 files changed

+10053
-7582
lines changed

Some content is hidden

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

348 files changed

+10053
-7582
lines changed

app/code/Magento/AuthorizenetAcceptjs/etc/payment.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Payment:etc/payment.xsd">
1010
<methods>
1111
<method name="authorizenet_acceptjs">
12-
<allow_multiple_address>1</allow_multiple_address>
12+
<allow_multiple_address>0</allow_multiple_address>
1313
</method>
1414
</methods>
1515
</payment>

app/code/Magento/AuthorizenetAcceptjs/view/base/requirejs-config.js

+4-10
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,10 @@
44
*/
55

66
var config = {
7-
shim: {
8-
acceptjs: {
9-
exports: 'Accept'
10-
},
11-
acceptjssandbox: {
12-
exports: 'Accept'
7+
map: {
8+
'*': {
9+
acceptjssandbox: 'https://jstest.authorize.net/v1/Accept.js',
10+
acceptjs: 'https://js.authorize.net/v1/Accept.js'
1311
}
14-
},
15-
paths: {
16-
acceptjssandbox: 'https://jstest.authorize.net/v1/Accept',
17-
acceptjs: 'https://js.authorize.net/v1/Accept'
1812
}
1913
};

app/code/Magento/AuthorizenetAcceptjs/view/base/web/js/view/payment/acceptjs-factory.js

+11-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ define([
1616
dependency = 'acceptjssandbox';
1717
}
1818

19-
require([dependency], function (accept) {
19+
require([dependency], function () {
2020
var $body = $('body');
2121

2222
/*
@@ -26,7 +26,16 @@ define([
2626
* Dynamically-loading-Accept-js-E-WC-03-Accept-js-is-not-loaded/td-p/63283
2727
*/
2828
$body.on('handshake.acceptjs', function () {
29-
deferred.resolve(accept);
29+
/*
30+
* Accept.js doesn't return the library when loading
31+
* and requirejs "shim" can't be used because it only works with the "paths" config option
32+
* and we can't use "paths" because require will try to load ".min.js" in production
33+
* and that doesn't work because it doesn't exist
34+
* and we can't add a query string to force a URL because accept.js will reject it
35+
* and we can't include it locally because they check in the script before loading more scripts
36+
* So, we use the global version as "shim" would
37+
*/
38+
deferred.resolve(window.Accept);
3039
$body.off('handshake.acceptjs');
3140
});
3241
},

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

+11-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
* the classes they were introduced for.
1818
*
1919
* @api
20+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
2021
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
22+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
2123
* @since 100.0.2
2224
*/
2325
class Context extends \Magento\Framework\View\Element\Template\Context
@@ -173,6 +175,8 @@ public function getAuthorization()
173175
}
174176

175177
/**
178+
* Get backend session instance.
179+
*
176180
* @return \Magento\Backend\Model\Session
177181
*/
178182
public function getBackendSession()
@@ -181,6 +185,8 @@ public function getBackendSession()
181185
}
182186

183187
/**
188+
* Get math random instance.
189+
*
184190
* @return \Magento\Framework\Math\Random
185191
*/
186192
public function getMathRandom()
@@ -189,6 +195,8 @@ public function getMathRandom()
189195
}
190196

191197
/**
198+
* Get form key instance.
199+
*
192200
* @return \Magento\Framework\Data\Form\FormKey
193201
*/
194202
public function getFormKey()
@@ -197,7 +205,9 @@ public function getFormKey()
197205
}
198206

199207
/**
200-
* @return \Magento\Framework\Data\Form\FormKey
208+
* Get name builder instance.
209+
*
210+
* @return \Magento\Framework\Code\NameBuilder
201211
*/
202212
public function getNameBuilder()
203213
{

app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/AbstractRenderer.php

+21-5
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ abstract class AbstractRenderer extends \Magento\Backend\Block\AbstractBlock imp
2828
protected $_column;
2929

3030
/**
31+
* Set column for renderer.
32+
*
3133
* @param Column $column
3234
* @return $this
3335
*/
@@ -38,6 +40,8 @@ public function setColumn($column)
3840
}
3941

4042
/**
43+
* Returns row associated with the renderer.
44+
*
4145
* @return Column
4246
*/
4347
public function getColumn()
@@ -48,7 +52,7 @@ public function getColumn()
4852
/**
4953
* Renders grid column
5054
*
51-
* @param Object $row
55+
* @param DataObject $row
5256
* @return string
5357
*/
5458
public function render(DataObject $row)
@@ -66,7 +70,7 @@ public function render(DataObject $row)
6670
/**
6771
* Render column for export
6872
*
69-
* @param Object $row
73+
* @param DataObject $row
7074
* @return string
7175
*/
7276
public function renderExport(DataObject $row)
@@ -75,7 +79,9 @@ public function renderExport(DataObject $row)
7579
}
7680

7781
/**
78-
* @param Object $row
82+
* Returns value of the row.
83+
*
84+
* @param DataObject $row
7985
* @return mixed
8086
*/
8187
protected function _getValue(DataObject $row)
@@ -92,7 +98,9 @@ protected function _getValue(DataObject $row)
9298
}
9399

94100
/**
95-
* @param Object $row
101+
* Get pre-rendered input element.
102+
*
103+
* @param DataObject $row
96104
* @return string
97105
*/
98106
public function _getInputValueElement(DataObject $row)
@@ -108,7 +116,9 @@ public function _getInputValueElement(DataObject $row)
108116
}
109117

110118
/**
111-
* @param Object $row
119+
* Get input value by row.
120+
*
121+
* @param DataObject $row
112122
* @return mixed
113123
*/
114124
protected function _getInputValue(DataObject $row)
@@ -117,6 +127,8 @@ protected function _getInputValue(DataObject $row)
117127
}
118128

119129
/**
130+
* Renders header of the column,
131+
*
120132
* @return string
121133
*/
122134
public function renderHeader()
@@ -148,6 +160,8 @@ public function renderHeader()
148160
}
149161

150162
/**
163+
* Render HTML properties.
164+
*
151165
* @return string
152166
*/
153167
public function renderProperty()
@@ -172,6 +186,8 @@ public function renderProperty()
172186
}
173187

174188
/**
189+
* Returns HTML for CSS.
190+
*
175191
* @return string
176192
*/
177193
public function renderCss()

app/code/Magento/Backend/Controller/Adminhtml/Dashboard/ProductsViewed.php

+7-2
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,17 @@
66
*/
77
namespace Magento\Backend\Controller\Adminhtml\Dashboard;
88

9-
class ProductsViewed extends AjaxBlock
9+
use Magento\Framework\App\Action\HttpGetActionInterface;
10+
11+
/**
12+
* Get most viewed products controller.
13+
*/
14+
class ProductsViewed extends AjaxBlock implements HttpGetActionInterface
1015
{
1116
/**
1217
* Gets most viewed products list
1318
*
14-
* @return \Magento\Backend\Model\View\Result\Page
19+
* @return \Magento\Framework\Controller\Result\Raw
1520
*/
1621
public function execute()
1722
{

app/code/Magento/Backup/Controller/Adminhtml/Index.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
namespace Magento\Backup\Controller\Adminhtml;
77

88
use Magento\Backend\App\Action;
9-
use Magento\Framework\App\Action\HttpGetActionInterface;
109
use Magento\Backup\Helper\Data as Helper;
1110
use Magento\Framework\App\ObjectManager;
1211

@@ -18,7 +17,7 @@
1817
* @since 100.0.2
1918
* @SuppressWarnings(PHPMD.AllPurposeAction)
2019
*/
21-
abstract class Index extends Action implements HttpGetActionInterface
20+
abstract class Index extends Action
2221
{
2322
/**
2423
* Authorization level of a basic admin session

app/code/Magento/Backup/Controller/Adminhtml/Index/Create.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
<?php
22
/**
3-
*
43
* Copyright © Magento, Inc. All rights reserved.
54
* See COPYING.txt for license details.
65
*/
76
namespace Magento\Backup\Controller\Adminhtml\Index;
87

8+
use Magento\Framework\App\Action\HttpPostActionInterface;
99
use Magento\Framework\App\Filesystem\DirectoryList;
1010
use Magento\Framework\Filesystem;
1111

12-
class Create extends \Magento\Backup\Controller\Adminhtml\Index
12+
/**
13+
* Create backup controller
14+
*/
15+
class Create extends \Magento\Backup\Controller\Adminhtml\Index implements HttpPostActionInterface
1316
{
1417
/**
1518
* Create backup action.

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/CacheInvalidate/Model/PurgeCache.php

+22-1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ private function splitTags($tagsPattern)
118118
private function sendPurgeRequestToServers($socketAdapter, $servers, $formattedTagsChunk)
119119
{
120120
$headers = [self::HEADER_X_MAGENTO_TAGS_PATTERN => $formattedTagsChunk];
121+
$unresponsiveServerError = [];
121122
foreach ($servers as $server) {
122123
$headers['Host'] = $server->getHost();
123124
try {
@@ -131,10 +132,30 @@ private function sendPurgeRequestToServers($socketAdapter, $servers, $formattedT
131132
$socketAdapter->read();
132133
$socketAdapter->close();
133134
} catch (\Exception $e) {
134-
$this->logger->critical($e->getMessage(), compact('server', 'formattedTagsChunk'));
135+
$unresponsiveServerError[] = "Cache host: " . $server->getHost() . ":" . $server->getPort() .
136+
"resulted in error message: " . $e->getMessage();
137+
}
138+
}
139+
140+
$errorCount = count($unresponsiveServerError);
141+
142+
if ($errorCount > 0) {
143+
$loggerMessage = implode(" ", $unresponsiveServerError);
144+
145+
if ($errorCount == count($servers)) {
146+
$this->logger->critical(
147+
'No cache server(s) could be purged ' . $loggerMessage,
148+
compact('server', 'formattedTagsChunk')
149+
);
135150
return false;
136151
}
152+
153+
$this->logger->warning(
154+
'Unresponsive cache server(s) hit' . $loggerMessage,
155+
compact('server', 'formattedTagsChunk')
156+
);
137157
}
158+
138159
$this->logger->execute(compact('servers', 'formattedTagsChunk'));
139160
return true;
140161
}

0 commit comments

Comments
 (0)