Skip to content

Commit f607fc3

Browse files
committed
Merge remote-tracking branch 'mainline/develop' into BUGS
2 parents 1730ff3 + 83f4f2e commit f607fc3

File tree

5 files changed

+47
-12
lines changed

5 files changed

+47
-12
lines changed

app/code/Magento/CatalogImportExport/Model/Import/Product/Type/AbstractType.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,4 +567,13 @@ protected function getProductEntityLinkField()
567567
}
568568
return $this->productEntityLinkField;
569569
}
570+
571+
/**
572+
* Clean cached values
573+
*/
574+
public function __destruct()
575+
{
576+
self::$attributeCodeToId = [];
577+
self::$commonAttributesCache = [];
578+
}
570579
}

setup/pub/magento/setup/web-configuration.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ angular.module('web-configuration', ['ngStorage'])
6868

6969
$scope.$watch('config.address.base_url', function() {
7070
if (angular.equals($scope.config.https.text, '') || angular.isUndefined($scope.config.https.text)) {
71-
$scope.config.https.text = $scope.config.address.base_url.replace('http', 'https');
71+
$scope.config.https.text = $scope.config.address.base_url.replace('http://', 'https://');
7272
}
7373
});
7474

7575
$scope.populateHttps = function() {
76-
$scope.config.https.text = $scope.config.address.base_url.replace('http', 'https');
76+
$scope.config.https.text = $scope.config.address.base_url.replace('http://', 'https://');
7777
};
7878

7979
$scope.showEncryptKey = function() {

setup/src/Magento/Setup/Module/Setup.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function getIdxName(
2525
$indexType = '',
2626
$connectionName = ResourceConnection::DEFAULT_CONNECTION
2727
) {
28-
return $this->getConnection($connectionName)->getIndexName($tableName, $fields, $indexType);
28+
return $this->getConnection($connectionName)->getIndexName($this->getTable($tableName), $fields, $indexType);
2929
}
3030

3131
/**
@@ -46,7 +46,7 @@ public function getFkName(
4646
$connectionName = ResourceConnection::DEFAULT_CONNECTION
4747
) {
4848
return $this->getConnection($connectionName)->getForeignKeyName(
49-
$priTableName,
49+
$this->getTable($priTableName),
5050
$priColumnName,
5151
$refTableName,
5252
$refColumnName

setup/src/Magento/Setup/Test/Unit/Module/SetupTest.php

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66

77
namespace Magento\Setup\Test\Unit\Module;
88

9-
use \Magento\Setup\Module\Setup;
9+
use Magento\Framework\App\ResourceConnection;
10+
use Magento\Setup\Module\Setup;
1011

1112
class SetupTest extends \PHPUnit_Framework_TestCase
1213
{
@@ -22,19 +23,24 @@ class SetupTest extends \PHPUnit_Framework_TestCase
2223
*/
2324
private $setup;
2425

26+
/**
27+
* @var ResourceConnection|\PHPUnit_Framework_MockObject_MockObject
28+
*/
29+
private $resourceModelMock;
30+
2531
protected function setUp()
2632
{
27-
$resourceModel = $this->getMock(\Magento\Framework\App\ResourceConnection::class, [], [], '', false);
33+
$this->resourceModelMock = $this->getMock(ResourceConnection::class, [], [], '', false);
2834
$this->connection = $this->getMockForAbstractClass(\Magento\Framework\DB\Adapter\AdapterInterface::class);
29-
$resourceModel->expects($this->any())
35+
$this->resourceModelMock->expects($this->any())
3036
->method('getConnection')
3137
->with(self::CONNECTION_NAME)
3238
->will($this->returnValue($this->connection));
33-
$resourceModel->expects($this->any())
39+
$this->resourceModelMock->expects($this->any())
3440
->method('getConnectionByName')
35-
->with(\Magento\Framework\App\ResourceConnection::DEFAULT_CONNECTION)
41+
->with(ResourceConnection::DEFAULT_CONNECTION)
3642
->willReturn($this->connection);
37-
$this->setup = new Setup($resourceModel, self::CONNECTION_NAME);
43+
$this->setup = new Setup($this->resourceModelMock, self::CONNECTION_NAME);
3844
}
3945

4046
public function testGetIdxName()
@@ -44,6 +50,11 @@ public function testGetIdxName()
4450
$indexType = 'index_type';
4551
$expectedIdxName = 'idxName';
4652

53+
$this->resourceModelMock->expects($this->once())
54+
->method('getTableName')
55+
->with($tableName)
56+
->will($this->returnValue($tableName));
57+
4758
$this->connection->expects($this->once())
4859
->method('getIndexName')
4960
->with($tableName, $fields, $indexType)
@@ -59,6 +70,11 @@ public function testGetFkName()
5970
$columnName = 'columnName';
6071
$refColumnName = 'refColumnName';
6172

73+
$this->resourceModelMock->expects($this->once())
74+
->method('getTableName')
75+
->with($tableName)
76+
->will($this->returnValue($tableName));
77+
6278
$this->connection->expects($this->once())
6379
->method('getForeignKeyName')
6480
->with($tableName, $columnName, $refTable, $refColumnName)

setup/view/magento/setup/web-configuration.phtml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,17 @@ $hints = [
6868
ng-init="config.address.auto_base_url = '<?php echo $this->autoBaseUrl ?>'; fillBaseURL();"
6969
ng-blur="addSlash()"
7070
ng-change="populateHttps()"
71+
ng-pattern="/^(https?:\/\/).*$/"
7172
tooltip-placement="right"
7273
tooltip-html-unsafe="<?php echo $hints['base_url']; ?>"
7374
tooltip-trigger="focus"
7475
tooltip-append-to-body="true"
7576
>
7677
<div class="error-container">
77-
<span ng-show="webconfig.base_url.$error.required || webconfig.base_url.$error.url">
78+
<span ng-show="!webconfig.base_url.valid
79+
|| webconfig.base_url.$error.required
80+
|| webconfig.base_url.$error.url"
81+
>
7882
Please enter a valid base URL path. (ex: http://www.example.com/)
7983
</span>
8084
</div>
@@ -189,10 +193,16 @@ $hints = [
189193
ng-class="{'invalid': webconfig.https.$invalid && webconfig.submitted}"
190194
ng-if="config.https.front || config.https.admin"
191195
ng-focus=""
196+
ng-pattern="/^(https?:\/\/).*$/"
192197
required
193198
>
194199
<div class="error-container">
195-
<span ng-show="webconfig.https.$error.required || webconfig.https.$error.url">Please enter a valid HTTPS base URL path. (ex: https://www.example.com/)</span>
200+
<span ng-show="!webconfig.https.$error.valid
201+
|| webconfig.https.$error.required
202+
|| webconfig.https.$error.url"
203+
>
204+
Please enter a valid HTTPS base URL path. (ex: https://www.example.com/)
205+
</span>
196206
</div>
197207
</div>
198208
</div>

0 commit comments

Comments
 (0)