Skip to content

Commit fea5f4c

Browse files
committed
Merge remote-tracking branch 'mainline/2.3-develop' into fix-packaging-mq
2 parents 7d816d5 + 5870403 commit fea5f4c

File tree

4 files changed

+27
-6
lines changed

4 files changed

+27
-6
lines changed

app/code/Magento/Version/Controller/Index/Index.php

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,12 @@ public function __construct(Context $context, ProductMetadataInterface $productM
3939
*/
4040
public function execute()
4141
{
42-
$versionParts = explode('.', $this->productMetadata->getVersion());
43-
if (!isset($versionParts[0]) || !isset($versionParts[1])) {
44-
return ; // Major and minor version are not set - return empty response
42+
$version = $this->productMetadata->getVersion();
43+
$versionParts = explode('.', $version);
44+
if ((!isset($versionParts[0]) || !isset($versionParts[1]))
45+
|| $this->isGitBasedInstallation($version)
46+
) {
47+
return;
4548
}
4649
$majorMinorVersion = $versionParts[0] . '.' . $versionParts[1];
4750
$this->getResponse()->setBody(
@@ -50,4 +53,16 @@ public function execute()
5053
$this->productMetadata->getEdition() . ')'
5154
);
5255
}
56+
57+
/**
58+
* Check if provided version is generated by Git-based Magento instance.
59+
*
60+
* @param string $fullVersion
61+
* @return bool
62+
*/
63+
private function isGitBasedInstallation($fullVersion)
64+
{
65+
$versionParts = explode('-', $fullVersion);
66+
return (isset($versionParts[0]) && $versionParts[0] == 'dev');
67+
}
5368
}

app/design/adminhtml/Magento/backend/web/css/source/_components.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@
2323
@import 'components/_image-uploader.less';
2424
@import 'components/_slider.less';
2525
@import 'components/_url_input.less';
26-
@import '../../../../../../../../lib/web/jquery/spectrum/_color-picker.less';
26+
@import 'components/_color-picker.less';

dev/tests/integration/testsuite/Magento/Version/Controller/Index/IndexTest.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ public function testIndexAction()
2020
$edition = $productMetadata->getEdition();
2121

2222
$fullVersion = $productMetadata->getVersion();
23-
$versionParts = explode('.', $fullVersion);
24-
if (isset($versionParts[1]) && isset($versionParts[0])) {
23+
if ($this->isComposerBasedInstallation($fullVersion)) {
24+
$versionParts = explode('.', $fullVersion);
2525
$majorMinor = $versionParts[0] . '.' . $versionParts[1];
2626

2727
// Response must contain Major.Minor version, product name, and edition
@@ -36,4 +36,10 @@ public function testIndexAction()
3636
$this->assertEmpty($body);
3737
}
3838
}
39+
40+
private function isComposerBasedInstallation($fullVersion)
41+
{
42+
$versionParts = explode('-', $fullVersion);
43+
return !(isset($versionParts[0]) && $versionParts[0] == 'dev');
44+
}
3945
}

0 commit comments

Comments
 (0)