From b9c1c2c0d08f4fdb085c88a54c424710dd0a10f6 Mon Sep 17 00:00:00 2001 From: Viktor Tymchynskyi Date: Thu, 1 Sep 2016 17:26:20 +0300 Subject: [PATCH 1/4] MAGETWO-57755: [GITHUB] Magento 2.0.x and 2.1.x does not respect table prefix during installation #5688 --- setup/src/Magento/Setup/Module/Setup.php | 4 +-- .../Setup/Test/Unit/Module/SetupTest.php | 28 +++++++++++++++---- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/setup/src/Magento/Setup/Module/Setup.php b/setup/src/Magento/Setup/Module/Setup.php index 39fa5cbda13ad..e805306e26ebf 100644 --- a/setup/src/Magento/Setup/Module/Setup.php +++ b/setup/src/Magento/Setup/Module/Setup.php @@ -25,7 +25,7 @@ public function getIdxName( $indexType = '', $connectionName = ResourceConnection::DEFAULT_CONNECTION ) { - return $this->getConnection($connectionName)->getIndexName($tableName, $fields, $indexType); + return $this->getConnection($connectionName)->getIndexName($this->getTable($tableName), $fields, $indexType); } /** @@ -46,7 +46,7 @@ public function getFkName( $connectionName = ResourceConnection::DEFAULT_CONNECTION ) { return $this->getConnection($connectionName)->getForeignKeyName( - $priTableName, + $this->getTable($priTableName), $priColumnName, $refTableName, $refColumnName diff --git a/setup/src/Magento/Setup/Test/Unit/Module/SetupTest.php b/setup/src/Magento/Setup/Test/Unit/Module/SetupTest.php index 9a75c0a3d4bf3..d97356cb1ff7f 100644 --- a/setup/src/Magento/Setup/Test/Unit/Module/SetupTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Module/SetupTest.php @@ -6,7 +6,8 @@ namespace Magento\Setup\Test\Unit\Module; -use \Magento\Setup\Module\Setup; +use Magento\Framework\App\ResourceConnection; +use Magento\Setup\Module\Setup; class SetupTest extends \PHPUnit_Framework_TestCase { @@ -22,19 +23,24 @@ class SetupTest extends \PHPUnit_Framework_TestCase */ private $setup; + /** + * @var ResourceConnection|\PHPUnit_Framework_MockObject_MockObject + */ + private $resourceModelMock; + protected function setUp() { - $resourceModel = $this->getMock(\Magento\Framework\App\ResourceConnection::class, [], [], '', false); + $this->resourceModelMock = $this->getMock(ResourceConnection::class, [], [], '', false); $this->connection = $this->getMockForAbstractClass(\Magento\Framework\DB\Adapter\AdapterInterface::class); - $resourceModel->expects($this->any()) + $this->resourceModelMock->expects($this->any()) ->method('getConnection') ->with(self::CONNECTION_NAME) ->will($this->returnValue($this->connection)); - $resourceModel->expects($this->any()) + $this->resourceModelMock->expects($this->any()) ->method('getConnectionByName') - ->with(\Magento\Framework\App\ResourceConnection::DEFAULT_CONNECTION) + ->with(ResourceConnection::DEFAULT_CONNECTION) ->willReturn($this->connection); - $this->setup = new Setup($resourceModel, self::CONNECTION_NAME); + $this->setup = new Setup($this->resourceModelMock, self::CONNECTION_NAME); } public function testGetIdxName() @@ -44,6 +50,11 @@ public function testGetIdxName() $indexType = 'index_type'; $expectedIdxName = 'idxName'; + $this->resourceModelMock->expects($this->once()) + ->method('getTableName') + ->with($tableName) + ->will($this->returnValue($tableName)); + $this->connection->expects($this->once()) ->method('getIndexName') ->with($tableName, $fields, $indexType) @@ -59,6 +70,11 @@ public function testGetFkName() $columnName = 'columnName'; $refColumnName = 'refColumnName'; + $this->resourceModelMock->expects($this->once()) + ->method('getTableName') + ->with($tableName) + ->will($this->returnValue($tableName)); + $this->connection->expects($this->once()) ->method('getForeignKeyName') ->with($tableName, $columnName, $refTable, $refColumnName) From 42856508fbb5c5f390542bc2df8b20a2f3fbd843 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Wed, 7 Sep 2016 17:57:43 +0300 Subject: [PATCH 2/4] MAGETWO-58081: [GitHub] Magento2 SSL Installation httpss:// #6262 --- setup/pub/magento/setup/web-configuration.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup/pub/magento/setup/web-configuration.js b/setup/pub/magento/setup/web-configuration.js index 164ce5ba63c41..03a0fc7845dda 100644 --- a/setup/pub/magento/setup/web-configuration.js +++ b/setup/pub/magento/setup/web-configuration.js @@ -68,12 +68,12 @@ angular.module('web-configuration', ['ngStorage']) $scope.$watch('config.address.base_url', function() { if (angular.equals($scope.config.https.text, '') || angular.isUndefined($scope.config.https.text)) { - $scope.config.https.text = $scope.config.address.base_url.replace('http', 'https'); + $scope.config.https.text = $scope.config.address.base_url.replace('http://', 'https://'); } }); $scope.populateHttps = function() { - $scope.config.https.text = $scope.config.address.base_url.replace('http', 'https'); + $scope.config.https.text = $scope.config.address.base_url.replace('http://', 'https://'); }; $scope.showEncryptKey = function() { From 65e833444ede7cb2f52a547423f7d591a5e8b6aa Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Thu, 8 Sep 2016 10:06:55 +0300 Subject: [PATCH 3/4] MAGETWO-58081: [GitHub] Magento2 SSL Installation httpss:// #6262 --- setup/view/magento/setup/web-configuration.phtml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/setup/view/magento/setup/web-configuration.phtml b/setup/view/magento/setup/web-configuration.phtml index d2097f78527b5..35aa19484ed53 100644 --- a/setup/view/magento/setup/web-configuration.phtml +++ b/setup/view/magento/setup/web-configuration.phtml @@ -68,13 +68,17 @@ $hints = [ ng-init="config.address.auto_base_url = 'autoBaseUrl ?>'; fillBaseURL();" ng-blur="addSlash()" ng-change="populateHttps()" + ng-pattern="/^(https?:\/\/).*$/" tooltip-placement="right" tooltip-html-unsafe="" tooltip-trigger="focus" tooltip-append-to-body="true" >
- + Please enter a valid base URL path. (ex: http://www.example.com/)
@@ -189,10 +193,16 @@ $hints = [ ng-class="{'invalid': webconfig.https.$invalid && webconfig.submitted}" ng-if="config.https.front || config.https.admin" ng-focus="" + ng-pattern="/^(https?:\/\/).*$/" required >
- Please enter a valid HTTPS base URL path. (ex: https://www.example.com/) + + Please enter a valid HTTPS base URL path. (ex: https://www.example.com/) +
From de8cb2f8ed1ece749f6691388ea4c6e168bde817 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Mon, 12 Sep 2016 09:56:53 +0300 Subject: [PATCH 4/4] MAGETWO-57743: Fix Catalog integration tests on Travis CI --- .../Model/Import/Product/Type/AbstractType.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product/Type/AbstractType.php b/app/code/Magento/CatalogImportExport/Model/Import/Product/Type/AbstractType.php index a28f65aef1ece..8461e617431d6 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product/Type/AbstractType.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product/Type/AbstractType.php @@ -567,4 +567,13 @@ protected function getProductEntityLinkField() } return $this->productEntityLinkField; } + + /** + * Clean cached values + */ + public function __destruct() + { + self::$attributeCodeToId = []; + self::$commonAttributesCache = []; + } }