From 6bf2f2366654095ead2d34cbc49476b4b950117b Mon Sep 17 00:00:00 2001 From: Nino Aratari Date: Thu, 2 Mar 2017 15:47:25 +0100 Subject: [PATCH 1/5] magento/magento2 #2370: A PHPDoc comment for \Magento\Config\Model\Config\SourceFactory::create() method is wrong Fixed type in return comment --- app/code/Magento/Config/Model/Config/SourceFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Config/Model/Config/SourceFactory.php b/app/code/Magento/Config/Model/Config/SourceFactory.php index 1846bac059c29..05c4e1962487a 100644 --- a/app/code/Magento/Config/Model/Config/SourceFactory.php +++ b/app/code/Magento/Config/Model/Config/SourceFactory.php @@ -26,7 +26,7 @@ public function __construct(\Magento\Framework\ObjectManagerInterface $objectMan * Create backend model by name * * @param string $modelName - * @return mixed + * @return \Magento\Framework\Option\ArrayInterface|object */ public function create($modelName) { From 2464c6653100cdbbecc97e8c694fc0a094b5bddb Mon Sep 17 00:00:00 2001 From: Nino Aratari Date: Thu, 2 Mar 2017 16:29:36 +0100 Subject: [PATCH 2/5] magento/magento2 #2370: A PHPDoc comment for \Magento\Config\Model\Config\SourceFactory::create() method is wrong The correct return parameter is \Magento\Framework\Option\ArrayInterface --- app/code/Magento/Config/Model/Config/SourceFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Config/Model/Config/SourceFactory.php b/app/code/Magento/Config/Model/Config/SourceFactory.php index 05c4e1962487a..654a3bcec4d89 100644 --- a/app/code/Magento/Config/Model/Config/SourceFactory.php +++ b/app/code/Magento/Config/Model/Config/SourceFactory.php @@ -26,7 +26,7 @@ public function __construct(\Magento\Framework\ObjectManagerInterface $objectMan * Create backend model by name * * @param string $modelName - * @return \Magento\Framework\Option\ArrayInterface|object + * @return \Magento\Framework\Option\ArrayInterface */ public function create($modelName) { From aad5ba98e0c52a1b7d75f609f7434aae4aa16e7b Mon Sep 17 00:00:00 2001 From: Nino Aratari Date: Fri, 3 Mar 2017 11:26:59 +0100 Subject: [PATCH 3/5] magento/magento2 #8765: Magento\Catalog\Model\ResourceModel\AbstractResource::getAttributeRawValue() returns false negative - fixed adding a strong check on return value --- .../Magento/Catalog/Model/ResourceModel/AbstractResource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Model/ResourceModel/AbstractResource.php b/app/code/Magento/Catalog/Model/ResourceModel/AbstractResource.php index 00cf1be4f2141..ae78ef00363fd 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/AbstractResource.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/AbstractResource.php @@ -568,6 +568,6 @@ public function getAttributeRawValue($entityId, $attribute, $store) $attributesData = $_data[1]; } - return $attributesData ? $attributesData : false; + return $attributesData!==false ? $attributesData : false; } } From ae6a297ff99c062c4f20303b8e77e570f4b205d3 Mon Sep 17 00:00:00 2001 From: Nino Aratari Date: Fri, 3 Mar 2017 15:35:17 +0100 Subject: [PATCH 4/5] magento/magento2 #8765: Magento\Catalog\Model\ResourceModel\AbstractResource::getAttributeRawValue() returns false negative - fixed adding a strong check on return value --- .../Magento/Catalog/Model/ResourceModel/AbstractResource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Model/ResourceModel/AbstractResource.php b/app/code/Magento/Catalog/Model/ResourceModel/AbstractResource.php index ae78ef00363fd..dff59f7dbb5ff 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/AbstractResource.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/AbstractResource.php @@ -568,6 +568,6 @@ public function getAttributeRawValue($entityId, $attribute, $store) $attributesData = $_data[1]; } - return $attributesData!==false ? $attributesData : false; + return $attributesData === false ? false: $attributesData; } } From c268d5808e130b863f001375c56dfe16733428ab Mon Sep 17 00:00:00 2001 From: Nino Aratari Date: Fri, 3 Mar 2017 15:55:02 +0100 Subject: [PATCH 5/5] magento/magento2 #8616: Unused mysql privileges required even if not used/not needed at all - removed REFERENCES and EVENT privileges from DbValidator (also in Test Unit). --- setup/src/Magento/Setup/Test/Unit/Validator/DbValidatorTest.php | 2 -- setup/src/Magento/Setup/Validator/DbValidator.php | 2 -- 2 files changed, 4 deletions(-) diff --git a/setup/src/Magento/Setup/Test/Unit/Validator/DbValidatorTest.php b/setup/src/Magento/Setup/Test/Unit/Validator/DbValidatorTest.php index b04b173e652b9..2c103e485d0d5 100644 --- a/setup/src/Magento/Setup/Test/Unit/Validator/DbValidatorTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Validator/DbValidatorTest.php @@ -55,7 +55,6 @@ public function testCheckDatabaseConnection() ['DELETE'], ['CREATE'], ['DROP'], - ['REFERENCES'], ['INDEX'], ['ALTER'], ['CREATE TEMPORARY TABLES'], @@ -65,7 +64,6 @@ public function testCheckDatabaseConnection() ['SHOW VIEW'], ['CREATE ROUTINE'], ['ALTER ROUTINE'], - ['EVENT'], ['TRIGGER'], ]; $accessibleDbs = ['some_db', 'name', 'another_db']; diff --git a/setup/src/Magento/Setup/Validator/DbValidator.php b/setup/src/Magento/Setup/Validator/DbValidator.php index 16b916b6a6989..0aea906b5b1e8 100644 --- a/setup/src/Magento/Setup/Validator/DbValidator.php +++ b/setup/src/Magento/Setup/Validator/DbValidator.php @@ -146,7 +146,6 @@ private function checkDatabasePrivileges(\Magento\Framework\DB\Adapter\AdapterIn 'DELETE', 'CREATE', 'DROP', - 'REFERENCES', 'INDEX', 'ALTER', 'CREATE TEMPORARY TABLES', @@ -156,7 +155,6 @@ private function checkDatabasePrivileges(\Magento\Framework\DB\Adapter\AdapterIn 'SHOW VIEW', 'CREATE ROUTINE', 'ALTER ROUTINE', - 'EVENT', 'TRIGGER' ];