Skip to content

Commit 7893cd6

Browse files
authored
Merge branch '2.3-develop' into 2.3-develop-PR-port-11099
2 parents 28cddb9 + 431d0d3 commit 7893cd6

File tree

575 files changed

+9984
-3402
lines changed

Some content is hidden

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

575 files changed

+9984
-3402
lines changed

.travis.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ services:
1717
language: php
1818
php:
1919
- 7.1
20+
- 7.2
2021
env:
2122
global:
2223
- COMPOSER_BIN_DIR=~/bin
@@ -32,6 +33,16 @@ env:
3233
- TEST_SUITE=integration INTEGRATION_INDEX=2
3334
- TEST_SUITE=integration INTEGRATION_INDEX=3
3435
- TEST_SUITE=functional
36+
matrix:
37+
exclude:
38+
- php: 7.1
39+
env: TEST_SUITE=static
40+
- php: 7.1
41+
env: TEST_SUITE=js GRUNT_COMMAND=spec
42+
- php: 7.1
43+
env: TEST_SUITE=js GRUNT_COMMAND=static
44+
- php: 7.1
45+
env: TEST_SUITE=functional
3546
cache:
3647
apt: true
3748
directories:

app/code/Magento/AdminNotification/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
8+
"php": "~7.1.3||~7.2.0",
99
"lib-libxml": "*",
1010
"magento/framework": "*",
1111
"magento/module-backend": "*",

app/code/Magento/AdvancedPricingImportExport/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
8+
"php": "~7.1.3||~7.2.0",
99
"magento/framework": "*",
1010
"magento/module-catalog": "*",
1111
"magento/module-catalog-import-export": "*",

app/code/Magento/AdvancedSearch/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"magento/module-customer": "*",
1414
"magento/module-search": "*",
1515
"magento/module-store": "*",
16-
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0"
16+
"php": "~7.1.3||~7.2.0"
1717
},
1818
"type": "magento2-module",
1919
"license": [

app/code/Magento/Amqp/Setup/ConfigOptionsList.php

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class ConfigOptionsList implements ConfigOptionsListInterface
2525
const INPUT_KEY_QUEUE_AMQP_PASSWORD = 'amqp-password';
2626
const INPUT_KEY_QUEUE_AMQP_VIRTUAL_HOST = 'amqp-virtualhost';
2727
const INPUT_KEY_QUEUE_AMQP_SSL = 'amqp-ssl';
28+
const INPUT_KEY_QUEUE_AMQP_SSL_OPTIONS = 'amqp-ssl-options';
2829

2930
/**
3031
* Path to the values in the deployment config
@@ -35,6 +36,7 @@ class ConfigOptionsList implements ConfigOptionsListInterface
3536
const CONFIG_PATH_QUEUE_AMQP_PASSWORD = 'queue/amqp/password';
3637
const CONFIG_PATH_QUEUE_AMQP_VIRTUAL_HOST = 'queue/amqp/virtualhost';
3738
const CONFIG_PATH_QUEUE_AMQP_SSL = 'queue/amqp/ssl';
39+
const CONFIG_PATH_QUEUE_AMQP_SSL_OPTIONS = 'queue/amqp/ssl_options';
3840

3941
/**
4042
* Default values
@@ -109,6 +111,13 @@ public function getOptions()
109111
'Amqp SSL',
110112
self::DEFAULT_AMQP_SSL
111113
),
114+
new TextConfigOption(
115+
self::INPUT_KEY_QUEUE_AMQP_SSL_OPTIONS,
116+
TextConfigOption::FRONTEND_WIZARD_TEXTAREA,
117+
self::CONFIG_PATH_QUEUE_AMQP_SSL_OPTIONS,
118+
'Amqp SSL Options (JSON)',
119+
self::DEFAULT_AMQP_SSL
120+
),
112121
];
113122
}
114123

@@ -140,6 +149,21 @@ public function createConfig(array $data, DeploymentConfig $deploymentConfig)
140149
if (!$this->isDataEmpty($data, self::INPUT_KEY_QUEUE_AMQP_SSL)) {
141150
$configData->set(self::CONFIG_PATH_QUEUE_AMQP_SSL, $data[self::INPUT_KEY_QUEUE_AMQP_SSL]);
142151
}
152+
if (!$this->isDataEmpty(
153+
$data,
154+
self::INPUT_KEY_QUEUE_AMQP_SSL_OPTIONS
155+
)) {
156+
$options = json_decode(
157+
$data[self::INPUT_KEY_QUEUE_AMQP_SSL_OPTIONS],
158+
true
159+
);
160+
if ($options !== null) {
161+
$configData->set(
162+
self::CONFIG_PATH_QUEUE_AMQP_SSL_OPTIONS,
163+
$options
164+
);
165+
}
166+
}
143167
}
144168

145169
return [$configData];
@@ -154,12 +178,28 @@ public function validate(array $options, DeploymentConfig $deploymentConfig)
154178

155179
if (isset($options[self::INPUT_KEY_QUEUE_AMQP_HOST])
156180
&& $options[self::INPUT_KEY_QUEUE_AMQP_HOST] !== '') {
181+
if (!$this->isDataEmpty(
182+
$options,
183+
self::INPUT_KEY_QUEUE_AMQP_SSL_OPTIONS
184+
)) {
185+
$sslOptions = json_decode(
186+
$options[self::INPUT_KEY_QUEUE_AMQP_SSL_OPTIONS],
187+
true
188+
);
189+
} else {
190+
$sslOptions = null;
191+
}
192+
$isSslEnabled = !empty($options[self::INPUT_KEY_QUEUE_AMQP_SSL])
193+
&& $options[self::INPUT_KEY_QUEUE_AMQP_SSL] !== 'false';
194+
157195
$result = $this->connectionValidator->isConnectionValid(
158196
$options[self::INPUT_KEY_QUEUE_AMQP_HOST],
159197
$options[self::INPUT_KEY_QUEUE_AMQP_PORT],
160198
$options[self::INPUT_KEY_QUEUE_AMQP_USER],
161199
$options[self::INPUT_KEY_QUEUE_AMQP_PASSWORD],
162-
$options[self::INPUT_KEY_QUEUE_AMQP_VIRTUAL_HOST]
200+
$options[self::INPUT_KEY_QUEUE_AMQP_VIRTUAL_HOST],
201+
$isSslEnabled,
202+
$sslOptions
163203
);
164204

165205
if (!$result) {

app/code/Magento/Amqp/Setup/ConnectionValidator.php

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,27 @@
55
*/
66
namespace Magento\Amqp\Setup;
77

8-
use PhpAmqpLib\Connection\AMQPStreamConnection;
8+
use Magento\Framework\Amqp\Connection\Factory as ConnectionFactory;
9+
use Magento\Framework\Amqp\Connection\FactoryOptions;
910

1011
/**
1112
* Class ConnectionValidator - validates Amqp related settings
1213
*/
1314
class ConnectionValidator
1415
{
16+
/**
17+
* @var ConnectionFactory
18+
*/
19+
private $connectionFactory;
20+
21+
/**
22+
* @param ConnectionFactory $connectionFactory
23+
*/
24+
public function __construct(ConnectionFactory $connectionFactory)
25+
{
26+
$this->connectionFactory = $connectionFactory;
27+
}
28+
1529
/**
1630
* Checks Amqp Connection
1731
*
@@ -20,18 +34,33 @@ class ConnectionValidator
2034
* @param string $user
2135
* @param string $password
2236
* @param string $virtualHost
37+
* @param bool $ssl
38+
* @param string[]|null $sslOptions
2339
* @return bool true if the connection succeeded, false otherwise
2440
*/
25-
public function isConnectionValid($host, $port, $user, $password = '', $virtualHost = '')
26-
{
41+
public function isConnectionValid(
42+
$host,
43+
$port,
44+
$user,
45+
$password = '',
46+
$virtualHost = '',
47+
bool $ssl = false,
48+
array $sslOptions = null
49+
) {
2750
try {
28-
$connection = new AMQPStreamConnection(
29-
$host,
30-
$port,
31-
$user,
32-
$password,
33-
$virtualHost
34-
);
51+
$options = new FactoryOptions();
52+
$options->setHost($host);
53+
$options->setPort($port);
54+
$options->setUsername($user);
55+
$options->setPassword($password);
56+
$options->setVirtualHost($virtualHost);
57+
$options->setSslEnabled($ssl);
58+
59+
if ($sslOptions) {
60+
$options->setSslOptions($sslOptions);
61+
}
62+
63+
$connection = $this->connectionFactory->create($options);
3564

3665
$connection->close();
3766
} catch (\Exception $e) {

app/code/Magento/Amqp/Test/Unit/Setup/ConfigOptionsListTest.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ protected function setUp()
4747
ConfigOptionsList::INPUT_KEY_QUEUE_AMQP_PASSWORD => 'password',
4848
ConfigOptionsList::INPUT_KEY_QUEUE_AMQP_VIRTUAL_HOST => 'virtual host',
4949
ConfigOptionsList::INPUT_KEY_QUEUE_AMQP_SSL => 'ssl',
50-
50+
ConfigOptionsList::INPUT_KEY_QUEUE_AMQP_SSL_OPTIONS => '{"ssl_option":"test"}',
5151
];
5252

5353
$this->objectManager = new ObjectManager($this);
@@ -113,7 +113,14 @@ public function testGetOptions()
113113
ConfigOptionsList::CONFIG_PATH_QUEUE_AMQP_SSL,
114114
'Amqp SSL',
115115
ConfigOptionsList::DEFAULT_AMQP_SSL
116-
)
116+
),
117+
new TextConfigOption(
118+
ConfigOptionsList::INPUT_KEY_QUEUE_AMQP_SSL_OPTIONS,
119+
TextConfigOption::FRONTEND_WIZARD_TEXTAREA,
120+
ConfigOptionsList::CONFIG_PATH_QUEUE_AMQP_SSL_OPTIONS,
121+
'Amqp SSL Options (JSON)',
122+
ConfigOptionsList::DEFAULT_AMQP_SSL
123+
),
117124
];
118125
$this->assertEquals($expectedOptions, $this->model->getOptions());
119126
}
@@ -167,6 +174,7 @@ public function getCreateConfigDataProvider()
167174
ConfigOptionsList::INPUT_KEY_QUEUE_AMQP_PASSWORD => 'password',
168175
ConfigOptionsList::INPUT_KEY_QUEUE_AMQP_VIRTUAL_HOST => 'virtual host',
169176
ConfigOptionsList::INPUT_KEY_QUEUE_AMQP_SSL => 'ssl',
177+
ConfigOptionsList::INPUT_KEY_QUEUE_AMQP_SSL_OPTIONS => '{"ssl_option":"test"}',
170178
],
171179
['queue' =>
172180
['amqp' =>
@@ -177,6 +185,7 @@ public function getCreateConfigDataProvider()
177185
'password' => 'password',
178186
'virtualhost' => 'virtual host',
179187
'ssl' => 'ssl',
188+
'ssl_options' => ['ssl_option' => 'test'],
180189
]
181190
]
182191
],
@@ -189,6 +198,7 @@ public function getCreateConfigDataProvider()
189198
ConfigOptionsList::INPUT_KEY_QUEUE_AMQP_PASSWORD => 'password',
190199
ConfigOptionsList::INPUT_KEY_QUEUE_AMQP_VIRTUAL_HOST => 'virtual host',
191200
ConfigOptionsList::INPUT_KEY_QUEUE_AMQP_SSL => 'ssl',
201+
ConfigOptionsList::INPUT_KEY_QUEUE_AMQP_SSL_OPTIONS => '{"ssl_option":"test"}',
192202
],
193203
['queue' =>
194204
['amqp' =>
@@ -199,6 +209,7 @@ public function getCreateConfigDataProvider()
199209
'password' => 'password',
200210
'virtualhost' => 'virtual host',
201211
'ssl' => 'ssl',
212+
'ssl_options' => ['ssl_option' => 'test'],
202213
]
203214
]
204215
],

app/code/Magento/Amqp/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"magento/framework": "*",
99
"magento/framework-amqp": "*",
1010
"magento/framework-message-queue": "*",
11-
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0"
11+
"php": "~7.1.3||~7.2.0"
1212
},
1313
"type": "magento2-module",
1414
"license": [

app/code/Magento/Analytics/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-analytics",
33
"description": "N/A",
44
"require": {
5-
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
5+
"php": "~7.1.3||~7.2.0",
66
"magento/module-backend": "*",
77
"magento/module-config": "*",
88
"magento/module-integration": "*",

app/code/Magento/AsynchronousOperations/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"magento/module-backend": "*",
1212
"magento/module-ui": "*",
1313
"magento/module-user": "*",
14-
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0"
14+
"php": "~7.1.3||~7.2.0"
1515
},
1616
"suggest": {
1717
"magento/module-admin-notification": "*",

app/code/Magento/Authorization/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
8+
"php": "~7.1.3||~7.2.0",
99
"magento/framework": "*",
1010
"magento/module-backend": "*"
1111
},

app/code/Magento/Authorizenet/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
8+
"php": "~7.1.3||~7.2.0",
99
"magento/framework": "*",
1010
"magento/module-backend": "*",
1111
"magento/module-catalog": "*",

app/code/Magento/Backend/Block/Menu.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ protected function _addSubMenu($menuItem, $level, $limit, $id = null)
352352
return $output;
353353
}
354354
$output .= '<div class="submenu"' . ($level == 0 && isset($id) ? ' aria-labelledby="' . $id . '"' : '') . '>';
355-
$colStops = null;
355+
$colStops = [];
356356
if ($level == 0 && $limit) {
357357
$colStops = $this->_columnBrake($menuItem->getChildren(), $limit);
358358
$output .= '<strong class="submenu-title">' . $this->_getAnchorLabel($menuItem) . '</strong>';
@@ -387,7 +387,11 @@ public function renderNavigation($menu, $level = 0, $limit = 0, $colBrakes = [])
387387
$itemName = substr($menuId, strrpos($menuId, '::') + 2);
388388
$itemClass = str_replace('_', '-', strtolower($itemName));
389389

390-
if (count($colBrakes) && $colBrakes[$itemPosition]['colbrake'] && $itemPosition != 1) {
390+
if (is_array($colBrakes)
391+
&& count($colBrakes)
392+
&& $colBrakes[$itemPosition]['colbrake']
393+
&& $itemPosition != 1
394+
) {
391395
$output .= '</ul></li><li class="column"><ul role="menu">';
392396
}
393397

@@ -401,7 +405,7 @@ public function renderNavigation($menu, $level = 0, $limit = 0, $colBrakes = [])
401405
$itemPosition++;
402406
}
403407

404-
if (count($colBrakes) && $limit) {
408+
if (is_array($colBrakes) && count($colBrakes) && $limit) {
405409
$output = '<li class="column"><ul role="menu">' . $output . '</ul></li>';
406410
}
407411

app/code/Magento/Backend/Block/Widget/Grid/ColumnSet.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,8 @@ public function getRowUrl($item)
258258
*/
259259
public function getMultipleRows($item)
260260
{
261-
return $item->getChildren();
261+
$children = $item->getChildren();
262+
return $children ?: [];
262263
}
263264

264265
/**

app/code/Magento/Backend/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
8+
"php": "~7.1.3||~7.2.0",
99
"magento/framework": "*",
1010
"magento/module-backup": "*",
1111
"magento/module-catalog": "*",

app/code/Magento/Backend/view/adminhtml/templates/widget/grid.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*
2020
*/
2121
/* @var $block \Magento\Backend\Block\Widget\Grid */
22-
$numColumns = sizeof($block->getColumns());
22+
$numColumns = !is_null($block->getColumns()) ? sizeof($block->getColumns()) : 0;
2323
?>
2424
<?php if ($block->getCollection()): ?>
2525

app/code/Magento/Backup/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
8+
"php": "~7.1.3||~7.2.0",
99
"magento/framework": "*",
1010
"magento/module-backend": "*",
1111
"magento/module-cron": "*",

app/code/Magento/Braintree/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
9-
"braintree/braintree_php": "3.22.0",
8+
"php": "~7.1.3||~7.2.0",
9+
"braintree/braintree_php": "3.28.0",
1010
"magento/framework": "*",
1111
"magento/magento-composer-installer": "*",
1212
"magento/module-catalog": "*",

0 commit comments

Comments
 (0)