Skip to content

Commit df2aeb0

Browse files
committed
Merge branch 'develop-mainline' into MAGETWO-34647
2 parents 50a094c + 5c2ce64 commit df2aeb0

File tree

443 files changed

+14526
-5517
lines changed

Some content is hidden

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

443 files changed

+14526
-5517
lines changed

CHANGELOG.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,61 @@
1+
0.74.0-beta4
2+
=============
3+
* Various
4+
* Implemented the getDefaultResult method, to be able to catch exceptions in FrontController and redirect user to the correct page
5+
* The getDefaultResult method is invoked to return default result of action execution within controllers. It can be used to generate the ‘execute’ method result in action controllers
6+
* Eliminated the unused exceptions. Exceptions that weren't linked to any logic were also eliminated and replaced with LocalizedException or its child classes
7+
* Refactored all controllers where possible: the default exception handling logic moved to FrontController. Controllers that cannot be refactored do not conflict with the new logic
8+
* Framework:
9+
* Created Magento Console to perform CLI actions
10+
* Introduced a new SalesSequence module that is responsible for documents numeration management across the Order Management System
11+
* Implemented the mechanism of asynchronous indexing of sales entities grids
12+
* Setup
13+
* Added the ConfigOption and ConfigOptionsList classes to be used by modules to manage deployment configuration
14+
* Moved all existing segments logic to new classes
15+
* Added the config:set command, which enables deployment configuration management
16+
* Removed the old 'install-configuration' tool
17+
* Functional tests:
18+
* Fixed functional test for order placement from backend
19+
* Replaced the end-to-end test for a product with MAP with an injectable test
20+
* Design
21+
* Updated the Blank and Luma themes to enable theme (not only library) variables overriding in the _theme.less file of any inherited theme. Included LESS code standards to the UI Library documentation
22+
* Fixed bugs:
23+
* Fixed an issue where composite products could not be added to the order from the Recently Viewed Products section
24+
* Fixed an issue where not all .js files were added to a bundle
25+
* Fixed an issue where it was possible to save an incorrect IP value in the Developer Client Restriction field
26+
* Fixed an issue where a raw DB error was thrown when trying to enter a custom variable with duplicated variable code
27+
28+
0.74.0-beta3
29+
=============
30+
* API
31+
* The orders were extended with the gift messages
32+
* The page and block data and repository interfaces
33+
* Updated the public API list
34+
* Framework improvements
35+
* Improved the profile generator
36+
* Introduced the new environment for Jasmine tests
37+
* Design
38+
* Inverted the new admin area styles scope, clean up the old styles
39+
* New Side Panels on Admin Area
40+
* Various
41+
* Asynchronous indexing for sales grids
42+
* Advanced Mini Cart
43+
* The HTML minification management on Admin Area
44+
* Minor UI improvements
45+
* The GitHub contribution process was updated in the README.md file
46+
* Fixed bugs
47+
* Fixed the assets deployment tool with the minification
48+
* Fixed the JMeter scenario for the performance toolkit
49+
* Fixed the static files caching on Varnish
50+
* Fixed Admin user creation with the duplicated email or name (incorrect URL)
51+
* Fixed the link on Reset password email for secure URL case
52+
* Fixed the configured product adding from the wish-list to shopping cart
53+
* Fixed the long labels display on Admin Area
54+
* Fixed the Navigation Menu items on Admin Area
55+
* Various unit and integration tests bugs
56+
* GitHub issues and requests
57+
[#675] (https://github.com/magento/magento2/issues/675) -- Fix for Textarea element cols and rows #675
58+
159
0.74.0-beta2
260
=============
361
* Fixed bugs

app/code/Magento/AdminNotification/Model/Feed.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\AdminNotification\Model;
77

8+
use Magento\Framework\Config\ConfigOptionsList;
9+
810
/**
911
* AdminNotification Feed model
1012
*
@@ -135,7 +137,7 @@ public function checkUpdate()
135137

136138
$feedXml = $this->getFeedData();
137139

138-
$installDate = strtotime($this->_deploymentConfig->get('install/date'));
140+
$installDate = strtotime($this->_deploymentConfig->get(ConfigOptionsList::CONFIG_PATH_INSTALL_DATE));
139141

140142
if ($feedXml && $feedXml->channel && $feedXml->channel->item) {
141143
foreach ($feedXml->channel->item as $item) {

app/code/Magento/AdminNotification/Test/Unit/Model/FeedTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
namespace Magento\AdminNotification\Test\Unit\Model;
88

99
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
10+
use Magento\Framework\Config\ConfigOptionsList;
1011

1112
/**
1213
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -140,7 +141,8 @@ public function testCheckUpdate($callInbox, $curlRequest)
140141
$this->backendConfig->expects($this->at(1))->method('getValue')
141142
->will($this->returnValue('http://feed.magento.com'));
142143
$this->deploymentConfig->expects($this->once())->method('get')
143-
->with('install/date')->will($this->returnValue('Sat, 6 Sep 2014 16:46:11 UTC'));
144+
->with(ConfigOptionsList::CONFIG_PATH_INSTALL_DATE)
145+
->will($this->returnValue('Sat, 6 Sep 2014 16:46:11 UTC'));
144146
if ($callInbox) {
145147
$this->inboxFactory->expects($this->once())->method('create')
146148
->will(($this->returnValue($this->inboxModel)));

app/code/Magento/AdminNotification/composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
"description": "N/A",
44
"require": {
55
"php": "~5.5.0|~5.6.0",
6-
"magento/module-store": "0.74.0-beta2",
7-
"magento/module-backend": "0.74.0-beta2",
8-
"magento/module-media-storage": "0.74.0-beta2",
9-
"magento/framework": "0.74.0-beta2",
6+
"magento/module-store": "0.74.0-beta4",
7+
"magento/module-backend": "0.74.0-beta4",
8+
"magento/module-media-storage": "0.74.0-beta4",
9+
"magento/framework": "0.74.0-beta4",
1010
"lib-libxml": "*",
1111
"magento/magento-composer-installer": "*"
1212
},
1313
"type": "magento2-module",
14-
"version": "0.74.0-beta2",
14+
"version": "0.74.0-beta4",
1515
"license": [
1616
"OSL-3.0",
1717
"AFL-3.0"

app/code/Magento/Authorization/composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
"description": "Authorization module provides access to Magento ACL functionality.",
44
"require": {
55
"php": "~5.5.0|~5.6.0",
6-
"magento/module-backend": "0.74.0-beta2",
7-
"magento/framework": "0.74.0-beta2",
6+
"magento/module-backend": "0.74.0-beta4",
7+
"magento/framework": "0.74.0-beta4",
88
"magento/magento-composer-installer": "*"
99
},
1010
"type": "magento2-module",
11-
"version": "0.74.0-beta2",
11+
"version": "0.74.0-beta4",
1212
"license": [
1313
"OSL-3.0",
1414
"AFL-3.0"

app/code/Magento/Backend/App/Area/FrontNameResolver.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*/
88
namespace Magento\Backend\App\Area;
99

10+
use Magento\Backend\Setup\ConfigOptionsList;
1011
use Magento\Framework\App\DeploymentConfig;
1112

1213
class FrontNameResolver implements \Magento\Framework\App\Area\FrontNameResolverInterface
@@ -15,8 +16,6 @@ class FrontNameResolver implements \Magento\Framework\App\Area\FrontNameResolver
1516

1617
const XML_PATH_CUSTOM_ADMIN_PATH = 'admin/url/custom_path';
1718

18-
const PARAM_BACKEND_FRONT_NAME = 'backend/frontName';
19-
2019
/**
2120
* Backend area code
2221
*/
@@ -46,7 +45,7 @@ class FrontNameResolver implements \Magento\Framework\App\Area\FrontNameResolver
4645
public function __construct(\Magento\Backend\App\Config $config, DeploymentConfig $deploymentConfig)
4746
{
4847
$this->config = $config;
49-
$this->defaultFrontName = $deploymentConfig->get(self::PARAM_BACKEND_FRONT_NAME);
48+
$this->defaultFrontName = $deploymentConfig->get(ConfigOptionsList::CONFIG_PATH_BACKEND_FRONTNAME);
5049
}
5150

5251
/**

app/code/Magento/Backend/Helper/Dashboard/Data.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Magento\Backend\Helper\Dashboard;
77

88
use Magento\Framework\App\DeploymentConfig;
9+
use Magento\Framework\Config\ConfigOptionsList;
910

1011
/**
1112
* Data helper for dashboard
@@ -22,11 +23,6 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper
2223
*/
2324
protected $_installDate;
2425

25-
/**
26-
* Configuration key to installation date
27-
*/
28-
const INSTALL_DATE = 'install/date';
29-
3026
/**
3127
* @var \Magento\Store\Model\StoreManagerInterface
3228
*/
@@ -45,7 +41,7 @@ public function __construct(
4541
parent::__construct(
4642
$context
4743
);
48-
$this->_installDate = $deploymentConfig->get(self::INSTALL_DATE);
44+
$this->_installDate = $deploymentConfig->get(ConfigOptionsList::CONFIG_PATH_INSTALL_DATE);
4945
$this->_storeManager = $storeManager;
5046
}
5147

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Backend\Setup;
7+
8+
use Magento\Framework\Config\Data\ConfigData;
9+
use Magento\Framework\Config\File\ConfigFilePool;
10+
use Magento\Framework\Setup\ConfigOptionsListInterface;
11+
use Magento\Framework\Setup\Option\TextConfigOption;
12+
use Magento\Framework\App\DeploymentConfig;
13+
14+
/*
15+
* Deployment configuration options needed for Backend module
16+
*/
17+
class ConfigOptionsList implements ConfigOptionsListInterface
18+
{
19+
/**
20+
* Input key for the options
21+
*/
22+
const INPUT_KEY_BACKEND_FRONTNAME = 'backend_frontname';
23+
24+
/**
25+
* Path to the values in the deployment config
26+
*/
27+
const CONFIG_PATH_BACKEND_FRONTNAME = 'backend/frontName';
28+
29+
/**
30+
* {@inheritdoc}
31+
*/
32+
public function getOptions()
33+
{
34+
return [
35+
new TextConfigOption(
36+
self::INPUT_KEY_BACKEND_FRONTNAME,
37+
TextConfigOption::FRONTEND_WIZARD_TEXT,
38+
self::CONFIG_PATH_BACKEND_FRONTNAME,
39+
'Backend frontname',
40+
'admin'
41+
)
42+
];
43+
}
44+
45+
/**
46+
* {@inheritdoc}
47+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
48+
*/
49+
public function createConfig(array $options, DeploymentConfig $deploymentConfig)
50+
{
51+
$configData = new ConfigData(ConfigFilePool::APP_CONFIG);
52+
53+
if (isset($options[self::INPUT_KEY_BACKEND_FRONTNAME])) {
54+
$configData->set(self::CONFIG_PATH_BACKEND_FRONTNAME, $options[self::INPUT_KEY_BACKEND_FRONTNAME]);
55+
}
56+
57+
return [$configData];
58+
}
59+
60+
/**
61+
* {@inheritdoc}
62+
*/
63+
public function validate(array $options)
64+
{
65+
$errors = [];
66+
if (isset($options[self::INPUT_KEY_BACKEND_FRONTNAME])
67+
&& !preg_match('/^[a-zA-Z0-9_]+$/', $options[self::INPUT_KEY_BACKEND_FRONTNAME])
68+
) {
69+
$errors[] = "Invalid backend frontname '{$options[self::INPUT_KEY_BACKEND_FRONTNAME]}'";
70+
}
71+
72+
return $errors;
73+
}
74+
}

app/code/Magento/Backend/Test/Unit/App/Area/FrontNameResolverTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Magento\Backend\Test\Unit\App\Area;
77

88
use Magento\Backend\App\Area\FrontNameResolver;
9+
use Magento\Backend\Setup\ConfigOptionsList;
910

1011
class FrontNameResolverTest extends \PHPUnit_Framework_TestCase
1112
{
@@ -29,10 +30,10 @@ protected function setUp()
2930
$deploymentConfigMock = $this->getMock('\Magento\Framework\App\DeploymentConfig', [], [], '', false);
3031
$deploymentConfigMock->expects($this->once())
3132
->method('get')
32-
->with(FrontNameResolver::PARAM_BACKEND_FRONT_NAME)
33+
->with(ConfigOptionsList::CONFIG_PATH_BACKEND_FRONTNAME)
3334
->will($this->returnValue($this->_defaultFrontName));
3435
$this->_configMock = $this->getMock('\Magento\Backend\App\Config', [], [], '', false);
35-
$this->_model = new \Magento\Backend\App\Area\FrontNameResolver($this->_configMock, $deploymentConfigMock);
36+
$this->_model = new FrontNameResolver($this->_configMock, $deploymentConfigMock);
3637
}
3738

3839
public function testIfCustomPathUsed()
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Backend\Test\Unit\Setup;
7+
8+
use Magento\Backend\Setup\ConfigOptionsList;
9+
use Magento\Framework\Config\File\ConfigFilePool;
10+
11+
class ConfigOptionsListTest extends \PHPUnit_Framework_TestCase
12+
{
13+
/**
14+
* @var ConfigOptionsList
15+
*/
16+
private $object;
17+
18+
/**
19+
* @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\App\DeploymentConfig
20+
*/
21+
private $deploymentConfig;
22+
23+
protected function setUp()
24+
{
25+
$this->object = new ConfigOptionsList();
26+
$this->deploymentConfig = $this->getMock('Magento\Framework\App\DeploymentConfig', [], [], '', false);
27+
}
28+
29+
public function testGetOptions()
30+
{
31+
$options = $this->object->getOptions();
32+
$this->assertInternalType('array', $options);
33+
foreach ($options as $option) {
34+
$this->assertInstanceOf('\Magento\Framework\Setup\Option\AbstractConfigOption', $option);
35+
}
36+
}
37+
38+
public function testCreateConfig()
39+
{
40+
$options = [ConfigOptionsList::INPUT_KEY_BACKEND_FRONTNAME => 'admin'];
41+
$actualConfig = $this->object->createConfig($options, $this->deploymentConfig);
42+
43+
$expectedData = [
44+
[
45+
'file' => ConfigFilePool::APP_CONFIG,
46+
'segment' => 'backend',
47+
'data' => [
48+
'backend' => ['frontName' => 'admin']
49+
]
50+
]
51+
];
52+
53+
$this->assertInternalType('array', $actualConfig);
54+
/** @var \Magento\Framework\Config\Data\ConfigData $config */
55+
foreach ($actualConfig as $i => $config) {
56+
$this->assertInstanceOf('\Magento\Framework\Config\Data\ConfigData', $config);
57+
$this->assertSame($expectedData[$i]['file'], $config->getFileKey());
58+
$this->assertSame($expectedData[$i]['data'], $config->getData());
59+
}
60+
}
61+
62+
public function testValidate()
63+
{
64+
$options = [ConfigOptionsList::INPUT_KEY_BACKEND_FRONTNAME => 'admin'];
65+
$errors = $this->object->validate($options);
66+
$this->assertEmpty($errors);
67+
}
68+
69+
/**
70+
* @param array $options
71+
* @param string $expectedError
72+
* @dataProvider validateInvalidDataProvider
73+
*/
74+
public function testValidateInvalid(array $options, $expectedError)
75+
{
76+
$errors = $this->object->validate($options);
77+
$this->assertSame([$expectedError], $errors);
78+
}
79+
80+
/**
81+
* @return array
82+
*/
83+
public function validateInvalidDataProvider()
84+
{
85+
return [
86+
[[ConfigOptionsList::INPUT_KEY_BACKEND_FRONTNAME => '**'], "Invalid backend frontname '**'"],
87+
[
88+
[ConfigOptionsList::INPUT_KEY_BACKEND_FRONTNAME => 'invalid frontname'],
89+
"Invalid backend frontname 'invalid frontname'"
90+
],
91+
];
92+
}
93+
}

0 commit comments

Comments
 (0)