Skip to content
This repository was archived by the owner on Dec 19, 2019. It is now read-only.

Commit c0d3480

Browse files
Merge pull request #2 from magento/2.3-develop
Update Magento
2 parents c3a64f2 + 7d6b0d7 commit c0d3480

File tree

248 files changed

+6723
-1011
lines changed

Some content is hidden

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

248 files changed

+6723
-1011
lines changed

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ env:
3333
- TEST_SUITE=integration INTEGRATION_INDEX=2
3434
- TEST_SUITE=integration INTEGRATION_INDEX=3
3535
- TEST_SUITE=functional
36+
- TEST_SUITE=graphql-api-functional
3637
matrix:
3738
exclude:
3839
- php: 7.1
@@ -43,6 +44,8 @@ matrix:
4344
env: TEST_SUITE=js GRUNT_COMMAND=static
4445
- php: 7.1
4546
env: TEST_SUITE=functional
47+
- php: 7.1
48+
env: TEST_SUITE=graphql-api-functional
4649
cache:
4750
apt: true
4851
directories:
@@ -61,5 +64,6 @@ script:
6164

6265
# The scripts for grunt/phpunit type tests
6366
- if [ $TEST_SUITE == "functional" ]; then dev/tests/functional/vendor/phpunit/phpunit/phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
64-
- if [ $TEST_SUITE != "functional" ] && [ $TEST_SUITE != "js" ]; then phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
67+
- if [ $TEST_SUITE != "functional" ] && [ $TEST_SUITE != "js"] && [ $TEST_SUITE != "graphql-api-functional" ]; then phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
6568
- if [ $TEST_SUITE == "js" ]; then grunt $GRUNT_COMMAND; fi
69+
- if [ $TEST_SUITE == "graphql-api-functional" ]; then phpunit -c dev/tests/api-functional; fi
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Backend\Block\DataProviders;
9+
10+
use Magento\Framework\View\Element\Block\ArgumentInterface;
11+
use Magento\Backend\Model\Image\UploadResizeConfigInterface;
12+
13+
/**
14+
* Provides additional data for image uploader
15+
*/
16+
class ImageUploadConfig implements ArgumentInterface
17+
{
18+
/**
19+
* @var UploadResizeConfigInterface
20+
*/
21+
private $imageUploadConfig;
22+
23+
/**
24+
* @param UploadResizeConfigInterface $imageUploadConfig
25+
*/
26+
public function __construct(UploadResizeConfigInterface $imageUploadConfig)
27+
{
28+
$this->imageUploadConfig = $imageUploadConfig;
29+
}
30+
31+
/**
32+
* Get image resize configuration
33+
*
34+
* @return int
35+
*/
36+
public function getIsResizeEnabled(): int
37+
{
38+
return (int)$this->imageUploadConfig->isResizeEnabled();
39+
}
40+
}

app/code/Magento/Backend/Block/Media/Uploader.php

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Magento\Framework\App\ObjectManager;
1111
use Magento\Framework\Serialize\Serializer\Json;
1212
use Magento\Framework\Image\Adapter\UploadConfigInterface;
13+
use Magento\Backend\Model\Image\UploadResizeConfigInterface;
1314

1415
/**
1516
* Adminhtml media library uploader
@@ -38,8 +39,15 @@ class Uploader extends \Magento\Backend\Block\Widget
3839
*/
3940
private $jsonEncoder;
4041

42+
/**
43+
* @var UploadResizeConfigInterface
44+
*/
45+
private $imageUploadConfig;
46+
4147
/**
4248
* @var UploadConfigInterface
49+
* @deprecated
50+
* @see \Magento\Backend\Model\Image\UploadResizeConfigInterface
4351
*/
4452
private $imageConfig;
4553

@@ -49,18 +57,22 @@ class Uploader extends \Magento\Backend\Block\Widget
4957
* @param array $data
5058
* @param Json $jsonEncoder
5159
* @param UploadConfigInterface $imageConfig
60+
* @param UploadResizeConfigInterface $imageUploadConfig
5261
*/
5362
public function __construct(
5463
\Magento\Backend\Block\Template\Context $context,
5564
\Magento\Framework\File\Size $fileSize,
5665
array $data = [],
5766
Json $jsonEncoder = null,
58-
UploadConfigInterface $imageConfig = null
67+
UploadConfigInterface $imageConfig = null,
68+
UploadResizeConfigInterface $imageUploadConfig = null
5969
) {
6070
$this->_fileSizeService = $fileSize;
6171
$this->jsonEncoder = $jsonEncoder ?: ObjectManager::getInstance()->get(Json::class);
62-
$this->imageConfig = $imageConfig ?: ObjectManager::getInstance()->get(UploadConfigInterface::class);
63-
72+
$this->imageConfig = $imageConfig
73+
?: ObjectManager::getInstance()->get(UploadConfigInterface::class);
74+
$this->imageUploadConfig = $imageUploadConfig
75+
?: ObjectManager::getInstance()->get(UploadResizeConfigInterface::class);
6476
parent::__construct($context, $data);
6577
}
6678

@@ -111,7 +123,7 @@ public function getFileSizeService()
111123
*/
112124
public function getImageUploadMaxWidth()
113125
{
114-
return $this->imageConfig->getMaxWidth();
126+
return $this->imageUploadConfig->getMaxWidth();
115127
}
116128

117129
/**
@@ -121,7 +133,7 @@ public function getImageUploadMaxWidth()
121133
*/
122134
public function getImageUploadMaxHeight()
123135
{
124-
return $this->imageConfig->getMaxHeight();
136+
return $this->imageUploadConfig->getMaxHeight();
125137
}
126138

127139
/**

app/code/Magento/Backend/Block/Widget/Form.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ protected function _construct()
5959
parent::_construct();
6060

6161
$this->setDestElementId('edit_form');
62-
$this->setShowGlobalIcon(false);
6362
}
6463

6564
/**

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* @api
1313
* @deprecated 100.2.0 in favour of UI component implementation
1414
* @method string getRowClickCallback() getRowClickCallback()
15-
* @method \Magento\Backend\Block\Widget\Grid setRowClickCallback() setRowClickCallback(string $value)
15+
* @method \Magento\Backend\Block\Widget\Grid setRowClickCallback(string $value)
1616
* @SuppressWarnings(PHPMD.TooManyFields)
1717
* @since 100.0.2
1818
*/
@@ -150,7 +150,10 @@ public function __construct(
150150
}
151151

152152
/**
153+
* Internal constructor, that is called from real constructor
154+
*
153155
* @return void
156+
*
154157
* @SuppressWarnings(PHPMD.NPathComplexity)
155158
*/
156159
protected function _construct()
@@ -709,6 +712,7 @@ public function getGridUrl()
709712

710713
/**
711714
* Grid url getter
715+
*
712716
* Version of getGridUrl() but with parameters
713717
*
714718
* @param array $params url parameters

app/code/Magento/Backend/Model/AdminPathConfig.php

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -48,39 +48,37 @@ public function __construct(
4848
}
4949

5050
/**
51-
* {@inheritdoc}
52-
*
53-
* @param \Magento\Framework\App\RequestInterface $request
54-
* @return string
51+
* @inheritdoc
5552
*/
5653
public function getCurrentSecureUrl(\Magento\Framework\App\RequestInterface $request)
5754
{
5855
return $this->url->getBaseUrl('link', true) . ltrim($request->getPathInfo(), '/');
5956
}
6057

6158
/**
62-
* {@inheritdoc}
63-
*
64-
* @param string $path
65-
* @return bool
59+
* @inheritdoc
6660
*/
6761
public function shouldBeSecure($path)
6862
{
69-
return parse_url(
70-
(string)$this->coreConfig->getValue(Store::XML_PATH_UNSECURE_BASE_URL, 'default'),
71-
PHP_URL_SCHEME
72-
) === 'https'
73-
|| $this->backendConfig->isSetFlag(Store::XML_PATH_SECURE_IN_ADMINHTML)
74-
&& parse_url(
75-
(string)$this->coreConfig->getValue(Store::XML_PATH_SECURE_BASE_URL, 'default'),
76-
PHP_URL_SCHEME
77-
) === 'https';
63+
$baseUrl = (string)$this->coreConfig->getValue(Store::XML_PATH_UNSECURE_BASE_URL, 'default');
64+
if (parse_url($baseUrl, PHP_URL_SCHEME) === 'https') {
65+
return true;
66+
}
67+
68+
if ($this->backendConfig->isSetFlag(Store::XML_PATH_SECURE_IN_ADMINHTML)) {
69+
if ($this->backendConfig->isSetFlag('admin/url/use_custom')) {
70+
$adminBaseUrl = (string)$this->coreConfig->getValue('admin/url/custom', 'default');
71+
} else {
72+
$adminBaseUrl = (string)$this->coreConfig->getValue(Store::XML_PATH_SECURE_BASE_URL, 'default');
73+
}
74+
return parse_url($adminBaseUrl, PHP_URL_SCHEME) === 'https';
75+
}
76+
77+
return false;
7878
}
7979

8080
/**
81-
* {@inheritdoc}
82-
*
83-
* @return string
81+
* @inheritdoc
8482
*/
8583
public function getDefaultPath()
8684
{
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Backend\Model\Image;
9+
10+
/**
11+
* Image uploader config provider.
12+
*/
13+
class UploadResizeConfig implements UploadResizeConfigInterface
14+
{
15+
/**
16+
* Config path for the maximal image width value
17+
*/
18+
const XML_PATH_MAX_WIDTH_IMAGE = 'system/upload_configuration/max_width';
19+
20+
/**
21+
* Config path for the maximal image height value
22+
*/
23+
const XML_PATH_MAX_HEIGHT_IMAGE = 'system/upload_configuration/max_height';
24+
25+
/**
26+
* Config path for the maximal image height value
27+
*/
28+
const XML_PATH_ENABLE_RESIZE = 'system/upload_configuration/enable_resize';
29+
30+
/**
31+
* @var \Magento\Framework\App\Config\ScopeConfigInterface
32+
*/
33+
private $config;
34+
35+
/**
36+
* @param \Magento\Framework\App\Config\ScopeConfigInterface $config
37+
*/
38+
public function __construct(\Magento\Framework\App\Config\ScopeConfigInterface $config)
39+
{
40+
$this->config = $config;
41+
}
42+
43+
/**
44+
* Get maximal width value for resized image
45+
*
46+
* @return int
47+
*/
48+
public function getMaxWidth(): int
49+
{
50+
return (int)$this->config->getValue(self::XML_PATH_MAX_WIDTH_IMAGE);
51+
}
52+
53+
/**
54+
* Get maximal height value for resized image
55+
*
56+
* @return int
57+
*/
58+
public function getMaxHeight(): int
59+
{
60+
return (int)$this->config->getValue(self::XML_PATH_MAX_HEIGHT_IMAGE);
61+
}
62+
63+
/**
64+
* Get config value for frontend resize
65+
*
66+
* @return bool
67+
*/
68+
public function isResizeEnabled(): bool
69+
{
70+
return (bool)$this->config->getValue(self::XML_PATH_ENABLE_RESIZE);
71+
}
72+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Backend\Model\Image;
9+
10+
/**
11+
* Interface UploadResizeConfigInterface
12+
*
13+
* Used to retrieve configuration for frontend image uploader
14+
*/
15+
interface UploadResizeConfigInterface
16+
{
17+
/**
18+
* Get maximal width value for resized image
19+
*
20+
* @return int
21+
*/
22+
public function getMaxWidth(): int;
23+
24+
/**
25+
* Get maximal height value for resized image
26+
*
27+
* @return int
28+
*/
29+
public function getMaxHeight(): int;
30+
31+
/**
32+
* Get config value for frontend resize
33+
*
34+
* @return bool
35+
*/
36+
public function isResizeEnabled(): bool;
37+
}

0 commit comments

Comments
 (0)