Skip to content

Commit 6215f9b

Browse files
committed
Merge remote-tracking branch 'origin/2.3-develop' into MAGETWO-72775
2 parents 43580cb + eab1b2d commit 6215f9b

File tree

340 files changed

+14279
-3950
lines changed

Some content is hidden

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

340 files changed

+14279
-3950
lines changed

app/code/Magento/AdminNotification/Block/System/Messages/UnreadMessagePopup.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,8 @@ public function getPopupTitle()
7777
$messageCount = count($this->_messages->getUnread());
7878
if ($messageCount > 1) {
7979
return __('You have %1 new system messages', $messageCount);
80-
} else {
81-
return __('You have %1 new system message', $messageCount);
8280
}
81+
return __('You have %1 new system message', $messageCount);
8382
}
8483

8584
/**

app/code/Magento/AdminNotification/Block/Window.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,9 @@ protected function _getLatestItem()
9898
{
9999
if ($this->_latestItem == null) {
100100
$items = array_values($this->_criticalCollection->getItems());
101+
$this->_latestItem = false;
101102
if (count($items)) {
102103
$this->_latestItem = $items[0];
103-
} else {
104-
$this->_latestItem = false;
105104
}
106105
}
107106
return $this->_latestItem;

app/code/Magento/AdminNotification/composer.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@
77
"require": {
88
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
99
"lib-libxml": "*",
10-
"magento/framework": "100.3.*",
11-
"magento/module-backend": "100.3.*",
12-
"magento/module-media-storage": "100.3.*",
13-
"magento/module-store": "100.3.*",
14-
"magento/module-ui": "100.3.*"
10+
"magento/framework": "*",
11+
"magento/module-backend": "*",
12+
"magento/module-media-storage": "*",
13+
"magento/module-store": "*",
14+
"magento/module-ui": "*"
1515
},
1616
"type": "magento2-module",
17-
"version": "100.3.0-dev",
1817
"license": [
1918
"OSL-3.0",
2019
"AFL-3.0"

app/code/Magento/AdvancedPricingImportExport/Model/Export/AdvancedPricing.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,9 +626,8 @@ protected function _getCustomerGroupById(
626626
): string {
627627
if ($allGroups !== 0) {
628628
return ImportAdvancedPricing::VALUE_ALL_GROUPS;
629-
} else {
630-
return $this->_groupRepository->getById($groupId)->getCode();
631629
}
630+
return $this->_groupRepository->getById($groupId)->getCode();
632631
}
633632

634633
/**

app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,9 +482,8 @@ protected function deleteProductTierPrices(array $listSku, $table)
482482
$this->addRowError(ValidatorInterface::ERROR_SKU_IS_EMPTY, 0);
483483
return false;
484484
}
485-
} else {
486-
return false;
487485
}
486+
return false;
488487
}
489488

490489
/**

app/code/Magento/AdvancedPricingImportExport/composer.json

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,16 @@
66
},
77
"require": {
88
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
9-
"magento/framework": "100.3.*",
10-
"magento/module-catalog": "101.2.*",
11-
"magento/module-catalog-import-export": "100.3.*",
12-
"magento/module-catalog-inventory": "100.3.*",
13-
"magento/module-customer": "100.3.*",
14-
"magento/module-eav": "100.3.*",
15-
"magento/module-import-export": "100.3.*",
16-
"magento/module-store": "100.3.*"
9+
"magento/framework": "*",
10+
"magento/module-catalog": "*",
11+
"magento/module-catalog-import-export": "*",
12+
"magento/module-catalog-inventory": "*",
13+
"magento/module-customer": "*",
14+
"magento/module-eav": "*",
15+
"magento/module-import-export": "*",
16+
"magento/module-store": "*"
1717
},
1818
"type": "magento2-module",
19-
"version": "100.3.0-dev",
2019
"license": [
2120
"OSL-3.0",
2221
"AFL-3.0"

app/code/Magento/AdvancedSearch/composer.json

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,17 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"magento/framework": "100.3.*",
9-
"magento/module-backend": "100.3.*",
10-
"magento/module-catalog": "101.2.*",
11-
"magento/module-catalog-search": "100.3.*",
12-
"magento/module-config": "100.3.*",
13-
"magento/module-customer": "100.3.*",
14-
"magento/module-search": "100.3.*",
15-
"magento/module-store": "100.3.*",
8+
"magento/framework": "*",
9+
"magento/module-backend": "*",
10+
"magento/module-catalog": "*",
11+
"magento/module-catalog-search": "*",
12+
"magento/module-config": "*",
13+
"magento/module-customer": "*",
14+
"magento/module-search": "*",
15+
"magento/module-store": "*",
1616
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0"
1717
},
1818
"type": "magento2-module",
19-
"version": "100.3.0-dev",
2019
"license": [
2120
"proprietary"
2221
],

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
],

0 commit comments

Comments
 (0)