Skip to content

Commit 222b77c

Browse files
author
Kopylova,Olga(okopylova)
committed
Merge pull request #11 from magento-ogre/PR_Branch
[Ogres] Bug Fixes
2 parents e3dfd6a + 6ef7b9e commit 222b77c

File tree

40 files changed

+354
-124
lines changed

40 files changed

+354
-124
lines changed

app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Checkbox.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,25 @@ public function render(\Magento\Framework\DataObject $row)
7777
{
7878
$values = $this->_getValues();
7979
$value = $row->getData($this->getColumn()->getIndex());
80+
$checked = '';
8081
if (is_array($values)) {
8182
$checked = in_array($value, $values) ? ' checked="checked"' : '';
8283
} else {
83-
$checked = $value === $this->getColumn()->getValue() ? ' checked="checked"' : '';
84+
$checkedValue = $this->getColumn()->getValue();
85+
if ($checkedValue !== null) {
86+
$checked = $value === $checkedValue ? ' checked="checked"' : '';
87+
}
8488
}
8589

90+
$disabled = '';
8691
$disabledValues = $this->getColumn()->getDisabledValues();
8792
if (is_array($disabledValues)) {
8893
$disabled = in_array($value, $disabledValues) ? ' disabled="disabled"' : '';
8994
} else {
90-
$disabled = $value === $this->getColumn()->getDisabledValue() ? ' disabled="disabled"' : '';
95+
$disabledValue = $this->getColumn()->getDisabledValue();
96+
if ($disabledValue !== null) {
97+
$disabled = $value === $disabledValue ? ' disabled="disabled"' : '';
98+
}
9199
}
92100

93101
$this->setDisabled($disabled);

app/code/Magento/Backend/Model/Session/AdminConfig.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ class AdminConfig extends Config
3030
protected $_frontNameResolver;
3131

3232
/**
33-
* @var \Magento\Store\Model\StoreManagerInterface
33+
* @var \Magento\Backend\App\BackendAppList
3434
*/
35-
protected $_storeManager;
35+
private $backendAppList;
3636

3737
/**
38-
* @var \Magento\Backend\App\BackendAppList
38+
* @var \Magento\Backend\Model\UrlFactory
3939
*/
40-
private $backendAppList;
40+
private $backendUrlFactory;
4141

4242
/**
4343
* @param \Magento\Framework\ValidatorFactory $validatorFactory
@@ -49,7 +49,7 @@ class AdminConfig extends Config
4949
* @param string $scopeType
5050
* @param \Magento\Backend\App\BackendAppList $backendAppList
5151
* @param FrontNameResolver $frontNameResolver
52-
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
52+
* @param \Magento\Backend\Model\UrlFactory $backendUrlFactory
5353
* @param string $lifetimePath
5454
* @param string $sessionName
5555
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
@@ -64,7 +64,7 @@ public function __construct(
6464
$scopeType,
6565
\Magento\Backend\App\BackendAppList $backendAppList,
6666
FrontNameResolver $frontNameResolver,
67-
\Magento\Store\Model\StoreManagerInterface $storeManager,
67+
\Magento\Backend\Model\UrlFactory $backendUrlFactory,
6868
$lifetimePath = self::XML_PATH_COOKIE_LIFETIME,
6969
$sessionName = self::SESSION_NAME_ADMIN
7070
) {
@@ -79,8 +79,8 @@ public function __construct(
7979
$lifetimePath
8080
);
8181
$this->_frontNameResolver = $frontNameResolver;
82-
$this->_storeManager = $storeManager;
8382
$this->backendAppList = $backendAppList;
83+
$this->backendUrlFactory = $backendUrlFactory;
8484
$adminPath = $this->extractAdminPath();
8585
$this->setCookiePath($adminPath);
8686
$this->setName($sessionName);
@@ -95,7 +95,7 @@ private function extractAdminPath()
9595
{
9696
$backendApp = $this->backendAppList->getCurrentApp();
9797
$cookiePath = null;
98-
$baseUrl = parse_url($this->_storeManager->getStore()->getBaseUrl(), PHP_URL_PATH);
98+
$baseUrl = parse_url($this->backendUrlFactory->create()->getBaseUrl(), PHP_URL_PATH);
9999
if (!$backendApp) {
100100
$cookiePath = $baseUrl . $this->_frontNameResolver->getFrontName();
101101
return $cookiePath;

app/code/Magento/Backend/Test/Unit/Model/Session/AdminConfigTest.php

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ class AdminConfigTest extends \PHPUnit_Framework_TestCase
2929
private $objectManager;
3030

3131
/**
32-
* @var \Magento\Store\Model\StoreManagerInterface | \PHPUnit_Framework_MockObject_MockObject
32+
* @var \Magento\Backend\Model\UrlFactory | \PHPUnit_Framework_MockObject_MockObject
3333
*/
34-
private $storeManagerMock;
34+
private $backendUrlFactory;
3535

3636
/**
3737
* @var \Magento\Framework\Filesystem|\PHPUnit_Framework_MockObject_MockObject
@@ -56,13 +56,10 @@ protected function setUp()
5656
$this->validatorFactory = $this->getMockBuilder('Magento\Framework\ValidatorFactory')
5757
->disableOriginalConstructor()
5858
->getMock();
59-
60-
$storeMock = $this->getMockBuilder('\Magento\Store\Model\Store')
61-
->disableOriginalConstructor()
62-
->getMock();
63-
$storeMock->expects($this->once())->method('getBaseUrl')->will($this->returnValue('/'));
64-
$this->storeManagerMock = $this->getMockForAbstractClass('\Magento\Store\Model\StoreManagerInterface');
65-
$this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($storeMock));
59+
$backendUrl = $this->getMock('\Magento\Backend\Model\Url', [], [], '', false);
60+
$backendUrl->expects($this->once())->method('getBaseUrl')->will($this->returnValue('/'));
61+
$this->backendUrlFactory = $this->getMock('Magento\Backend\Model\UrlFactory', ['create'], [], '', false);
62+
$this->backendUrlFactory->expects($this->any())->method('create')->willReturn($backendUrl);
6663

6764
$this->filesystemMock = $this->getMock('\Magento\Framework\Filesystem', [], [], '', false);
6865
$dirMock = $this->getMockForAbstractClass('Magento\Framework\Filesystem\Directory\WriteInterface');
@@ -99,7 +96,7 @@ public function testSetCookiePathNonDefault()
9996
'validatorFactory' => $this->validatorFactory,
10097
'request' => $this->requestMock,
10198
'frontNameResolver' => $mockFrontNameResolver,
102-
'storeManager' => $this->storeManagerMock,
99+
'backendUrlFactory' => $this->backendUrlFactory,
103100
'filesystem' => $this->filesystemMock,
104101
]
105102
);
@@ -134,7 +131,7 @@ public function testSetSessionNameByConstructor()
134131
'validatorFactory' => $this->validatorFactory,
135132
'request' => $this->requestMock,
136133
'sessionName' => $sessionName,
137-
'storeManager' => $this->storeManagerMock,
134+
'backendUrlFactory' => $this->backendUrlFactory,
138135
'filesystem' => $this->filesystemMock,
139136
]
140137
);

app/code/Magento/Catalog/etc/di.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,11 @@
494494
</argument>
495495
</arguments>
496496
</type>
497+
<type name="Magento\Catalog\Console\Command\ImagesResizeCommand">
498+
<arguments>
499+
<argument name="productRepository" xsi:type="object">Magento\Catalog\Api\ProductRepositoryInterface\Proxy</argument>
500+
</arguments>
501+
</type>
497502
<type name="Magento\Framework\Config\View">
498503
<arguments>
499504
<argument name="xpath" xsi:type="array">

app/code/Magento/Cookie/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-cookie",
33
"description": "N/A",
44
"require": {
5-
"php": "~5.4.11|~5.5.0|~5.6.0",
5+
"php": "~5.5.0|~5.6.0|~7.0.0",
66
"magento/module-store": "1.0.0-beta",
77
"magento/framework": "1.0.0-beta"
88
},

app/code/Magento/Customer/Console/Command/UpgradeHashAlgorithmCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ public function __construct(
4040
) {
4141
parent::__construct();
4242
$this->customerCollectionFactory = $customerCollectionFactory;
43-
$this->collection = $customerCollectionFactory->create();
4443
$this->encryptor = $encryptor;
4544
}
4645

@@ -58,6 +57,7 @@ protected function configure()
5857
*/
5958
protected function execute(InputInterface $input, OutputInterface $output)
6059
{
60+
$this->collection = $this->customerCollectionFactory->create();
6161
$this->collection->addAttributeToSelect('*');
6262
$customerCollection = $this->collection->getItems();
6363
/** @var $customer Customer */

app/code/Magento/Deploy/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-deploy",
33
"description": "N/A",
44
"require": {
5-
"php": "~5.5.0|~5.6.0",
5+
"php": "~5.5.0|~5.6.0|~7.0.0",
66
"magento/framework": "1.0.0-beta",
77
"magento/module-developer": "1.0.0-beta",
88
"magento/module-store": "1.0.0-beta",

app/code/Magento/DownloadableImportExport/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-downloadable-import-export",
33
"description": "N/A",
44
"require": {
5-
"php": "~5.5.0|~5.6.0",
5+
"php": "~5.5.0|~5.6.0|~7.0.0",
66
"magento/module-catalog": "1.0.0-beta",
77
"magento/module-import-export": "1.0.0-beta",
88
"magento/module-catalog-import-export": "1.0.0-beta",

app/code/Magento/EncryptionKey/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-encryption-key",
33
"description": "N/A",
44
"require": {
5-
"php": "~5.5.0|~5.6.0",
5+
"php": "~5.5.0|~5.6.0|~7.0.0",
66
"magento/module-config": "1.0.0-beta",
77
"magento/module-backend": "1.0.0-beta",
88
"magento/framework": "1.0.0-beta"

app/code/Magento/Marketplace/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-marketplace",
33
"description": "N/A",
44
"require": {
5-
"php": "~5.5.0|~5.6.0",
5+
"php": "~5.5.0|~5.6.0|~7.0.0",
66
"magento/framework": "1.0.0-beta",
77
"magento/module-backend": "1.0.0-beta"
88
},

app/code/Magento/NewRelicReporting/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-new-relic-reporting",
33
"description": "N/A",
44
"require": {
5-
"php": "~5.5.0|~5.6.0",
5+
"php": "~5.5.0|~5.6.0|~7.0.0",
66
"magento/module-store": "1.0.0-beta",
77
"magento/module-backend": "1.0.0-beta",
88
"magento/module-customer": "1.0.0-beta",

app/code/Magento/PageCache/Model/App/FrontController/BuiltinPlugin.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ public function aroundDispatch(
7676
$this->kernel->process($result);
7777
}
7878
} else {
79+
json_decode($result->getContent());
80+
if (json_last_error() == JSON_ERROR_NONE) {
81+
// reset profiler to avoid appending profiling stat to JSON response
82+
\Magento\Framework\Profiler::reset();
83+
}
7984
$this->addDebugHeader($result, 'X-Magento-Cache-Debug', 'HIT', true);
8085
}
8186
return $result;

app/code/Magento/PageCache/Test/Unit/Model/App/FrontController/BuiltinPluginTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ public function testAroundDispatchReturnsCache($state)
200200
$this->responseMock->expects($this->never())
201201
->method('setHeader');
202202
}
203+
$this->responseMock->expects($this->once())->method('getContent');
203204
$this->assertSame(
204205
$this->responseMock,
205206
$this->plugin->aroundDispatch($this->frontControllerMock, $this->closure, $this->requestMock)

app/code/Magento/Swagger/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-swagger",
33
"description": "N/A",
44
"require": {
5-
"php": "~5.5.0|~5.6.0",
5+
"php": "~5.5.0|~5.6.0|~7.0.0",
66
"magento/framework": "1.0.0-beta"
77
},
88
"type": "magento2-module",

app/code/Magento/Variable/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-variable",
33
"description": "N/A",
44
"require": {
5-
"php": "~5.4.11|~5.5.0|~5.6.0",
5+
"php": "~5.5.0|~5.6.0|~7.0.0",
66
"magento/module-backend": "1.0.0-beta",
77
"magento/module-email": "1.0.0-beta",
88
"magento/module-store": "1.0.0-beta",

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
"ext-intl": "*",
7070
"ext-xsl": "*",
7171
"ext-mbstring": "*",
72+
"ext-openssl": "*",
7273
"sjparkinson/static-review": "~4.1",
7374
"fabpot/php-cs-fixer": "~1.2",
7475
"lusitanian/oauth": "~0.3 <=0.7.0"

composer.lock

Lines changed: 9 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev/tests/integration/testsuite/Magento/Setup/Module/Dependency/_files/composer3.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-module1",
33
"description": "N/A",
44
"require": {
5-
"php": "~5.5.0|~5.6.0"
5+
"php": "~5.5.0|~5.6.0|~7.0.0"
66
},
77
"type": "magento2-module",
88
"version": "0.1.0-alpha103"

dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ private function assertMagentoConventions($dir, $packageType, \StdClass $json)
154154
$xml = simplexml_load_file("$dir/etc/module.xml");
155155
$this->assertConsistentModuleName($xml, $json->name);
156156
$this->assertDependsOnPhp($json->require);
157+
$this->assertPhpVersionInSync($json->name, $json->require->php);
157158
$this->assertDependsOnFramework($json->require);
158159
$this->assertRequireInSync($json);
159160
$this->assertAutoload($json);
@@ -166,12 +167,14 @@ private function assertMagentoConventions($dir, $packageType, \StdClass $json)
166167
case 'magento2-theme':
167168
$this->assertRegExp('/^magento\/theme-(?:adminhtml|frontend)(\-[a-z0-9_]+)+$/', $json->name);
168169
$this->assertDependsOnPhp($json->require);
170+
$this->assertPhpVersionInSync($json->name, $json->require->php);
169171
$this->assertDependsOnFramework($json->require);
170172
$this->assertRequireInSync($json);
171173
break;
172174
case 'magento2-library':
173175
$this->assertDependsOnPhp($json->require);
174176
$this->assertRegExp('/^magento\/framework*/', $json->name);
177+
$this->assertPhpVersionInSync($json->name, $json->require->php);
175178
$this->assertRequireInSync($json);
176179
$this->assertAutoload($json);
177180
break;
@@ -277,6 +280,22 @@ private function assertVersionInSync($name, $version)
277280
);
278281
}
279282

283+
/**
284+
* Assert that PHP versions in root composer.json and Magento component's composer.json are not out of sync
285+
*
286+
* @param string $name
287+
* @param string $phpVersion
288+
*/
289+
private function assertPhpVersionInSync($name, $phpVersion)
290+
{
291+
$this->assertEquals(
292+
self::$rootJson['require']['php'],
293+
$phpVersion,
294+
"PHP version {$phpVersion} in component {$name} is inconsistent with version "
295+
. self::$rootJson['require']['php'] . ' in root composer.json'
296+
);
297+
}
298+
280299
/**
281300
* Make sure requirements of components are reflected in root composer.json
282301
*

lib/internal/Magento/Framework/App/ErrorHandler.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,11 @@ public function handler($errorNo, $errorStr, $errorFile, $errorLine)
5151
return false;
5252
}
5353

54-
if (strpos($errorStr, 'Automatically populating $HTTP_RAW_POST_DATA is deprecated') !== false) {
55-
// this warning should be suppressed as it is a known bug in php 5.6.0 https://bugs.php.net/bug.php?id=66763
56-
// and workaround suggested here (http://php.net/manual/en/ini.core.php#ini.always-populate-raw-post-data)
57-
// is not compatible with HHVM
58-
return false;
59-
}
60-
6154
$errorNo = $errorNo & error_reporting();
6255
if ($errorNo == 0) {
6356
return false;
6457
}
58+
6559
$msg = isset($this->errorPhrases[$errorNo]) ? $this->errorPhrases[$errorNo] : "Unknown error ({$errorNo})";
6660
$msg .= ": {$errorStr} in {$errorFile} on line {$errorLine}";
6761
throw new \Exception($msg);

lib/internal/Magento/Framework/App/Http.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,12 @@ private function redirectToSetup(Bootstrap $bootstrap, \Exception $exception)
184184
$this->_response->setRedirect($setupInfo->getUrl());
185185
$this->_response->sendHeaders();
186186
} else {
187-
$newMessage = $exception->getMessage() . "\nNOTE: web setup wizard is not accessible.\n"
188-
. 'In order to install, use Magento Setup CLI or configure web access to the following directory: '
189-
. $setupInfo->getDir($projectRoot);
187+
$newMessage = $exception->getMessage() . "\nNOTE: You cannot install Magento using the Setup Wizard "
188+
. "because the Magento setup directory cannot be accessed. \n"
189+
. 'You can install Magento using either the command line or you must restore access '
190+
. 'to the following directory: ' . $setupInfo->getDir($projectRoot) . "\n";
191+
$newMessage .= 'If you are using the sample nginx configuration, please go to '
192+
. $this->_request->getScheme(). '://' . $this->_request->getHttpHost() . $setupInfo->getUrl();
190193
throw new \Exception($newMessage, 0, $exception);
191194
}
192195
}

0 commit comments

Comments
 (0)