From a1919944f3d5ecdbf169e3b6dcffd61e123013a7 Mon Sep 17 00:00:00 2001 From: schurter-cw Date: Wed, 9 Dec 2015 13:51:34 +0100 Subject: [PATCH 001/345] Fix refund notification registration --- app/code/Magento/Sales/Model/Order/Payment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/Model/Order/Payment.php b/app/code/Magento/Sales/Model/Order/Payment.php index 83cf0853fdab4..ad103d692d542 100644 --- a/app/code/Magento/Sales/Model/Order/Payment.php +++ b/app/code/Magento/Sales/Model/Order/Payment.php @@ -747,7 +747,7 @@ public function registerRefundNotification($amount) true )->setAutomaticallyCreated( true - )->register()->addComment( + )->addComment( __('The credit memo has been created automatically.') ); $creditmemo->save(); From 33b235ec365b3d4c89e7024e12f60feab8fe70dd Mon Sep 17 00:00:00 2001 From: Valeriy Nayda Date: Tue, 22 Mar 2016 15:05:49 +0200 Subject: [PATCH 002/345] =?UTF-8?q?MAGETWO-50468:=20Products=20Grid=20Filt?= =?UTF-8?q?ering=20by=20Category=20ID=20doesn=E2=80=99t=20work?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Product/Attribute/Edit/Tab/Advanced.php | 21 ++++++++++++ .../Model/Product/Attribute/Source/Status.php | 30 +++++++++++++++-- .../Catalog/Model/Product/Visibility.php | 30 +++++++++++++++-- .../Magento/Catalog/Setup/CategorySetup.php | 3 ++ .../Product/AddWebsitesFieldToCollection.php | 3 +- .../Catalog/etc/catalog_attributes.xml | 1 - .../Magento/Catalog/etc/eav_attributes.xml | 3 ++ .../Model/Entity/Attribute/Source/Boolean.php | 33 +++++++++++++++++-- .../Model/Entity/Attribute/Source/Table.php | 32 ++++++++++++++++-- 9 files changed, 143 insertions(+), 13 deletions(-) diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php index 8bcd29a95a2c8..156e7a6ff64b6 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php @@ -15,7 +15,9 @@ use Magento\Backend\Block\Widget\Form\Generic; use Magento\Config\Model\Config\Source\Yesno; +use Magento\Eav\Block\Adminhtml\Attribute\PropertyLocker; use Magento\Eav\Helper\Data; +use Magento\Framework\App\ObjectManager; class Advanced extends Generic { @@ -36,6 +38,11 @@ class Advanced extends Generic */ protected $disableScopeChangeList; + /** + * @var PropertyLocker + */ + private $propertyLocker; + /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Framework\Registry $registry @@ -241,6 +248,7 @@ protected function _prepareForm() $form->getElement('is_global')->setDisabled(1); } $this->setForm($form); + $this->getPropertyLocker()->lock($form); return $this; } @@ -264,4 +272,17 @@ private function getAttributeObject() { return $this->_coreRegistry->registry('entity_attribute'); } + + /** + * Get property locker + * + * @return PropertyLocker + */ + private function getPropertyLocker() + { + if (null === $this->propertyLocker) { + $this->propertyLocker = ObjectManager::getInstance()->get(PropertyLocker::class); + } + return $this->propertyLocker; + } } diff --git a/app/code/Magento/Catalog/Model/Product/Attribute/Source/Status.php b/app/code/Magento/Catalog/Model/Product/Attribute/Source/Status.php index b840ea480a368..fb761bf116e37 100644 --- a/app/code/Magento/Catalog/Model/Product/Attribute/Source/Status.php +++ b/app/code/Magento/Catalog/Model/Product/Attribute/Source/Status.php @@ -5,9 +5,12 @@ */ namespace Magento\Catalog\Model\Product\Attribute\Source; +use Magento\Catalog\Api\Data\ProductInterface; use Magento\Eav\Model\Entity\Attribute\Source\AbstractSource; use Magento\Eav\Model\Entity\Attribute\Source\SourceInterface; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Data\OptionSourceInterface; +use Magento\Framework\Model\Entity\MetadataPool; /** * Product status functionality model @@ -23,6 +26,13 @@ class Status extends AbstractSource implements SourceInterface, OptionSourceInte /**#@-*/ + /** + * Metadata Pool + * + * @var MetadataPool + */ + protected $metadataPool; + /** * Retrieve Visible Status Ids * @@ -95,13 +105,14 @@ public function addValueSortToCollection($collection, $dir = 'asc') $attributeCode = $this->getAttribute()->getAttributeCode(); $attributeId = $this->getAttribute()->getId(); $attributeTable = $this->getAttribute()->getBackend()->getTable(); + $linkField = $this->getMetadataPool()->getMetadata(ProductInterface::class)->getLinkField(); if ($this->getAttribute()->isScopeGlobal()) { $tableName = $attributeCode . '_t'; $collection->getSelect()->joinLeft( [$tableName => $attributeTable], - "e.entity_id={$tableName}.entity_id" . + "e.entity_id={$tableName}.{$linkField}" . " AND {$tableName}.attribute_id='{$attributeId}'" . " AND {$tableName}.store_id='0'", [] @@ -114,13 +125,13 @@ public function addValueSortToCollection($collection, $dir = 'asc') $collection->getSelect()->joinLeft( [$valueTable1 => $attributeTable], - "e.entity_id={$valueTable1}.entity_id" . + "e.entity_id={$valueTable1}.{$linkField}" . " AND {$valueTable1}.attribute_id='{$attributeId}'" . " AND {$valueTable1}.store_id='0'", [] )->joinLeft( [$valueTable2 => $attributeTable], - "e.entity_id={$valueTable2}.entity_id" . + "e.entity_id={$valueTable2}.{$linkField}" . " AND {$valueTable2}.attribute_id='{$attributeId}'" . " AND {$valueTable2}.store_id='{$collection->getStoreId()}'", [] @@ -137,4 +148,17 @@ public function addValueSortToCollection($collection, $dir = 'asc') return $this; } + + /** + * Get product metadata pool + * + * @return MetadataPool + */ + private function getMetadataPool() + { + if (null === $this->metadataPool) { + $this->metadataPool = ObjectManager::getInstance()->get(MetadataPool::class); + } + return $this->metadataPool; + } } diff --git a/app/code/Magento/Catalog/Model/Product/Visibility.php b/app/code/Magento/Catalog/Model/Product/Visibility.php index 9f3b605b732ce..4e2a6d94f58cb 100644 --- a/app/code/Magento/Catalog/Model/Product/Visibility.php +++ b/app/code/Magento/Catalog/Model/Product/Visibility.php @@ -11,8 +11,11 @@ */ namespace Magento\Catalog\Model\Product; +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Data\OptionSourceInterface; use Magento\Framework\DB\Ddl\Table; +use Magento\Framework\Model\Entity\MetadataPool; class Visibility extends \Magento\Framework\DataObject implements OptionSourceInterface { @@ -38,6 +41,13 @@ class Visibility extends \Magento\Framework\DataObject implements OptionSourceIn */ protected $_eavEntityAttribute; + /** + * Metadata Pool + * + * @var MetadataPool + */ + protected $metadataPool; + /** * Construct * @@ -211,12 +221,13 @@ public function addValueSortToCollection($collection, $dir = 'asc') $attributeCode = $this->getAttribute()->getAttributeCode(); $attributeId = $this->getAttribute()->getId(); $attributeTable = $this->getAttribute()->getBackend()->getTable(); + $linkField = $this->getMetadataPool()->getMetadata(ProductInterface::class)->getLinkField(); if ($this->getAttribute()->isScopeGlobal()) { $tableName = $attributeCode . '_t'; $collection->getSelect()->joinLeft( [$tableName => $attributeTable], - "e.entity_id={$tableName}.entity_id" . + "e.entity_id={$tableName}.{$linkField}" . " AND {$tableName}.attribute_id='{$attributeId}'" . " AND {$tableName}.store_id='0'", [] @@ -227,13 +238,13 @@ public function addValueSortToCollection($collection, $dir = 'asc') $valueTable2 = $attributeCode . '_t2'; $collection->getSelect()->joinLeft( [$valueTable1 => $attributeTable], - "e.entity_id={$valueTable1}.entity_id" . + "e.entity_id={$valueTable1}.{$linkField}" . " AND {$valueTable1}.attribute_id='{$attributeId}'" . " AND {$valueTable1}.store_id='0'", [] )->joinLeft( [$valueTable2 => $attributeTable], - "e.entity_id={$valueTable2}.entity_id" . + "e.entity_id={$valueTable2}.{$linkField}" . " AND {$valueTable2}.attribute_id='{$attributeId}'" . " AND {$valueTable2}.store_id='{$collection->getStoreId()}'", [] @@ -256,4 +267,17 @@ public function toOptionArray() { return $this->getAllOptions(); } + + /** + * Get product metadata pool + * + * @return MetadataPool + */ + private function getMetadataPool() + { + if (null === $this->metadataPool) { + $this->metadataPool = ObjectManager::getInstance()->get(MetadataPool::class); + } + return $this->metadataPool; + } } diff --git a/app/code/Magento/Catalog/Setup/CategorySetup.php b/app/code/Magento/Catalog/Setup/CategorySetup.php index 0791f162cc172..bc148eb03b8a7 100644 --- a/app/code/Magento/Catalog/Setup/CategorySetup.php +++ b/app/code/Magento/Catalog/Setup/CategorySetup.php @@ -739,6 +739,9 @@ public function getDefaultEntities() 'sort_order' => 9, 'visible' => true, 'group' => 'General', + 'is_used_in_grid' => false, + 'is_visible_in_grid' => false, + 'is_filterable_in_grid' => false, ], 'options_container' => [ 'type' => 'varchar', diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/AddWebsitesFieldToCollection.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/AddWebsitesFieldToCollection.php index 9b7b91dded9be..5a90b1ece01f6 100644 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/AddWebsitesFieldToCollection.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/AddWebsitesFieldToCollection.php @@ -18,6 +18,7 @@ class AddWebsitesFieldToCollection implements AddFieldToCollectionInterface */ public function addField(Collection $collection, $field, $alias = null) { - $collection->addWebsiteNamesToResult(); + /** @var \Magento\Catalog\Model\ResourceModel\Product\Collection $collection */ + $collection->addWebsiteNamesToResult(); } } diff --git a/app/code/Magento/Catalog/etc/catalog_attributes.xml b/app/code/Magento/Catalog/etc/catalog_attributes.xml index fca54ab3e6e85..d822d36eabfee 100644 --- a/app/code/Magento/Catalog/etc/catalog_attributes.xml +++ b/app/code/Magento/Catalog/etc/catalog_attributes.xml @@ -45,7 +45,6 @@ - diff --git a/app/code/Magento/Catalog/etc/eav_attributes.xml b/app/code/Magento/Catalog/etc/eav_attributes.xml index 23b6bed267547..c480ea4dd2322 100644 --- a/app/code/Magento/Catalog/etc/eav_attributes.xml +++ b/app/code/Magento/Catalog/etc/eav_attributes.xml @@ -32,6 +32,9 @@ + + + diff --git a/app/code/Magento/Eav/Model/Entity/Attribute/Source/Boolean.php b/app/code/Magento/Eav/Model/Entity/Attribute/Source/Boolean.php index f05945ba68150..7fbb3e0110be8 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute/Source/Boolean.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute/Source/Boolean.php @@ -5,6 +5,9 @@ */ namespace Magento\Eav\Model\Entity\Attribute\Source; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\Model\Entity\MetadataPool; + class Boolean extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource { /** @@ -19,6 +22,13 @@ class Boolean extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource */ protected $_eavAttrEntity; + /** + * Metadata Pool + * + * @var MetadataPool + */ + protected $metadataPool; + /** * @param \Magento\Eav\Model\ResourceModel\Entity\AttributeFactory $eavAttrEntity * @codeCoverageIgnore @@ -155,13 +165,17 @@ public function addValueSortToCollection($collection, $dir = \Magento\Framework\ $attributeCode = $this->getAttribute()->getAttributeCode(); $attributeId = $this->getAttribute()->getId(); $attributeTable = $this->getAttribute()->getBackend()->getTable(); + + // FIXME: we can not use \Magento\Catalog\Api\Data\ProductInterface::class + $linkField = $this->getMetadataPool()->getMetadata(\Magento\Catalog\Api\Data\ProductInterface::class) + ->getLinkField(); if ($this->getAttribute()->isScopeGlobal()) { $tableName = $attributeCode . '_t'; $collection->getSelect() ->joinLeft( [$tableName => $attributeTable], - "e.entity_id={$tableName}.entity_id" + "e.entity_id={$tableName}.{$linkField}" . " AND {$tableName}.attribute_id='{$attributeId}'" . " AND {$tableName}.store_id='0'", [] @@ -173,14 +187,14 @@ public function addValueSortToCollection($collection, $dir = \Magento\Framework\ $collection->getSelect() ->joinLeft( [$valueTable1 => $attributeTable], - "e.entity_id={$valueTable1}.entity_id" + "e.entity_id={$valueTable1}.{$linkField}" . " AND {$valueTable1}.attribute_id='{$attributeId}'" . " AND {$valueTable1}.store_id='0'", [] ) ->joinLeft( [$valueTable2 => $attributeTable], - "e.entity_id={$valueTable2}.entity_id" + "e.entity_id={$valueTable2}.{$linkField}" . " AND {$valueTable2}.attribute_id='{$attributeId}'" . " AND {$valueTable2}.store_id='{$collection->getStoreId()}'", [] @@ -195,4 +209,17 @@ public function addValueSortToCollection($collection, $dir = \Magento\Framework\ $collection->getSelect()->order($valueExpr . ' ' . $dir); return $this; } + + /** + * Get product metadata pool + * + * @return MetadataPool + */ + private function getMetadataPool() + { + if (null === $this->metadataPool) { + $this->metadataPool = ObjectManager::getInstance()->get(MetadataPool::class); + } + return $this->metadataPool; + } } diff --git a/app/code/Magento/Eav/Model/Entity/Attribute/Source/Table.php b/app/code/Magento/Eav/Model/Entity/Attribute/Source/Table.php index 04b414a70a245..39447c1bd2344 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute/Source/Table.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute/Source/Table.php @@ -5,6 +5,9 @@ */ namespace Magento\Eav\Model\Entity\Attribute\Source; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\Model\Entity\MetadataPool; + class Table extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource { /** @@ -24,6 +27,13 @@ class Table extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource */ protected $_attrOptionFactory; + /** + * Metadata Pool + * + * @var MetadataPool + */ + protected $metadataPool; + /** * @param \Magento\Eav\Model\ResourceModel\Entity\Attribute\Option\CollectionFactory $attrOptionCollectionFactory * @param \Magento\Eav\Model\ResourceModel\Entity\Attribute\OptionFactory $attrOptionFactory @@ -140,15 +150,20 @@ public function addValueSortToCollection($collection, $dir = \Magento\Framework\ { $valueTable1 = $this->getAttribute()->getAttributeCode() . '_t1'; $valueTable2 = $this->getAttribute()->getAttributeCode() . '_t2'; + + // FIXME: we can not use \Magento\Catalog\Api\Data\ProductInterface::class + $linkField = $this->getMetadataPool()->getMetadata(\Magento\Catalog\Api\Data\ProductInterface::class) + ->getLinkField(); + $collection->getSelect()->joinLeft( [$valueTable1 => $this->getAttribute()->getBackend()->getTable()], - "e.entity_id={$valueTable1}.entity_id" . + "e.entity_id={$valueTable1}.{$linkField}" . " AND {$valueTable1}.attribute_id='{$this->getAttribute()->getId()}'" . " AND {$valueTable1}.store_id=0", [] )->joinLeft( [$valueTable2 => $this->getAttribute()->getBackend()->getTable()], - "e.entity_id={$valueTable2}.entity_id" . + "e.entity_id={$valueTable2}.{$linkField}" . " AND {$valueTable2}.attribute_id='{$this->getAttribute()->getId()}'" . " AND {$valueTable2}.store_id='{$collection->getStoreId()}'", [] @@ -241,4 +256,17 @@ public function getFlatUpdateSelect($store) { return $this->_attrOptionFactory->create()->getFlatUpdateSelect($this->getAttribute(), $store); } + + /** + * Get product metadata pool + * + * @return MetadataPool + */ + private function getMetadataPool() + { + if (null === $this->metadataPool) { + $this->metadataPool = ObjectManager::getInstance()->get(MetadataPool::class); + } + return $this->metadataPool; + } } From e89d5ecfbd29468401541f39921dec1b9c037b39 Mon Sep 17 00:00:00 2001 From: oradchenko Date: Mon, 11 Apr 2016 14:36:00 +0300 Subject: [PATCH 003/345] MAGETWO-51681: Missing Translations in Sales Menu - Added regexp pattern for translate attribute. --- app/code/Magento/Translation/etc/di.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Translation/etc/di.xml b/app/code/Magento/Translation/etc/di.xml index d842a137e99f2..644c835256288 100644 --- a/app/code/Magento/Translation/etc/di.xml +++ b/app/code/Magento/Translation/etc/di.xml @@ -58,6 +58,7 @@ + ~\$\.mage\.__\((['"])(.+?)\1\)~ ~\$t\((["'])(.+?)\1\)~ From d87985ef24aa31a1431993871e725224686666b0 Mon Sep 17 00:00:00 2001 From: Victor Rad Date: Mon, 11 Apr 2016 14:38:46 +0300 Subject: [PATCH 004/345] MAGETWO-51100: Notice: Array to string conversion --- app/code/Magento/Catalog/Model/ProductOptionProcessor.php | 4 ++++ .../Catalog/Test/Unit/Model/ProductOptionProcessorTest.php | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/app/code/Magento/Catalog/Model/ProductOptionProcessor.php b/app/code/Magento/Catalog/Model/ProductOptionProcessor.php index 9f02188008593..0e685a0ea4d13 100644 --- a/app/code/Magento/Catalog/Model/ProductOptionProcessor.php +++ b/app/code/Magento/Catalog/Model/ProductOptionProcessor.php @@ -84,6 +84,10 @@ public function convertToProductOption(DataObject $request) $data = []; foreach ($options as $optionId => $optionValue) { if (is_array($optionValue)) { + $filter = function ($item) { + return !is_array($item); + }; + $optionValue = array_filter($optionValue, $filter); $optionValue = implode(',', $optionValue); } diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductOptionProcessorTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ProductOptionProcessorTest.php index 64f5de19e4cc8..4c9aac8957b98 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductOptionProcessorTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductOptionProcessorTest.php @@ -190,6 +190,13 @@ public function dataProviderConvertToProductOption() ], 'expected' => 'custom_options', ], + [ + 'options' => [ + 1 => 'value', + 2 => [1, 2, [1, 2]], + ], + 'expected' => 'custom_options', + ], [ 'options' => [], 'expected' => null, From 0d2a0f3ecc2478922e4c34db7f8c2c94d26ba254 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Corr=C3=AAa=20Gomes?= Date: Fri, 15 Apr 2016 14:13:42 -0300 Subject: [PATCH 005/345] PHP 7 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b09fa29e03b81..1200b508c76ac 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Use the following table to verify you have the correct prerequisites to install Apache - PHP ~5.5.22 or 5.6.x + PHP ~5.5.22,5.6.x or 7.x php -v PHP Ubuntu
PHP CentOS From 480996c7898d226715ea3b0510d8f90f825fd6da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Corr=C3=AAa=20Gomes?= Date: Mon, 18 Apr 2016 10:07:12 -0300 Subject: [PATCH 006/345] Specific PHP version --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1200b508c76ac..62269ab7713e9 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Use the following table to verify you have the correct prerequisites to install Apache - PHP ~5.5.22,5.6.x or 7.x + PHP ~5.5.22,5.6.x or 7.0.2 – 7.0.4 php -v PHP Ubuntu
PHP CentOS From 8f86ea26a1c70581b70a5921e25d37ebfa8d5566 Mon Sep 17 00:00:00 2001 From: Igor Melnikov Date: Fri, 22 Apr 2016 16:11:44 -0500 Subject: [PATCH 007/345] MAGETWO-51578: Remove Cm_Cache_Backend_File and Cm_Cache_Backend_Redis libraries from the repo and install via composer Removing libraries from the repo and specifying as dependencies --- composer.json | 4 +- lib/internal/Cm/Cache/Backend/File.php | 716 ------------------ lib/internal/Cm/Cache/Backend/Redis.php | 961 ------------------------ 3 files changed, 2 insertions(+), 1679 deletions(-) delete mode 100644 lib/internal/Cm/Cache/Backend/File.php delete mode 100644 lib/internal/Cm/Cache/Backend/Redis.php diff --git a/composer.json b/composer.json index 66b18b17f4234..165edc0c89d7e 100644 --- a/composer.json +++ b/composer.json @@ -34,6 +34,8 @@ "magento/zendframework1": "1.12.16", "colinmollenhour/credis": "1.6", "colinmollenhour/php-redis-session-abstract": "1.1", + "colinmollenhour/cache-backend-redis": "1.8.3", + "colinmollenhour/cache-backend-file": "1.3", "composer/composer": "1.0.0-beta1", "monolog/monolog": "1.16.0", "oyejorge/less.php": "1.7.0.3", @@ -188,7 +190,6 @@ "magento/language-zh_hans_cn": "100.0.2", "magento/framework": "100.0.2", "trentrichardson/jquery-timepicker-addon": "1.4.3", - "colinmollenhour/cache-backend-redis": "1.8", "components/jquery": "1.11.0", "blueimp/jquery-file-upload": "5.6.14", "components/jqueryui": "1.10.4", @@ -198,7 +199,6 @@ "extra": { "component_paths": { "trentrichardson/jquery-timepicker-addon": "lib/web/jquery/jquery-ui-timepicker-addon.js", - "colinmollenhour/cache-backend-redis": "lib/internal/Cm/Cache/Backend/Redis.php", "components/jquery": [ "lib/web/jquery.js", "lib/web/jquery/jquery.min.js", diff --git a/lib/internal/Cm/Cache/Backend/File.php b/lib/internal/Cm/Cache/Backend/File.php deleted file mode 100644 index ed0707176bbe5..0000000000000 --- a/lib/internal/Cm/Cache/Backend/File.php +++ /dev/null @@ -1,716 +0,0 @@ - null, // Path to cache files - 'file_name_prefix' => 'cm', // Prefix for cache directories created - 'file_locking' => true, // Best to keep enabled - 'read_control' => false, // Use a checksum to detect corrupt data - 'read_control_type' => 'crc32', // If read_control is enabled, which checksum algorithm to use - 'hashed_directory_level' => 2, // How many characters should be used to create sub-directories - 'use_chmod' => FALSE, // Do not use chmod on files and directories (should use umask() to control permissions) - 'directory_mode' => 0770, // Filesystem permissions for created directories (requires use_chmod) - 'file_mode' => 0660, // Filesystem permissions for created files (requires use_chmod) - ); - - /** @var bool */ - protected $_isTagDirChecked; - - /** - * @param array $options - */ - public function __construct(array $options = array()) - { - // Backwards compatibility ZF 1.11 and ZF 1.12 - if (isset($options['hashed_directory_umask'])) { - $options['directory_mode'] = $options['hashed_directory_umask']; - } - if (isset($options['cache_file_umask'])) { - $options['file_mode'] = $options['cache_file_umask']; - } - - // Don't use parent constructor - while (list($name, $value) = each($options)) { - $this->setOption($name, $value); - } - - // Check cache dir - if ($this->_options['cache_dir'] !== null) { // particular case for this option - $this->setCacheDir($this->_options['cache_dir']); - } else { - $this->setCacheDir(self::getTmpDir() . DIRECTORY_SEPARATOR, false); - } - - // Validate prefix - if (isset($this->_options['file_name_prefix'])) { // particular case for this option - if (!preg_match('~^[a-zA-Z0-9_]+$~D', $this->_options['file_name_prefix'])) { - Zend_Cache::throwException('Invalid file_name_prefix : must use only [a-zA-Z0-9_]'); - } - } - - // See #ZF-4422 - if (is_string($this->_options['directory_mode'])) { - $this->_options['directory_mode'] = octdec($this->_options['directory_mode']); - } - if (is_string($this->_options['file_mode'])) { - $this->_options['file_mode'] = octdec($this->_options['file_mode']); - } - $this->_options['hashed_directory_umask'] = $this->_options['directory_mode']; - $this->_options['cache_file_umask'] = $this->_options['file_mode']; - } - - /** - * Test if a cache is available for the given id and (if yes) return it (false else) - * - * @param string $id cache id - * @param boolean $doNotTestCacheValidity if set to true, the cache validity won't be tested - * @return string|bool cached datas - */ - public function load($id, $doNotTestCacheValidity = false) - { - $file = $this->_file($id); - $cache = $this->_getCache($file, true); - if ( ! $cache) { - return false; - } - list($metadatas, $data) = $cache; - if ( ! $doNotTestCacheValidity && (time() > $metadatas['expire'])) { - // ?? $this->remove($id); - return false; - } - if ($this->_options['read_control']) { - $hashData = $this->_hash($data, $this->_options['read_control_type']); - $hashControl = $metadatas['hash']; - if ($hashData != $hashControl) { - // Problem detected by the read control ! - $this->_log('Zend_Cache_Backend_File::load() / read_control : stored hash and computed hash do not match'); - $this->remove($id); - return false; - } - } - return $data; - } - - /** - * Save some string datas into a cache record - * - * Note : $data is always "string" (serialization is done by the - * core not by the backend) - * - * @param string $data Datas to cache - * @param string $id Cache id - * @param array $tags Array of strings, the cache record will be tagged by each string entry - * @param bool|int $specificLifetime If != false, set a specific lifetime for this cache record (null => infinite lifetime) - * @return boolean true if no problem - */ - public function save($data, $id, $tags = array(), $specificLifetime = false) - { - $file = $this->_file($id); - $path = $this->_path($id); - if ($this->_options['hashed_directory_level'] > 0) { - if (!is_writable($path)) { - // maybe, we just have to build the directory structure - $this->_recursiveMkdirAndChmod($id); - } - if (!is_writable($path)) { - return false; - } - } - if ($this->_options['read_control']) { - $hash = $this->_hash($data, $this->_options['read_control_type']); - } else { - $hash = ''; - } - $metadatas = array( - 'hash' => $hash, - 'mtime' => time(), - 'expire' => $this->_expireTime($this->getLifetime($specificLifetime)), - 'tags' => implode(',', $tags), - ); - $res = $this->_filePutContents($file, serialize($metadatas)."\n".$data); - $res = $res && $this->_updateIdsTags(array($id), $tags, 'merge'); - return $res; - } - - /** - * Remove a cache record - * - * @param string $id cache id - * @return boolean true if no problem - */ - public function remove($id) - { - $file = $this->_file($id); - $metadatas = $this->_getCache($file, false); - if ($metadatas) { - $boolRemove = $this->_remove($file); - $boolTags = $this->_updateIdsTags(array($id), explode(',', $metadatas['tags']), 'diff'); - return $boolRemove && $boolTags; - } - return false; - } - - /** - * Clean some cache records - * - * Available modes are : - * 'all' (default) => remove all cache entries ($tags is not used) - * 'old' => remove too old cache entries ($tags is not used) - * 'matchingTag' => remove cache entries matching all given tags - * ($tags can be an array of strings or a single string) - * 'notMatchingTag' => remove cache entries not matching one of the given tags - * ($tags can be an array of strings or a single string) - * 'matchingAnyTag' => remove cache entries matching any given tags - * ($tags can be an array of strings or a single string) - * - * @param string $mode - * @param array $tags - * @return boolean true if no problem - */ - public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array()) - { - // We use this protected method to hide the recursive stuff - clearstatcache(); - switch($mode) { - case Zend_Cache::CLEANING_MODE_ALL: - case Zend_Cache::CLEANING_MODE_OLD: - return $this->_clean($this->_options['cache_dir'], $mode); - default: - return $this->_cleanNew($mode, $tags); - } - } - - /** - * Return an array of stored tags - * - * @return array array of stored tags (string) - */ - public function getTags() - { - $prefix = $this->_tagFile(''); - $prefixLen = strlen($prefix); - $tags = array(); - foreach (@glob($prefix . '*') as $tagFile) { - $tags[] = substr($tagFile, $prefixLen); - } - return $tags; - } - - /** - * Return an array of stored cache ids which match given tags - * - * In case of multiple tags, a logical AND is made between tags - * - * @param array $tags array of tags - * @return array array of matching cache ids (string) - */ - public function getIdsMatchingTags($tags = array()) - { - return $this->_getIdsByTags(Zend_Cache::CLEANING_MODE_MATCHING_TAG, $tags); - } - - /** - * Return an array of stored cache ids which don't match given tags - * - * In case of multiple tags, a logical OR is made between tags - * - * @param array $tags array of tags - * @return array array of not matching cache ids (string) - */ - public function getIdsNotMatchingTags($tags = array()) - { - return $this->_getIdsByTags(Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG, $tags); - } - - /** - * Return an array of stored cache ids which match any given tags - * - * In case of multiple tags, a logical AND is made between tags - * - * @param array $tags array of tags - * @return array array of any matching cache ids (string) - */ - public function getIdsMatchingAnyTags($tags = array()) - { - return $this->_getIdsByTags(Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG, $tags); - } - - /** - * Return an array of metadatas for the given cache id - * - * The array must include these keys : - * - expire : the expire timestamp - * - tags : a string array of tags - * - mtime : timestamp of last modification time - * - * @param string $id cache id - * @return array array of metadatas (false if the cache id is not found) - */ - public function getMetadatas($id) - { - $metadatas = $this->_getCache($this->_file($id), false); - if ($metadatas) { - $metadatas['tags'] = explode(',' ,$metadatas['tags']); - } - return $metadatas; - } - - /** - * Give (if possible) an extra lifetime to the given cache id - * - * @param string $id cache id - * @param int $extraLifetime - * @return boolean true if ok - */ - public function touch($id, $extraLifetime) - { - $file = $this->_file($id); - $cache = $this->_getCache($file, true); - if (!$cache) { - return false; - } - list($metadatas, $data) = $cache; - if (time() > $metadatas['expire']) { - return false; - } - $newMetadatas = array( - 'hash' => $metadatas['hash'], - 'mtime' => time(), - 'expire' => $metadatas['expire'] + $extraLifetime, - 'tags' => $metadatas['tags'] - ); - return !! $this->_filePutContents($file, serialize($newMetadatas)."\n".$data); - } - - /** - * Get a metadatas record and optionally the data as well - * - * @param string $file Cache file - * @param bool $withData - * @return array|bool - */ - protected function _getCache($file, $withData) - { - if (!is_file($file) || ! ($fd = @fopen($file, 'rb'))) { - return false; - } - if ($this->_options['file_locking']) flock($fd, LOCK_SH); - $metadata = fgets($fd); - if ( ! $metadata) { - if ($this->_options['file_locking']) flock($fd, LOCK_UN); - fclose($fd); - return false; - } - if ($withData) { - $data = stream_get_contents($fd); - } - if ($this->_options['file_locking']) flock($fd, LOCK_UN); - fclose($fd); - $metadata = @unserialize(rtrim($metadata,"\n")); - if ($withData) { - return array($metadata, $data); - } - return $metadata; - } - - /** - * Get meta data from a cache record - * - * @param string $id Cache id - * @return array|bool Associative array of meta data - */ - protected function _getMetadatas($id) - { - return $this->_getCache($this->_file($id), false); - } - - /** - * Set a metadatas record - * - * @param string $id Cache id - * @param array $metadatas Associative array of metadatas - * @param boolean $save optional pass false to disable saving to file - * @return boolean True if no problem - */ - protected function _setMetadatas($id, $metadatas, $save = true) - { - // TODO - implement for unit tests ___expire method - return true; - } - - /** - * Return the complete directory path of a filename (including hashedDirectoryStructure) - * - * Uses multiple letters for a single-level hash rather than multiple levels - * - * @param string $id Cache id - * @param boolean $parts if true, returns array of directory parts instead of single string - * @return string|array Complete directory path - */ - protected function _path($id, $parts = false) - { - $partsArray = array(); - $root = $this->_options['cache_dir']; - $prefix = $this->_options['file_name_prefix']; - if ($this->_options['hashed_directory_level']>0) { - $hash = hash('adler32', $id); - $root = $root . $prefix . '--' . substr($hash, -$this->_options['hashed_directory_level']) . DIRECTORY_SEPARATOR; - $partsArray[] = $root; - } - if ($parts) { - return $partsArray; - } else { - return $root; - } - } - - /** - * Clean some cache records (protected method used for recursive stuff) - * - * Available modes are : - * Zend_Cache::CLEANING_MODE_ALL (default) => remove all cache entries ($tags is not used) - * Zend_Cache::CLEANING_MODE_OLD => remove too old cache entries ($tags is not used) - * Zend_Cache::CLEANING_MODE_MATCHING_TAG => remove cache entries matching all given tags - * ($tags can be an array of strings or a single string) - * Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG => remove cache entries not {matching one of the given tags} - * ($tags can be an array of strings or a single string) - * Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG => remove cache entries matching any given tags - * ($tags can be an array of strings or a single string) - * - * @param string $dir Directory to clean - * @param string $mode Clean mode - * @param array $tags - * @throws Zend_Cache_Exception - * @return boolean True if no problem - */ - protected function _clean($dir, $mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array()) - { - if (!is_dir($dir)) { - return false; - } - $result = true; - $glob = @glob($dir . $this->_options['file_name_prefix'] . '--*'); - if ($glob === false) { - return true; - } - foreach ($glob as $file) { - if (is_file($file)) { - if ($mode == Zend_Cache::CLEANING_MODE_ALL) { - $result = @unlink($file) && $result; - continue; - } - - $id = $this->_fileNameToId(basename($file)); - $_file = $this->_file($id); - if ($file != $_file) { - @unlink($file); - continue; - } - $metadatas = $this->_getCache($file, false); - if ( ! $metadatas) { - @unlink($file); - continue; - } - if ($mode == Zend_Cache::CLEANING_MODE_OLD) { - if (time() > $metadatas['expire']) { - $result = $this->_remove($file) && $result; - $result = $this->_updateIdsTags(array($id), explode(',', $metadatas['tags']), 'diff') && $result; - } - continue; - } else { - Zend_Cache::throwException('Invalid mode for clean() method.'); - } - } - if ((is_dir($file)) and ($this->_options['hashed_directory_level']>0)) { - // Recursive call - $result = $this->_clean($file . DIRECTORY_SEPARATOR, $mode) && $result; - if ($mode == 'all') { - // if mode=='all', we try to drop the structure too - @rmdir($file); - } - } - } - if ($mode == 'all') { - foreach (glob($this->_tagFile('*')) as $tagFile) { - @unlink($tagFile); - } - } - return $result; - } - - /** - * Clean some cache records (protected method used for recursive stuff) - * - * Available modes are : - * Zend_Cache::CLEANING_MODE_ALL (default) => remove all cache entries ($tags is not used) - * Zend_Cache::CLEANING_MODE_OLD => remove too old cache entries ($tags is not used) - * Zend_Cache::CLEANING_MODE_MATCHING_TAG => remove cache entries matching all given tags - * ($tags can be an array of strings or a single string) - * Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG => remove cache entries not {matching one of the given tags} - * ($tags can be an array of strings or a single string) - * Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG => remove cache entries matching any given tags - * ($tags can be an array of strings or a single string) - * - * @param string $mode Clean mode - * @param array $tags Array of tags - * @throws Zend_Cache_Exception - * @return boolean True if no problem - */ - protected function _cleanNew($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array()) - { - $result = true; - $ids = $this->_getIdsByTags($mode, $tags); - foreach ($ids as $id) { - $idFile = $this->_file($id); - if (is_file($idFile)) { - $result = $result && $this->_remove($idFile); - } - } - switch($mode) - { - case Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG: - foreach ($tags as $tag) { - $tagFile = $this->_tagFile($tag); - if (is_file($tagFile)) { - $result = $result && $this->_remove($tagFile); - } - } - break; - case Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG: - case Zend_Cache::CLEANING_MODE_MATCHING_TAG: - $this->_updateIdsTags($ids, $tags, 'diff'); - break; - } - return $result; - } - - /** - * @param string $mode - * @param array $tags - * @return array - */ - protected function _getIdsByTags($mode, $tags) - { - $ids = array(); - switch($mode) { - case Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG: - $ids = $this->getIds(); - if ($tags) { - foreach ($tags as $tag) { - if ( ! $ids) { - break; // early termination optimization - } - $ids = array_diff($ids, $this->_getTagIds($tag)); - } - } - break; - case Zend_Cache::CLEANING_MODE_MATCHING_TAG: - if ($tags) { - $tag = array_shift($tags); - $ids = $this->_getTagIds($tag); - foreach ($tags as $tag) { - if ( ! $ids) { - break; // early termination optimization - } - $ids = array_intersect($ids, $this->_getTagIds($tag)); - } - $ids = array_unique($ids); - } - break; - case Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG: - foreach ($tags as $tag) { - $ids = array_merge($ids,$this->_getTagIds($tag)); - } - $ids = array_unique($ids); - break; - } - return $ids; - } - - /** - * Make and return a file name (with path) - * - * @param string $id Cache id - * @return string File name (with path) - */ - protected function _tagFile($id) - { - $path = $this->_tagPath(); - $fileName = $this->_idToFileName($id); - return $path . $fileName; - } - - /** - * Return the complete directory path where tags are stored - * - * @return string Complete directory path - */ - protected function _tagPath() - { - $path = $this->_options['cache_dir'] . DIRECTORY_SEPARATOR . $this->_options['file_name_prefix']. '-tags' . DIRECTORY_SEPARATOR; - if ( ! $this->_isTagDirChecked) { - if ( ! is_dir($path)) { - if (@mkdir($path, $this->_options['use_chmod'] ? $this->_options['directory_mode'] : 0777) && $this->_options['use_chmod']) { - @chmod($path, $this->_options['directory_mode']); // see #ZF-320 (this line is required in some configurations) - } - } - $this->_isTagDirChecked = true; - } - return $path; - } - - /** - * @param string|resource $tag - * @return array - */ - protected function _getTagIds($tag) - { - if (is_resource($tag)) { - $ids = stream_get_contents($tag); - } else { - $ids = @file_get_contents($this->_tagFile($tag)); - } - if( ! $ids) { - return array(); - } - $ids = trim(substr($ids, 0, strrpos($ids, "\n"))); - return $ids ? explode("\n", $ids) : array(); - } - - /** - * @param array $ids - * @param array $tags - * @param string $mode - * @return bool - */ - protected function _updateIdsTags($ids, $tags, $mode) - { - $result = true; - foreach($tags as $tag) { - $file = $this->_tagFile($tag); - if (file_exists($file)) { - /* - * Next code is commented because it's produce bug - * Bug about removing cache ids but in some case cache ids is empty, but related tags is removed - */ -// if ( ! $ids && $mode == 'diff') { -// $result = $this->_remove($file); -// } - if ($mode == 'diff' || (rand(1,100) == 1 && filesize($file) > 4096)) { - $file = $this->_tagFile($tag); - if ( ! ($fd = fopen($file, 'rb+'))) { - $result = false; - continue; - } - if ($this->_options['file_locking']) flock($fd, LOCK_EX); - if ($mode == 'diff') { - $_ids = array_diff($this->_getTagIds($fd), $ids); - } else { // if ($mode == 'merge') - $_ids = array_merge($this->_getTagIds($fd), $ids); - } - fseek($fd, 0); - ftruncate($fd, 0); - $result = fwrite($fd, implode("\n", array_unique($_ids))."\n") && $result; - if ($this->_options['file_locking']) flock($fd, LOCK_UN); - fclose($fd); - } - else { - $result = file_put_contents($file, implode("\n", $ids)."\n", FILE_APPEND | ($this->_options['file_locking'] ? LOCK_EX : 0)) && $result; - } - } else if ($mode == 'merge') { - $result = $this->_filePutContents($file, implode("\n", $ids)."\n") && $result; - } - } - return $result; - } - - /** - * Put the given string into the given file - * - * @param string $file File complete path - * @param string $string String to put in file - * @return boolean true if no problem - */ - protected function _filePutContents($file, $string) - { - $result = @file_put_contents($file, $string, $this->_options['file_locking'] ? LOCK_EX : 0); - if ($result && $this->_options['use_chmod']) { - @chmod($file, $this->_options['file_mode']); - } - return $result; - } - - /** - * Make the directory structure for the given id - * - * @param string $id cache id - * @return boolean true - */ - protected function _recursiveMkdirAndChmod($id) - { - if ($this->_options['hashed_directory_level'] <=0) { - return true; - } - $partsArray = $this->_path($id, true); - foreach ($partsArray as $part) { - if (!is_dir($part)) { - @mkdir($part, $this->_options['use_chmod'] ? $this->_options['directory_mode'] : 0777); - if ($this->_options['use_chmod']) { - @chmod($part, $this->_options['directory_mode']); // see #ZF-320 (this line is required in some configurations) - } - } - } - return true; - } - - /** - * For unit testing only - * @param $id - */ - public function ___expire($id) - { - $metadata = $this->_getMetadatas($id); - $this->touch($id, 1 - $metadata['expire']); - } - -} diff --git a/lib/internal/Cm/Cache/Backend/Redis.php b/lib/internal/Cm/Cache/Backend/Redis.php deleted file mode 100644 index 08349361c358b..0000000000000 --- a/lib/internal/Cm/Cache/Backend/Redis.php +++ /dev/null @@ -1,961 +0,0 @@ -_redis = new Credis_Client($options['server'], $port, $timeout, $persistent); - - if ( isset($options['force_standalone']) && $options['force_standalone']) { - $this->_redis->forceStandalone(); - } - - $connectRetries = isset($options['connect_retries']) ? (int)$options['connect_retries'] : self::DEFAULT_CONNECT_RETRIES; - $this->_redis->setMaxConnectRetries($connectRetries); - - if ( ! empty($options['read_timeout']) && $options['read_timeout'] > 0) { - $this->_redis->setReadTimeout((float) $options['read_timeout']); - } - - if ( ! empty($options['password'])) { - $this->_redis->auth($options['password']) or Zend_Cache::throwException('Unable to authenticate with the redis server.'); - } - - // Always select database on startup in case persistent connection is re-used by other code - if (empty($options['database'])) { - $options['database'] = 0; - } - $this->_redis->select( (int) $options['database']) or Zend_Cache::throwException('The redis database could not be selected.'); - - if ( isset($options['notMatchingTags']) ) { - $this->_notMatchingTags = (bool) $options['notMatchingTags']; - } - - if ( isset($options['compress_tags'])) { - $this->_compressTags = (int) $options['compress_tags']; - } - - if ( isset($options['compress_data'])) { - $this->_compressData = (int) $options['compress_data']; - } - - if ( isset($options['lifetimelimit'])) { - $this->_lifetimelimit = (int) min($options['lifetimelimit'], self::MAX_LIFETIME); - } - - if ( isset($options['compress_threshold'])) { - $this->_compressThreshold = (int) $options['compress_threshold']; - } - - if ( isset($options['automatic_cleaning_factor']) ) { - $this->_options['automatic_cleaning_factor'] = (int) $options['automatic_cleaning_factor']; - } else { - $this->_options['automatic_cleaning_factor'] = 0; - } - - if ( isset($options['compression_lib']) ) { - $this->_compressionLib = (string) $options['compression_lib']; - } - else if ( function_exists('snappy_compress') ) { - $this->_compressionLib = 'snappy'; - } - else if ( function_exists('lz4_compress')) { - $this->_compressionLib = 'l4z'; - } - else if ( function_exists('lzf_compress') ) { - $this->_compressionLib = 'lzf'; - } - else { - $this->_compressionLib = 'gzip'; - } - $this->_compressPrefix = substr($this->_compressionLib,0,2).self::COMPRESS_PREFIX; - - if ( isset($options['sunion_chunk_size']) && $options['sunion_chunk_size'] > 0) { - $this->_sunionChunkSize = (int) $options['sunion_chunk_size']; - } - - if (isset($options['use_lua'])) { - $this->_useLua = (bool) $options['use_lua']; - } - - if (isset($options['lua_max_c_stack'])) { - $this->_luaMaxCStack = (int) $options['lua_max_c_stack']; - } - } - - /** - * Load value with given id from cache - * - * @param string $id Cache id - * @param boolean $doNotTestCacheValidity If set to true, the cache validity won't be tested - * @return bool|string - */ - public function load($id, $doNotTestCacheValidity = false) - { - $data = $this->_redis->hGet(self::PREFIX_KEY.$id, self::FIELD_DATA); - if ($data === NULL) { - return FALSE; - } - return $this->_decodeData($data); - } - - /** - * Test if a cache is available or not (for the given id) - * - * @param string $id Cache id - * @return bool|int False if record is not available or "last modified" timestamp of the available cache record - */ - public function test($id) - { - $mtime = $this->_redis->hGet(self::PREFIX_KEY.$id, self::FIELD_MTIME); - return ($mtime ? $mtime : FALSE); - } - - /** - * Save some string datas into a cache record - * - * Note : $data is always "string" (serialization is done by the - * core not by the backend) - * - * @param string $data Datas to cache - * @param string $id Cache id - * @param array $tags Array of strings, the cache record will be tagged by each string entry - * @param bool|int $specificLifetime If != false, set a specific lifetime for this cache record (null => infinite lifetime) - * @throws CredisException - * @return boolean True if no problem - */ - public function save($data, $id, $tags = array(), $specificLifetime = false) - { - if(!is_array($tags)) - $tags = $tags ? array($tags) : array(); - else - $tags = array_flip(array_flip($tags)); - - $lifetime = $this->getLifetime($specificLifetime); - - if ($this->_useLua) { - $sArgs = array( - self::PREFIX_KEY, - self::FIELD_DATA, - self::FIELD_TAGS, - self::FIELD_MTIME, - self::FIELD_INF, - self::SET_TAGS, - self::PREFIX_TAG_IDS, - self::SET_IDS, - $id, - $this->_encodeData($data, $this->_compressData), - $this->_encodeData(implode(',',$tags), $this->_compressTags), - time(), - $lifetime ? 0 : 1, - min($lifetime, self::MAX_LIFETIME), - $this->_notMatchingTags ? 1 : 0 - ); - - $res = $this->_redis->evalSha(self::LUA_SAVE_SH1, $tags, $sArgs); - if (is_null($res)) { - $script = - "local oldTags = redis.call('HGET', ARGV[1]..ARGV[9], ARGV[3]) ". - "redis.call('HMSET', ARGV[1]..ARGV[9], ARGV[2], ARGV[10], ARGV[3], ARGV[11], ARGV[4], ARGV[12], ARGV[5], ARGV[13]) ". - "if (ARGV[13] == '0') then ". - "redis.call('EXPIRE', ARGV[1]..ARGV[9], ARGV[14]) ". - "end ". - "if next(KEYS) ~= nil then ". - "redis.call('SADD', ARGV[6], unpack(KEYS)) ". - "for _, tagname in ipairs(KEYS) do ". - "redis.call('SADD', ARGV[7]..tagname, ARGV[9]) ". - "end ". - "end ". - "if (ARGV[15] == '1') then ". - "redis.call('SADD', ARGV[8], ARGV[9]) ". - "end ". - "if (oldTags ~= false) then ". - "return oldTags ". - "else ". - "return '' ". - "end"; - $res = $this->_redis->eval($script, $tags, $sArgs); - } - - // Process removed tags if cache entry already existed - if ($res) { - $oldTags = explode(',', $this->_decodeData($res)); - if ($remTags = ($oldTags ? array_diff($oldTags, $tags) : FALSE)) - { - // Update the id list for each tag - foreach($remTags as $tag) - { - $this->_redis->sRem(self::PREFIX_TAG_IDS . $tag, $id); - } - } - } - - return TRUE; - } - - // Get list of tags previously assigned - $oldTags = $this->_decodeData($this->_redis->hGet(self::PREFIX_KEY.$id, self::FIELD_TAGS)); - $oldTags = $oldTags ? explode(',', $oldTags) : array(); - - $this->_redis->pipeline()->multi(); - - // Set the data - $result = $this->_redis->hMSet(self::PREFIX_KEY.$id, array( - self::FIELD_DATA => $this->_encodeData($data, $this->_compressData), - self::FIELD_TAGS => $this->_encodeData(implode(',',$tags), $this->_compressTags), - self::FIELD_MTIME => time(), - self::FIELD_INF => $lifetime ? 0 : 1, - )); - if( ! $result) { - throw new CredisException("Could not set cache key $id"); - } - - // Set expiration if specified - if ($lifetime) { - $this->_redis->expire(self::PREFIX_KEY.$id, min($lifetime, self::MAX_LIFETIME)); - } - - // Process added tags - if ($tags) - { - // Update the list with all the tags - $this->_redis->sAdd( self::SET_TAGS, $tags); - - // Update the id list for each tag - foreach($tags as $tag) - { - $this->_redis->sAdd(self::PREFIX_TAG_IDS . $tag, $id); - } - } - - // Process removed tags - if ($remTags = ($oldTags ? array_diff($oldTags, $tags) : FALSE)) - { - // Update the id list for each tag - foreach($remTags as $tag) - { - $this->_redis->sRem(self::PREFIX_TAG_IDS . $tag, $id); - } - } - - // Update the list with all the ids - if($this->_notMatchingTags) { - $this->_redis->sAdd(self::SET_IDS, $id); - } - - $this->_redis->exec(); - - return TRUE; - } - - /** - * Remove a cache record - * - * @param string $id Cache id - * @return boolean True if no problem - */ - public function remove($id) - { - // Get list of tags for this id - $tags = explode(',', $this->_decodeData($this->_redis->hGet(self::PREFIX_KEY.$id, self::FIELD_TAGS))); - - $this->_redis->pipeline()->multi(); - - // Remove data - $this->_redis->del(self::PREFIX_KEY.$id); - - // Remove id from list of all ids - if($this->_notMatchingTags) { - $this->_redis->sRem( self::SET_IDS, $id ); - } - - // Update the id list for each tag - foreach($tags as $tag) { - $this->_redis->sRem(self::PREFIX_TAG_IDS . $tag, $id); - } - - $result = $this->_redis->exec(); - - return (bool) $result[0]; - } - - /** - * @param array $tags - */ - protected function _removeByNotMatchingTags($tags) - { - $ids = $this->getIdsNotMatchingTags($tags); - if($ids) - { - $this->_redis->pipeline()->multi(); - - // Remove data - $this->_redis->del( $this->_preprocessIds($ids)); - - // Remove ids from list of all ids - if($this->_notMatchingTags) { - $this->_redis->sRem( self::SET_IDS, $ids); - } - - $this->_redis->exec(); - } - } - - /** - * @param array $tags - */ - protected function _removeByMatchingTags($tags) - { - $ids = $this->getIdsMatchingTags($tags); - if($ids) - { - $this->_redis->pipeline()->multi(); - - // Remove data - $this->_redis->del( $this->_preprocessIds($ids)); - - // Remove ids from list of all ids - if($this->_notMatchingTags) { - $this->_redis->sRem( self::SET_IDS, $ids); - } - - $this->_redis->exec(); - } - } - - /** - * @param array $tags - */ - protected function _removeByMatchingAnyTags($tags) - { - if ($this->_useLua) { - $tags = array_chunk($tags, $this->_sunionChunkSize); - foreach ($tags as $chunk) { - $chunk = $this->_preprocessTagIds($chunk); - $args = array(self::PREFIX_KEY, self::SET_TAGS, self::SET_IDS, ($this->_notMatchingTags ? 1 : 0), (int) $this->_luaMaxCStack); - if ( ! $this->_redis->evalSha(self::LUA_CLEAN_SH1, $chunk, $args)) { - $script = - "for i = 1, #KEYS, ARGV[5] do ". - "local keysToDel = redis.call('SUNION', unpack(KEYS, i, math.min(#KEYS, i + ARGV[5] - 1))) ". - "for _, keyname in ipairs(keysToDel) do ". - "redis.call('DEL', ARGV[1]..keyname) ". - "if (ARGV[4] == '1') then ". - "redis.call('SREM', ARGV[3], keyname) ". - "end ". - "end ". - "redis.call('DEL', unpack(KEYS, i, math.min(#KEYS, i + ARGV[5] - 1))) ". - "redis.call('SREM', ARGV[2], unpack(KEYS, i, math.min(#KEYS, i + ARGV[5] - 1))) ". - "end ". - "return true"; - $this->_redis->eval($script, $chunk, $args); - } - } - return; - } - - $ids = $this->getIdsMatchingAnyTags($tags); - - $this->_redis->pipeline()->multi(); - - if($ids) - { - // Remove data - $this->_redis->del( $this->_preprocessIds($ids)); - - // Remove ids from list of all ids - if($this->_notMatchingTags) { - $this->_redis->sRem( self::SET_IDS, $ids); - } - } - - // Remove tag id lists - $this->_redis->del( $this->_preprocessTagIds($tags)); - - // Remove tags from list of tags - $this->_redis->sRem( self::SET_TAGS, $tags); - - $this->_redis->exec(); - } - - /** - * Clean up tag id lists since as keys expire the ids remain in the tag id lists - */ - protected function _collectGarbage() - { - // Clean up expired keys from tag id set and global id set - - if ($this->_useLua) { - $sArgs = array(self::PREFIX_KEY, self::SET_TAGS, self::SET_IDS, self::PREFIX_TAG_IDS, ($this->_notMatchingTags ? 1 : 0)); - $allTags = (array) $this->_redis->sMembers(self::SET_TAGS); - $tagsCount = count($allTags); - $counter = 0; - $tagsBatch = array(); - foreach ($allTags as $tag) { - $tagsBatch[] = $tag; - $counter++; - if (count($tagsBatch) == 10 || $counter == $tagsCount ) { - if ( ! $this->_redis->evalSha(self::LUA_GC_SH1, $tagsBatch, $sArgs)) { - $script = - "local tagKeys = {} ". - "local expired = {} ". - "local expiredCount = 0 ". - "local notExpiredCount = 0 ". - "for _, tagName in ipairs(KEYS) do ". - "tagKeys = redis.call('SMEMBERS', ARGV[4]..tagName) ". - "for __, keyName in ipairs(tagKeys) do ". - "if (redis.call('EXISTS', ARGV[1]..keyName) == 0) then ". - "expiredCount = expiredCount + 1 ". - "expired[expiredCount] = keyName ". - /* Redis Lua scripts have a hard limit of 8000 parameters per command */ - "if (expiredCount == 7990) then ". - "redis.call('SREM', ARGV[4]..tagName, unpack(expired)) ". - "if (ARGV[5] == '1') then ". - "redis.call('SREM', ARGV[3], unpack(expired)) ". - "end ". - "expiredCount = 0 ". - "expired = {} ". - "end ". - "else ". - "notExpiredCount = notExpiredCount + 1 ". - "end ". - "end ". - "if (expiredCount > 0) then ". - "redis.call('SREM', ARGV[4]..tagName, unpack(expired)) ". - "if (ARGV[5] == '1') then ". - "redis.call('SREM', ARGV[3], unpack(expired)) ". - "end ". - "end ". - "if (notExpiredCount == 0) then ". - "redis.call ('DEL', ARGV[4]..tagName) ". - "redis.call ('SREM', ARGV[2], tagName) ". - "end ". - "expired = {} ". - "expiredCount = 0 ". - "notExpiredCount = 0 ". - "end ". - "return true"; - $this->_redis->eval($script, $tagsBatch, $sArgs); - } - $tagsBatch = array(); - /* Give Redis some time to handle other requests */ - usleep(20000); - } - } - return; - } - - $exists = array(); - $tags = (array) $this->_redis->sMembers(self::SET_TAGS); - foreach($tags as $tag) - { - // Get list of expired ids for each tag - $tagMembers = $this->_redis->sMembers(self::PREFIX_TAG_IDS . $tag); - $numTagMembers = count($tagMembers); - $expired = array(); - $numExpired = $numNotExpired = 0; - if($numTagMembers) { - while ($id = array_pop($tagMembers)) { - if( ! isset($exists[$id])) { - $exists[$id] = $this->_redis->exists(self::PREFIX_KEY.$id); - } - if ($exists[$id]) { - $numNotExpired++; - } - else { - $numExpired++; - $expired[] = $id; - - // Remove incrementally to reduce memory usage - if (count($expired) % 100 == 0 && $numNotExpired > 0) { - $this->_redis->sRem( self::PREFIX_TAG_IDS . $tag, $expired); - if($this->_notMatchingTags) { // Clean up expired ids from ids set - $this->_redis->sRem( self::SET_IDS, $expired); - } - $expired = array(); - } - } - } - if( ! count($expired)) continue; - } - - // Remove empty tags or completely expired tags - if ($numExpired == $numTagMembers) { - $this->_redis->del(self::PREFIX_TAG_IDS . $tag); - $this->_redis->sRem(self::SET_TAGS, $tag); - } - // Clean up expired ids from tag ids set - else if (count($expired)) { - $this->_redis->sRem( self::PREFIX_TAG_IDS . $tag, $expired); - if($this->_notMatchingTags) { // Clean up expired ids from ids set - $this->_redis->sRem( self::SET_IDS, $expired); - } - } - unset($expired); - } - - // Clean up global list of ids for ids with no tag - if($this->_notMatchingTags) { - // TODO - } - } - - /** - * Clean some cache records - * - * Available modes are : - * 'all' (default) => remove all cache entries ($tags is not used) - * 'old' => runs _collectGarbage() - * 'matchingTag' => supported - * 'notMatchingTag' => supported - * 'matchingAnyTag' => supported - * - * @param string $mode Clean mode - * @param array $tags Array of tags - * @throws Zend_Cache_Exception - * @return boolean True if no problem - */ - public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array()) - { - if( $tags && ! is_array($tags)) { - $tags = array($tags); - } - - try { - if ($mode == Zend_Cache::CLEANING_MODE_ALL) { - return $this->_redis->flushDb(); - } - if ($mode == Zend_Cache::CLEANING_MODE_OLD) { - $this->_collectGarbage(); - return TRUE; - } - if ( ! count($tags)) { - return TRUE; - } - switch ($mode) - { - case Zend_Cache::CLEANING_MODE_MATCHING_TAG: - - $this->_removeByMatchingTags($tags); - break; - - case Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG: - - $this->_removeByNotMatchingTags($tags); - break; - - case Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG: - - $this->_removeByMatchingAnyTags($tags); - break; - - default: - Zend_Cache::throwException('Invalid mode for clean() method: '.$mode); - } - } catch (CredisException $e) { - Zend_Cache::throwException('Error cleaning cache by mode '.$mode.': '.$e->getMessage(), $e); - } - return TRUE; - } - - /** - * Return true if the automatic cleaning is available for the backend - * - * @return boolean - */ - public function isAutomaticCleaningAvailable() - { - return TRUE; - } - - /** - * Set the frontend directives - * - * @param array $directives Assoc of directives - * @throws Zend_Cache_Exception - * @return void - */ - public function setDirectives($directives) - { - parent::setDirectives($directives); - $lifetime = $this->getLifetime(false); - if ($lifetime > self::MAX_LIFETIME) { - Zend_Cache::throwException('Redis backend has a limit of 30 days (2592000 seconds) for the lifetime'); - } - } - - /** - * Return an array of stored cache ids - * - * @return array array of stored cache ids (string) - */ - public function getIds() - { - if($this->_notMatchingTags) { - return (array) $this->_redis->sMembers(self::SET_IDS); - } else { - $keys = $this->_redis->keys(self::PREFIX_KEY . '*'); - $prefixLen = strlen(self::PREFIX_KEY); - foreach($keys as $index => $key) { - $keys[$index] = substr($key, $prefixLen); - } - return $keys; - } - } - - /** - * Return an array of stored tags - * - * @return array array of stored tags (string) - */ - public function getTags() - { - return (array) $this->_redis->sMembers(self::SET_TAGS); - } - - /** - * Return an array of stored cache ids which match given tags - * - * In case of multiple tags, a logical AND is made between tags - * - * @param array $tags array of tags - * @return array array of matching cache ids (string) - */ - public function getIdsMatchingTags($tags = array()) - { - if ($tags) { - return (array) $this->_redis->sInter( $this->_preprocessTagIds($tags) ); - } - return array(); - } - - /** - * Return an array of stored cache ids which don't match given tags - * - * In case of multiple tags, a negated logical AND is made between tags - * - * @param array $tags array of tags - * @return array array of not matching cache ids (string) - */ - public function getIdsNotMatchingTags($tags = array()) - { - if( ! $this->_notMatchingTags) { - Zend_Cache::throwException("notMatchingTags is currently disabled."); - } - if ($tags) { - return (array) $this->_redis->sDiff( self::SET_IDS, $this->_preprocessTagIds($tags) ); - } - return (array) $this->_redis->sMembers( self::SET_IDS ); - } - - /** - * Return an array of stored cache ids which match any given tags - * - * In case of multiple tags, a logical OR is made between tags - * - * @param array $tags array of tags - * @return array array of any matching cache ids (string) - */ - public function getIdsMatchingAnyTags($tags = array()) - { - $result = array(); - if ($tags) { - $chunks = array_chunk($tags, $this->_sunionChunkSize); - foreach ($chunks as $chunk) { - $result = array_merge($result, (array) $this->_redis->sUnion( $this->_preprocessTagIds($chunk))); - } - if (count($chunks) > 1) { - $result = array_unique($result); // since we are chunking requests, we must de-duplicate member names - } - } - return $result; - } - - /** - * Return the filling percentage of the backend storage - * - * @throws Zend_Cache_Exception - * @return int integer between 0 and 100 - */ - public function getFillingPercentage() - { - $maxMem = $this->_redis->config('GET','maxmemory'); - if (0 == (int) $maxMem['maxmemory']) { - return 1; - } - $info = $this->_redis->info(); - return round( - ($info['used_memory']/$maxMem['maxmemory']*100) - ,0 - ,PHP_ROUND_HALF_UP - ); - } - - /** - * Return an array of metadatas for the given cache id - * - * The array must include these keys : - * - expire : the expire timestamp - * - tags : a string array of tags - * - mtime : timestamp of last modification time - * - * @param string $id cache id - * @return array array of metadatas (false if the cache id is not found) - */ - public function getMetadatas($id) - { - list($tags, $mtime, $inf) = $this->_redis->hMGet(self::PREFIX_KEY.$id, array(self::FIELD_TAGS, self::FIELD_MTIME, self::FIELD_INF)); - if( ! $mtime) { - return FALSE; - } - $tags = explode(',', $this->_decodeData($tags)); - $expire = $inf === '1' ? FALSE : time() + $this->_redis->ttl(self::PREFIX_KEY.$id); - - return array( - 'expire' => $expire, - 'tags' => $tags, - 'mtime' => $mtime, - ); - } - - /** - * Give (if possible) an extra lifetime to the given cache id - * - * @param string $id cache id - * @param int $extraLifetime - * @return boolean true if ok - */ - public function touch($id, $extraLifetime) - { - list($inf) = $this->_redis->hGet(self::PREFIX_KEY.$id, self::FIELD_INF); - if ($inf === '0') { - $expireAt = time() + $this->_redis->ttl(self::PREFIX_KEY.$id) + $extraLifetime; - return (bool) $this->_redis->expireAt(self::PREFIX_KEY.$id, $expireAt); - } - return false; - } - - /** - * Return an associative array of capabilities (booleans) of the backend - * - * The array must include these keys : - * - automatic_cleaning (is automating cleaning necessary) - * - tags (are tags supported) - * - expired_read (is it possible to read expired cache records - * (for doNotTestCacheValidity option for example)) - * - priority does the backend deal with priority when saving - * - infinite_lifetime (is infinite lifetime can work with this backend) - * - get_list (is it possible to get the list of cache ids and the complete list of tags) - * - * @return array associative of with capabilities - */ - public function getCapabilities() - { - return array( - 'automatic_cleaning' => ($this->_options['automatic_cleaning_factor'] > 0), - 'tags' => true, - 'expired_read' => false, - 'priority' => false, - 'infinite_lifetime' => true, - 'get_list' => true, - ); - } - - /** - * @param string $data - * @param int $level - * @throws CredisException - * @return string - */ - protected function _encodeData($data, $level) - { - if ($this->_compressionLib && $level && strlen($data) >= $this->_compressThreshold) { - switch($this->_compressionLib) { - case 'snappy': $data = snappy_compress($data); break; - case 'lzf': $data = lzf_compress($data); break; - case 'l4z': $data = lz4_compress($data,($level > 1 ? true : false)); break; - case 'gzip': $data = gzcompress($data, $level); break; - default: throw new CredisException("Unrecognized 'compression_lib'."); - } - if( ! $data) { - throw new CredisException("Could not compress cache data."); - } - return $this->_compressPrefix.$data; - } - return $data; - } - - /** - * @param bool|string $data - * @return string - */ - protected function _decodeData($data) - { - if (substr($data,2,3) == self::COMPRESS_PREFIX) { - switch(substr($data,0,2)) { - case 'sn': return snappy_uncompress(substr($data,5)); - case 'lz': return lzf_decompress(substr($data,5)); - case 'l4': return lz4_uncompress(substr($data,5)); - case 'gz': case 'zc': return gzuncompress(substr($data,5)); - } - } - return $data; - } - - /** - * @param $item - * @param $index - * @param $prefix - */ - protected function _preprocess(&$item, $index, $prefix) - { - $item = $prefix . $item; - } - - /** - * @param $ids - * @return array - */ - protected function _preprocessIds($ids) - { - array_walk($ids, array($this, '_preprocess'), self::PREFIX_KEY); - return $ids; - } - - /** - * @param $tags - * @return array - */ - protected function _preprocessTagIds($tags) - { - array_walk($tags, array($this, '_preprocess'), self::PREFIX_TAG_IDS); - return $tags; - } - - /** - * Required to pass unit tests - * - * @param string $id - * @return void - */ - public function ___expire($id) - { - $this->_redis->del(self::PREFIX_KEY.$id); - } - -} From e849763e14541c06c8a55494cbe2476cf889f6b6 Mon Sep 17 00:00:00 2001 From: Simon Schurter Date: Tue, 26 Apr 2016 01:46:00 -0700 Subject: [PATCH 008/345] Update travis test for registerRefundNotification --- app/code/Magento/Sales/Test/Unit/Model/Order/PaymentTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/PaymentTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/PaymentTest.php index f640e9dfdbb0e..91672161cf326 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/PaymentTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/PaymentTest.php @@ -1339,7 +1339,6 @@ public function testRegisterRefundNotification() ->willReturn($this->creditMemoMock); $this->creditMemoMock->expects($this->once())->method('setPaymentRefundDisallowed')->willReturnSelf(); $this->creditMemoMock->expects($this->once())->method('setAutomaticallyCreated')->willReturnSelf(); - $this->creditMemoMock->expects($this->once())->method('register')->willReturnSelf(); $this->creditMemoMock->expects($this->once())->method('addComment')->willReturnSelf(); $this->creditMemoMock->expects($this->once())->method('save')->willReturnSelf(); $this->orderMock->expects($this->once())->method('getBaseCurrency')->willReturn($this->currencyMock); From 98262b6dabd7f7b4fc53335fc94b5ec71530d7ad Mon Sep 17 00:00:00 2001 From: schurter-cw Date: Tue, 26 Apr 2016 14:38:16 +0200 Subject: [PATCH 009/345] Update PaymentTest.php Fix code style of PaymentTest. --- app/code/Magento/Sales/Test/Unit/Model/Order/PaymentTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/PaymentTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/PaymentTest.php index 91672161cf326..bb120b719a873 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/PaymentTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/PaymentTest.php @@ -20,6 +20,7 @@ class PaymentTest extends \PHPUnit_Framework_TestCase const TRANSACTION_ID = 'ewr34fM49V0'; private $mockContext; + /** * @var Payment */ @@ -858,7 +859,6 @@ public function testUpdateOnlineTransactionApproved() $this->mockInvoice($this->transactionId); $this->mockResultTrueMethods($this->transactionId, $baseGrandTotal, $message); - $this->orderMock->expects($this->once()) ->method('getStoreId') ->willReturn($storeId); From f2393aeec8376291ece8061a71d5d5bfc5cc395a Mon Sep 17 00:00:00 2001 From: Igor Melnikov Date: Tue, 26 Apr 2016 15:15:50 -0500 Subject: [PATCH 010/345] MAGETWO-51578: Remove Cm_Cache_Backend_File and Cm_Cache_Backend_Redis libraries from the repo and install via composer Updating composer.json --- composer.json | 3 +- composer.lock | 88 +++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 77 insertions(+), 14 deletions(-) diff --git a/composer.json b/composer.json index 165edc0c89d7e..25b811df5a8e7 100644 --- a/composer.json +++ b/composer.json @@ -194,7 +194,8 @@ "blueimp/jquery-file-upload": "5.6.14", "components/jqueryui": "1.10.4", "twbs/bootstrap": "3.1.0", - "tinymce/tinymce": "3.4.7" + "tinymce/tinymce": "3.4.7", + "magento-hackathon/magento-composer-installer":"*" }, "extra": { "component_paths": { diff --git a/composer.lock b/composer.lock index f8fed42ded915..b3dc34082d7a6 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "bf2c89e347ccaa2666b266414a3ee2a9", - "content-hash": "89c54eeb2840525b6f8706c940757d51", + "hash": "5f85b22465dcfe3bcfd3880a5a8eeb8c", + "content-hash": "ce60cfdeecf3d6c595b56c4de3dbdf85", "packages": [ { "name": "braintree/braintree_php", @@ -54,6 +54,68 @@ "description": "Braintree PHP Client Library", "time": "2015-11-19 19:14:47" }, + { + "name": "colinmollenhour/cache-backend-file", + "version": "1.3", + "source": { + "type": "git", + "url": "https://github.com/colinmollenhour/Cm_Cache_Backend_File.git", + "reference": "458700fc6925559459e96c184fb44dbbadf00f1d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_File/zipball/458700fc6925559459e96c184fb44dbbadf00f1d", + "reference": "458700fc6925559459e96c184fb44dbbadf00f1d", + "shasum": "" + }, + "require": { + "magento-hackathon/magento-composer-installer": "*" + }, + "type": "magento-module", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Colin Mollenhour" + } + ], + "description": "The stock Zend_Cache_Backend_File backend has extremely poor performance for cleaning by tags making it become unusable as the number of cached items increases. This backend makes many changes resulting in a huge performance boost, especially for tag cleaning.", + "homepage": "https://github.com/colinmollenhour/Cm_Cache_Backend_File", + "time": "2014-08-15 15:50:30" + }, + { + "name": "colinmollenhour/cache-backend-redis", + "version": "1.8.3", + "source": { + "type": "git", + "url": "https://github.com/colinmollenhour/Cm_Cache_Backend_Redis.git", + "reference": "da52aa0c27e9ec72e9b1f1110cfb8a304dea6da8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/zipball/da52aa0c27e9ec72e9b1f1110cfb8a304dea6da8", + "reference": "da52aa0c27e9ec72e9b1f1110cfb8a304dea6da8", + "shasum": "" + }, + "require": { + "magento-hackathon/magento-composer-installer": "*" + }, + "type": "magento-module", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Colin Mollenhour" + } + ], + "description": "Zend_Cache backend using Redis with full support for tags.", + "homepage": "https://github.com/colinmollenhour/Cm_Cache_Backend_Redis", + "time": "2016-03-24 16:02:15" + }, { "name": "colinmollenhour/credis", "version": "1.6", @@ -923,16 +985,16 @@ }, { "name": "seld/cli-prompt", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/Seldaek/cli-prompt.git", - "reference": "b27db1514f7d7bb7a366ad95d4eb2b17140a0691" + "reference": "8cbe10923cae5bcd7c5a713f6703fc4727c8c1b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/cli-prompt/zipball/b27db1514f7d7bb7a366ad95d4eb2b17140a0691", - "reference": "b27db1514f7d7bb7a366ad95d4eb2b17140a0691", + "url": "https://api.github.com/repos/Seldaek/cli-prompt/zipball/8cbe10923cae5bcd7c5a713f6703fc4727c8c1b4", + "reference": "8cbe10923cae5bcd7c5a713f6703fc4727c8c1b4", "shasum": "" }, "require": { @@ -967,7 +1029,7 @@ "input", "prompt" ], - "time": "2016-01-09 17:55:27" + "time": "2016-04-18 09:31:41" }, { "name": "seld/jsonlint", @@ -3185,20 +3247,20 @@ }, { "name": "phpmd/phpmd", - "version": "2.4.2", + "version": "2.4.3", "source": { "type": "git", "url": "https://github.com/phpmd/phpmd.git", - "reference": "fccbdb6b222f6d7a6d35af1c396ba5435cec76a9" + "reference": "2b9c2417a18696dfb578b38c116cd0ddc19b256e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpmd/phpmd/zipball/fccbdb6b222f6d7a6d35af1c396ba5435cec76a9", - "reference": "fccbdb6b222f6d7a6d35af1c396ba5435cec76a9", + "url": "https://api.github.com/repos/phpmd/phpmd/zipball/2b9c2417a18696dfb578b38c116cd0ddc19b256e", + "reference": "2b9c2417a18696dfb578b38c116cd0ddc19b256e", "shasum": "" }, "require": { - "pdepend/pdepend": "~2.0", + "pdepend/pdepend": "^2.0.4", "php": ">=5.3.0" }, "require-dev": { @@ -3246,7 +3308,7 @@ "phpmd", "pmd" ], - "time": "2016-03-10 17:17:44" + "time": "2016-04-04 11:52:04" }, { "name": "phpunit/php-code-coverage", From 75ecb17d4e2b7659db414e620fe3eecfe0c8e008 Mon Sep 17 00:00:00 2001 From: Igor Melnikov Date: Mon, 2 May 2016 22:47:26 -0500 Subject: [PATCH 011/345] MAGETWO-51578: Remove Cm_Cache_Backend_File and Cm_Cache_Backend_Redis libraries from the repo and install via composer Updating dependencies --- composer.json | 4 +-- composer.lock | 94 ++++++++++++++++++++++++++++----------------------- 2 files changed, 54 insertions(+), 44 deletions(-) diff --git a/composer.json b/composer.json index 25b811df5a8e7..8882c76c9e396 100644 --- a/composer.json +++ b/composer.json @@ -34,8 +34,8 @@ "magento/zendframework1": "1.12.16", "colinmollenhour/credis": "1.6", "colinmollenhour/php-redis-session-abstract": "1.1", - "colinmollenhour/cache-backend-redis": "1.8.3", - "colinmollenhour/cache-backend-file": "1.3", + "colinmollenhour/cache-backend-redis": "1.9", + "colinmollenhour/cache-backend-file": "1.4", "composer/composer": "1.0.0-beta1", "monolog/monolog": "1.16.0", "oyejorge/less.php": "1.7.0.3", diff --git a/composer.lock b/composer.lock index b3dc34082d7a6..161827c593270 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "5f85b22465dcfe3bcfd3880a5a8eeb8c", - "content-hash": "ce60cfdeecf3d6c595b56c4de3dbdf85", + "hash": "63fa48d74ba86c780ada92508184b163", + "content-hash": "9358d69e4de27175404328e25a8a5341", "packages": [ { "name": "braintree/braintree_php", @@ -56,22 +56,27 @@ }, { "name": "colinmollenhour/cache-backend-file", - "version": "1.3", + "version": "1.4", "source": { "type": "git", "url": "https://github.com/colinmollenhour/Cm_Cache_Backend_File.git", - "reference": "458700fc6925559459e96c184fb44dbbadf00f1d" + "reference": "51251b80a817790eb624fbe2afc882c14f3c4fb0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_File/zipball/458700fc6925559459e96c184fb44dbbadf00f1d", - "reference": "458700fc6925559459e96c184fb44dbbadf00f1d", + "url": "https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_File/zipball/51251b80a817790eb624fbe2afc882c14f3c4fb0", + "reference": "51251b80a817790eb624fbe2afc882c14f3c4fb0", "shasum": "" }, "require": { "magento-hackathon/magento-composer-installer": "*" }, "type": "magento-module", + "autoload": { + "classmap": [ + "File.php" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" @@ -83,26 +88,31 @@ ], "description": "The stock Zend_Cache_Backend_File backend has extremely poor performance for cleaning by tags making it become unusable as the number of cached items increases. This backend makes many changes resulting in a huge performance boost, especially for tag cleaning.", "homepage": "https://github.com/colinmollenhour/Cm_Cache_Backend_File", - "time": "2014-08-15 15:50:30" + "time": "2016-05-02 16:24:47" }, { "name": "colinmollenhour/cache-backend-redis", - "version": "1.8.3", + "version": "1.9", "source": { "type": "git", "url": "https://github.com/colinmollenhour/Cm_Cache_Backend_Redis.git", - "reference": "da52aa0c27e9ec72e9b1f1110cfb8a304dea6da8" + "reference": "6319714bb3a4fe699c5db0edb887f5e8fe40a6dc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/zipball/da52aa0c27e9ec72e9b1f1110cfb8a304dea6da8", - "reference": "da52aa0c27e9ec72e9b1f1110cfb8a304dea6da8", + "url": "https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_Redis/zipball/6319714bb3a4fe699c5db0edb887f5e8fe40a6dc", + "reference": "6319714bb3a4fe699c5db0edb887f5e8fe40a6dc", "shasum": "" }, "require": { "magento-hackathon/magento-composer-installer": "*" }, "type": "magento-module", + "autoload": { + "classmap": [ + "Cm/Cache/Backend/Redis.php" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" @@ -114,7 +124,7 @@ ], "description": "Zend_Cache backend using Redis with full support for tags.", "homepage": "https://github.com/colinmollenhour/Cm_Cache_Backend_Redis", - "time": "2016-03-24 16:02:15" + "time": "2016-05-02 16:23:36" }, { "name": "colinmollenhour/credis", @@ -1234,16 +1244,16 @@ }, { "name": "symfony/event-dispatcher", - "version": "v2.8.4", + "version": "v2.8.5", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "47d2d8cade9b1c3987573d2943bb9352536cdb87" + "reference": "81c4c51f7fd6d0d40961bd53dd60cade32db6ed6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/47d2d8cade9b1c3987573d2943bb9352536cdb87", - "reference": "47d2d8cade9b1c3987573d2943bb9352536cdb87", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/81c4c51f7fd6d0d40961bd53dd60cade32db6ed6", + "reference": "81c4c51f7fd6d0d40961bd53dd60cade32db6ed6", "shasum": "" }, "require": { @@ -1290,20 +1300,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2016-03-07 14:04:32" + "time": "2016-04-05 16:36:54" }, { "name": "symfony/filesystem", - "version": "v2.8.4", + "version": "v2.8.5", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "f08ffdf229252cd2745558cb2112df43903bcae4" + "reference": "dee379131dceed90a429e951546b33edfe7dccbb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/f08ffdf229252cd2745558cb2112df43903bcae4", - "reference": "f08ffdf229252cd2745558cb2112df43903bcae4", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/dee379131dceed90a429e951546b33edfe7dccbb", + "reference": "dee379131dceed90a429e951546b33edfe7dccbb", "shasum": "" }, "require": { @@ -1339,7 +1349,7 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2016-03-27 10:20:16" + "time": "2016-04-12 18:01:21" }, { "name": "symfony/finder", @@ -1392,16 +1402,16 @@ }, { "name": "symfony/process", - "version": "v2.8.4", + "version": "v2.8.5", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "fb467471952ef5cf8497c029980e556b47545333" + "reference": "1276bd9be89be039748cf753a2137f4ef149cd74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/fb467471952ef5cf8497c029980e556b47545333", - "reference": "fb467471952ef5cf8497c029980e556b47545333", + "url": "https://api.github.com/repos/symfony/process/zipball/1276bd9be89be039748cf753a2137f4ef149cd74", + "reference": "1276bd9be89be039748cf753a2137f4ef149cd74", "shasum": "" }, "require": { @@ -1437,7 +1447,7 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2016-03-23 13:11:46" + "time": "2016-04-14 15:22:22" }, { "name": "tedivm/jshrink", @@ -4165,16 +4175,16 @@ }, { "name": "symfony/config", - "version": "v2.8.4", + "version": "v2.8.5", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "5273f4724dc5288fe7a33cb08077ab9852621f2c" + "reference": "edbbcf33cffa2a85104fc80de8dc052cc51596bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/5273f4724dc5288fe7a33cb08077ab9852621f2c", - "reference": "5273f4724dc5288fe7a33cb08077ab9852621f2c", + "url": "https://api.github.com/repos/symfony/config/zipball/edbbcf33cffa2a85104fc80de8dc052cc51596bb", + "reference": "edbbcf33cffa2a85104fc80de8dc052cc51596bb", "shasum": "" }, "require": { @@ -4214,20 +4224,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2016-03-04 07:54:35" + "time": "2016-04-20 18:52:26" }, { "name": "symfony/dependency-injection", - "version": "v2.8.4", + "version": "v2.8.5", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "f7b4a498e679fa440b16facb934680a1527ed48c" + "reference": "35ac8cd26e4477d79e5cbd4f11d41dc92fed4d8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/f7b4a498e679fa440b16facb934680a1527ed48c", - "reference": "f7b4a498e679fa440b16facb934680a1527ed48c", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/35ac8cd26e4477d79e5cbd4f11d41dc92fed4d8d", + "reference": "35ac8cd26e4477d79e5cbd4f11d41dc92fed4d8d", "shasum": "" }, "require": { @@ -4276,7 +4286,7 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2016-03-21 07:27:21" + "time": "2016-04-20 14:12:37" }, { "name": "symfony/stopwatch", @@ -4329,16 +4339,16 @@ }, { "name": "symfony/yaml", - "version": "v2.8.4", + "version": "v2.8.5", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "584e52cb8f788a887553ba82db6caacb1d6260bb" + "reference": "e4fbcc65f90909c999ac3b4dfa699ee6563a9940" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/584e52cb8f788a887553ba82db6caacb1d6260bb", - "reference": "584e52cb8f788a887553ba82db6caacb1d6260bb", + "url": "https://api.github.com/repos/symfony/yaml/zipball/e4fbcc65f90909c999ac3b4dfa699ee6563a9940", + "reference": "e4fbcc65f90909c999ac3b4dfa699ee6563a9940", "shasum": "" }, "require": { @@ -4374,7 +4384,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2016-03-04 07:54:35" + "time": "2016-03-29 19:00:15" }, { "name": "theseer/fdomdocument", From 4d1caf55ca23fc9632ed59c60b6abe949a69e5e2 Mon Sep 17 00:00:00 2001 From: Igor Melnikov Date: Tue, 3 May 2016 14:01:22 -0500 Subject: [PATCH 012/345] MAGETWO-51578: Remove Cm_Cache_Backend_File and Cm_Cache_Backend_Redis libraries from the repo and install via composer Updating dependencies --- composer.json | 2 +- composer.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 0e5cc0ae2639e..5d5a1a43f7e83 100644 --- a/composer.json +++ b/composer.json @@ -195,7 +195,7 @@ "components/jqueryui": "1.10.4", "twbs/bootstrap": "3.1.0", "tinymce/tinymce": "3.4.7", - "magento-hackathon/magento-composer-installer":"*" + "magento-hackathon/magento-composer-installer": "*" }, "extra": { "component_paths": { diff --git a/composer.lock b/composer.lock index 9198e9baa9f10..713a5b8480f77 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "2e80bb986c7d014eae0d0038339a1e7f", + "hash": "e5dab47ce82b6faa81005750fa5ce860", "content-hash": "73bdcae629e8f2158037c6290b3118f1", "packages": [ { From 3862a02f927be78b82bc655e86d13a5aab7c7c65 Mon Sep 17 00:00:00 2001 From: Igor Melnikov Date: Tue, 3 May 2016 21:08:04 -0500 Subject: [PATCH 013/345] MAGETWO-51578: Remove Cm_Cache_Backend_File and Cm_Cache_Backend_Redis libraries from the repo and install via composer Fixing static test --- .../static/testsuite/Magento/Test/Integrity/ComposerTest.php | 4 ++++ .../Test/Integrity/_files/blacklist/missing_components.txt | 1 + 2 files changed, 5 insertions(+) create mode 100644 dev/tests/static/testsuite/Magento/Test/Integrity/_files/blacklist/missing_components.txt diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php index 6b2f339f43d10..9fd8bfc05a834 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php @@ -341,7 +341,11 @@ public function testComponentPathsInRoot() "The {$component} is specified in 'extra->component_paths', but missing in 'replace' section" ); } + $allowMissingComponents = file(__DIR__ . '/_files/blacklist/missing_components.txt'); foreach (array_keys(self::$rootJson['replace']) as $replace) { + if (in_array($replace, $allowMissingComponents)) { + continue; + } if (!MagentoComponent::matchMagentoComponent($replace)) { $this->assertArrayHasKey( $replace, diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/_files/blacklist/missing_components.txt b/dev/tests/static/testsuite/Magento/Test/Integrity/_files/blacklist/missing_components.txt new file mode 100644 index 0000000000000..76a0540cbd071 --- /dev/null +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/_files/blacklist/missing_components.txt @@ -0,0 +1 @@ +magento-hackathon/magento-composer-installer \ No newline at end of file From 6a1a0baf2ec861cca5324748aec787b97acce379 Mon Sep 17 00:00:00 2001 From: Igor Melnikov Date: Wed, 4 May 2016 12:15:31 -0500 Subject: [PATCH 014/345] MAGETWO-51578: Remove Cm_Cache_Backend_File and Cm_Cache_Backend_Redis libraries from the repo and install via composer Refactoring --- .../static/testsuite/Magento/Test/Integrity/ComposerTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php index 9fd8bfc05a834..542a679cf08bf 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php @@ -341,9 +341,9 @@ public function testComponentPathsInRoot() "The {$component} is specified in 'extra->component_paths', but missing in 'replace' section" ); } - $allowMissingComponents = file(__DIR__ . '/_files/blacklist/missing_components.txt'); + $allowedMissingComponents = file(__DIR__ . '/_files/blacklist/missing_components.txt'); foreach (array_keys(self::$rootJson['replace']) as $replace) { - if (in_array($replace, $allowMissingComponents)) { + if (in_array($replace, $allowedMissingComponents)) { continue; } if (!MagentoComponent::matchMagentoComponent($replace)) { From bf3974afcaa0fa8bfb3973e6681b401b127c259f Mon Sep 17 00:00:00 2001 From: Yurii Hryhoriev Date: Thu, 12 May 2016 13:46:06 +0300 Subject: [PATCH 015/345] MAGETWO-51100: Notice: Array to string conversion --- .../CustomOptions/CustomOptionProcessor.php | 38 ++++++++++++++++++ .../Catalog/Model/ProductOptionProcessor.php | 40 +++++++++++++++++++ .../Unit/Model/ProductOptionProcessorTest.php | 20 +++++++++- .../Download/DownloadCustomOption.php | 7 +++- app/code/Magento/Sales/Model/Download.php | 2 +- .../Download/DownloadCustomOptionTest.php | 34 +++++++++++++++- 6 files changed, 136 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Catalog/Model/CustomOptions/CustomOptionProcessor.php b/app/code/Magento/Catalog/Model/CustomOptions/CustomOptionProcessor.php index f252f282b7e56..4dba2a45ce5ad 100644 --- a/app/code/Magento/Catalog/Model/CustomOptions/CustomOptionProcessor.php +++ b/app/code/Magento/Catalog/Model/CustomOptions/CustomOptionProcessor.php @@ -25,6 +25,9 @@ class CustomOptionProcessor implements CartItemProcessorInterface /** @var CustomOptionFactory */ protected $customOptionFactory; + /** @var \Magento\Catalog\Model\Product\Option\UrlBuilder */ + private $urlBuilder; + /** * @param DataObject\Factory $objectFactory * @param ProductOptionFactory $productOptionFactory @@ -117,10 +120,45 @@ protected function updateOptionsValues(array &$options) $option = $this->customOptionFactory->create(); $option->setOptionId($optionId); if (is_array($optionValue)) { + $optionValue = $this->processFileOptionValue($optionValue); $optionValue = implode(',', $optionValue); } $option->setOptionValue($optionValue); $optionValue = $option; } } + + /** + * Returns option value with file built URL + * + * @param array $optionValue + * @return array + */ + private function processFileOptionValue(array $optionValue) + { + if (array_key_exists('url', $optionValue) && + array_key_exists('route', $optionValue['url']) && + array_key_exists('params', $optionValue['url']) + ) { + $optionValue['url'] = $this->getUrlBuilder()->getUrl( + $optionValue['url']['route'], + $optionValue['url']['params'] + ); + } + return $optionValue; + } + + /** + * @return \Magento\Catalog\Model\Product\Option\UrlBuilder + * + * @deprecated + */ + private function getUrlBuilder() + { + if ($this->urlBuilder === null) { + $this->urlBuilder = \Magento\Framework\App\ObjectManager::getInstance() + ->get('\Magento\Catalog\Model\Product\Option\UrlBuilder'); + } + return $this->urlBuilder; + } } diff --git a/app/code/Magento/Catalog/Model/ProductOptionProcessor.php b/app/code/Magento/Catalog/Model/ProductOptionProcessor.php index 0e685a0ea4d13..2abb52dd14cb5 100644 --- a/app/code/Magento/Catalog/Model/ProductOptionProcessor.php +++ b/app/code/Magento/Catalog/Model/ProductOptionProcessor.php @@ -24,6 +24,11 @@ class ProductOptionProcessor implements ProductOptionProcessorInterface */ protected $customOptionFactory; + /** + * @var \Magento\Catalog\Model\Product\Option\UrlBuilder + */ + private $urlBuilder; + /** * @param DataObjectFactory $objectFactory * @param CustomOptionFactory $customOptionFactory @@ -84,6 +89,7 @@ public function convertToProductOption(DataObject $request) $data = []; foreach ($options as $optionId => $optionValue) { if (is_array($optionValue)) { + $optionValue = $this->processFileOptionValue($optionValue); $filter = function ($item) { return !is_array($item); }; @@ -102,4 +108,38 @@ public function convertToProductOption(DataObject $request) return []; } + + /** + * Returns option value with file built URL + * + * @param array $optionValue + * @return array + */ + private function processFileOptionValue(array $optionValue) + { + if (array_key_exists('url', $optionValue) && + array_key_exists('route', $optionValue['url']) && + array_key_exists('params', $optionValue['url']) + ) { + $optionValue['url'] = $this->getUrlBuilder()->getUrl( + $optionValue['url']['route'], + $optionValue['url']['params'] + ); + } + return $optionValue; + } + + /** + * @return \Magento\Catalog\Model\Product\Option\UrlBuilder + * + * @deprecated + */ + private function getUrlBuilder() + { + if ($this->urlBuilder === null) { + $this->urlBuilder = \Magento\Framework\App\ObjectManager::getInstance() + ->get('\Magento\Catalog\Model\Product\Option\UrlBuilder'); + } + return $this->urlBuilder; + } } diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductOptionProcessorTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ProductOptionProcessorTest.php index 4c9aac8957b98..1162aad97cd1c 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductOptionProcessorTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductOptionProcessorTest.php @@ -78,6 +78,17 @@ protected function setUp() $this->dataObjectFactory, $this->customOptionFactory ); + + $urlBuilder = $this->getMockBuilder('\Magento\Catalog\Model\Product\Option\UrlBuilder') + ->disableOriginalConstructor() + ->setMethods(['getUrl']) + ->getMock(); + $urlBuilder->expects($this->any())->method('getUrl')->willReturn('http://built.url/string/'); + + $reflection = new \ReflectionClass(get_class($this->processor)); + $reflectionProperty = $reflection->getProperty('urlBuilder'); + $reflectionProperty->setAccessible(true); + $reflectionProperty->setValue($this->processor, $urlBuilder); } /** @@ -186,7 +197,14 @@ public function dataProviderConvertToProductOption() [ 'options' => [ 1 => 'value', - 2 => [1, 2], + 2 => [ + 1, + 2, + 'url' => [ + 'route' => 'route', + 'params' => ['id' => 20, 'key' => '8175c7c36ef69432347e'] + ] + ], ], 'expected' => 'custom_options', ], diff --git a/app/code/Magento/Sales/Controller/Download/DownloadCustomOption.php b/app/code/Magento/Sales/Controller/Download/DownloadCustomOption.php index 77ec234e00dd9..8d4969ceb1213 100644 --- a/app/code/Magento/Sales/Controller/Download/DownloadCustomOption.php +++ b/app/code/Magento/Sales/Controller/Download/DownloadCustomOption.php @@ -77,10 +77,15 @@ public function execute() if ($optionId) { /** @var $productOption \Magento\Catalog\Model\Product\Option */ $productOption = $this->_objectManager->create('Magento\Catalog\Model\Product\Option')->load($optionId); + if ($productOption) { + $product = $this->_objectManager->get('\Magento\Catalog\Api\ProductRepositoryInterface')->getById($option->getProductId()); + $productOption->setProduct($product); + } } + if (!$productOption || !$productOption->getId() || - $productOption->getProductId() != $option->getProductId() || + $productOption->getProduct()->getId() != $option->getProductId() || $productOption->getType() != 'file' ) { return $resultForward->forward('noroute'); diff --git a/app/code/Magento/Sales/Model/Download.php b/app/code/Magento/Sales/Model/Download.php index afe7d5ea6b83f..58a3548cf011e 100644 --- a/app/code/Magento/Sales/Model/Download.php +++ b/app/code/Magento/Sales/Model/Download.php @@ -89,7 +89,7 @@ public function downloadFile($info) protected function _isCanProcessed($relativePath) { $filePath = $this->_rootDir->getAbsolutePath($relativePath); - return (strpos($this->_rootDir->getDriver()->getRealPath($filePath), $relativePath) !== false + return (strpos(str_replace('\\', '/', $this->_rootDir->getDriver()->getRealPath($filePath)), $relativePath) !== false && $this->_rootDir->isFile($relativePath) && $this->_rootDir->isReadable($relativePath)) || $this->_processDatabaseFile($filePath, $relativePath); } diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Download/DownloadCustomOptionTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Download/DownloadCustomOptionTest.php index 3ebbca491d602..613b55bb49ba6 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Download/DownloadCustomOptionTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Download/DownloadCustomOptionTest.php @@ -72,6 +72,16 @@ class DownloadCustomOptionTest extends \PHPUnit_Framework_TestCase */ protected $objectMock; + /** + * @var \Magento\Catalog\Api\ProductRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $productRepositoryMock; + + /** + * @var \Magento\Catalog\Model\Product|\PHPUnit_Framework_MockObject_MockObject + */ + protected $productMock; + protected function setUp() { $resultForwardFactoryMock = $this->getMockBuilder('Magento\Framework\Controller\Result\ForwardFactory') @@ -113,14 +123,25 @@ protected function setUp() ->setMethods(['load', 'getId', 'getCode', 'getProductId', 'getValue']) ->getMock(); + $this->productMock = $this->getMockBuilder('\Magento\Catalog\Model\Product') + ->disableOriginalConstructor() + ->setMethods(['getId']) + ->getMock(); + + $this->productRepositoryMock = $this->getMockBuilder('\Magento\Catalog\Api\ProductRepositoryInterface') + ->setMethods(['getById']) + ->getMockForAbstractClass(); + $this->productRepositoryMock->expects($this->any())->method('getById')->willReturn($this->productMock); + $this->productOptionMock = $this->getMockBuilder('Magento\Catalog\Model\Product\Option') ->disableOriginalConstructor() - ->setMethods(['load', 'getId', 'getProductId', 'getType']) + ->setMethods(['load', 'getId', 'getProductId', 'getType', 'getProduct', 'setProduct']) ->getMock(); + $this->productOptionMock->expects($this->any())->method('getProduct')->willReturn($this->productMock); $objectManagerMock = $this->getMockBuilder('Magento\Sales\Model\Download') ->disableOriginalConstructor() - ->setMethods(['create']) + ->setMethods(['create', 'get']) ->getMock(); $objectManagerMock->expects($this->any())->method('create') ->will( @@ -131,6 +152,11 @@ protected function setUp() ] ) ); + $objectManagerMock->expects($this->any())->method('get')->willReturnMap( + [ + ['\Magento\Catalog\Api\ProductRepositoryInterface', $this->productRepositoryMock], + ] + ); $contextMock = $this->getMockBuilder('Magento\Backend\App\Action\Context') ->disableOriginalConstructor() @@ -191,6 +217,8 @@ public function testExecute($itemOptionValues, $productOptionValues, $noRouteOcc $this->productOptionMock->expects($this->any()) ->method('getType') ->willReturn($productOptionValues[self::OPTION_TYPE]); + + $this->productMock->expects($this->any())->method('getId')->willReturn($productOptionValues[self::OPTION_PRODUCT_ID]); } if ($noRouteOccurs) { $this->resultForwardMock->expects($this->once())->method('forward')->with('noroute')->willReturn(true); @@ -321,6 +349,8 @@ public function testExecuteBadSecretKey() $this->productOptionMock->expects($this->any())->method('getProductId')->willReturn(self::OPTION_PRODUCT_ID); $this->productOptionMock->expects($this->any())->method('getType')->willReturn(self::OPTION_TYPE); + $this->productMock->expects($this->any())->method('getId')->willReturn(self::OPTION_PRODUCT_ID); + $this->unserializeMock->expects($this->once()) ->method('unserialize') ->with(self::OPTION_VALUE) From 7982f055eb5742ce2c20780fce9fcecd98723f37 Mon Sep 17 00:00:00 2001 From: Yurii Hryhoriev Date: Thu, 12 May 2016 13:53:37 +0300 Subject: [PATCH 016/345] MAGETWO-51100: Notice: Array to string conversion - merge fix --- app/code/Magento/Catalog/Model/ProductOptionProcessor.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/code/Magento/Catalog/Model/ProductOptionProcessor.php b/app/code/Magento/Catalog/Model/ProductOptionProcessor.php index 2abb52dd14cb5..a22286c47701b 100644 --- a/app/code/Magento/Catalog/Model/ProductOptionProcessor.php +++ b/app/code/Magento/Catalog/Model/ProductOptionProcessor.php @@ -90,10 +90,6 @@ public function convertToProductOption(DataObject $request) foreach ($options as $optionId => $optionValue) { if (is_array($optionValue)) { $optionValue = $this->processFileOptionValue($optionValue); - $filter = function ($item) { - return !is_array($item); - }; - $optionValue = array_filter($optionValue, $filter); $optionValue = implode(',', $optionValue); } From f47e46fb9d0750fddc26d50cfc1c5fd97a8386c8 Mon Sep 17 00:00:00 2001 From: Maddy Chellathurai Date: Thu, 12 May 2016 08:40:33 -0500 Subject: [PATCH 017/345] MAGETWO-51929: Web Setup Wizard does not work when Magento is installed in pub - Do not show setup wizard when document root is pub --- .../Backend/Model/Setup/MenuBuilder.php | 48 +++++++++++++++++++ app/code/Magento/Backend/etc/di.xml | 3 ++ .../Magento/Framework/App/DocRoot.php | 47 ++++++++++++++++++ 3 files changed, 98 insertions(+) create mode 100644 app/code/Magento/Backend/Model/Setup/MenuBuilder.php create mode 100644 lib/internal/Magento/Framework/App/DocRoot.php diff --git a/app/code/Magento/Backend/Model/Setup/MenuBuilder.php b/app/code/Magento/Backend/Model/Setup/MenuBuilder.php new file mode 100644 index 0000000000000..76d98a8a79fe8 --- /dev/null +++ b/app/code/Magento/Backend/Model/Setup/MenuBuilder.php @@ -0,0 +1,48 @@ +docRoot = $docRoot; + } + + /** + * Removes 'Web Setup Wizard' from the menu if doc root is pub and no setup url variable is specified. + * + * @param Builder $subject + * @param Menu $menu + * @return Menu + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterGetResult(Builder $subject, Menu $menu) + { + if ($this->docRoot->hasThisSubDir('pub', 'setup')) { + $menu->remove('Magento_Backend::setup_wizard'); + } + return $menu; + } +} diff --git a/app/code/Magento/Backend/etc/di.xml b/app/code/Magento/Backend/etc/di.xml index 3009bc4e1fc8c..7eadb69d9b1ed 100644 --- a/app/code/Magento/Backend/etc/di.xml +++ b/app/code/Magento/Backend/etc/di.xml @@ -214,4 +214,7 @@
+ + + diff --git a/lib/internal/Magento/Framework/App/DocRoot.php b/lib/internal/Magento/Framework/App/DocRoot.php new file mode 100644 index 0000000000000..c70976cad691d --- /dev/null +++ b/lib/internal/Magento/Framework/App/DocRoot.php @@ -0,0 +1,47 @@ +request = $request; + $this->readFactory = $readFactory; + } + + /** + * Returns true if doc root is pub/ and not BP + * + * @return string + */ + public function hasThisSubDir($dirToCheck, $missingDir) + { + $rootBasePath = $this->request->getServer('DOCUMENT_ROOT'); + $readDirectory = $this->readFactory->create(DirectoryList::ROOT); + return strpos($rootBasePath, $dirToCheck) && !$readDirectory->isExist($rootBasePath + $missingDir); + } +} From 166e034b07fb492eec76d8290d49aa367f137877 Mon Sep 17 00:00:00 2001 From: Maddy Chellathurai Date: Thu, 12 May 2016 09:13:49 -0500 Subject: [PATCH 018/345] MAGETWO-51929: Web Setup Wizard does not work when Magento is installed in pub - Static fixes --- lib/internal/Magento/Framework/App/DocRoot.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/App/DocRoot.php b/lib/internal/Magento/Framework/App/DocRoot.php index c70976cad691d..5c62fe87e61c9 100644 --- a/lib/internal/Magento/Framework/App/DocRoot.php +++ b/lib/internal/Magento/Framework/App/DocRoot.php @@ -28,15 +28,20 @@ class DocRoot * @param RequestInterface $request * @param ReadFactory $readFactory */ - public function __construct(RequestInterface $request, ReadFactory $readFactory) { + public function __construct(RequestInterface $request, ReadFactory $readFactory) + { $this->request = $request; $this->readFactory = $readFactory; } + /** * Returns true if doc root is pub/ and not BP * - * @return string + * @param $dirToCheck + * @param $missingDir + * + * @return bool */ public function hasThisSubDir($dirToCheck, $missingDir) { From 95ce85ba4f880c8efe97f3a06c338c1214d2a219 Mon Sep 17 00:00:00 2001 From: Maddy Chellathurai Date: Thu, 12 May 2016 09:25:19 -0500 Subject: [PATCH 019/345] MAGETWO-51929: Web Setup Wizard does not work when Magento is installed in pub - Static fixes --- lib/internal/Magento/Framework/App/DocRoot.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/internal/Magento/Framework/App/DocRoot.php b/lib/internal/Magento/Framework/App/DocRoot.php index 5c62fe87e61c9..39a71f7e9b86a 100644 --- a/lib/internal/Magento/Framework/App/DocRoot.php +++ b/lib/internal/Magento/Framework/App/DocRoot.php @@ -34,12 +34,11 @@ public function __construct(RequestInterface $request, ReadFactory $readFactory) $this->readFactory = $readFactory; } - /** * Returns true if doc root is pub/ and not BP * - * @param $dirToCheck - * @param $missingDir + * @param string $dirToCheck + * @param string $missingDir * * @return bool */ From 4497a67b41014e510a3aecdbb401167aa0c460e5 Mon Sep 17 00:00:00 2001 From: Todd Christensen Date: Wed, 27 Apr 2016 16:51:04 -0700 Subject: [PATCH 020/345] Use a temp table for category/product indexing. This avoids an expensive LIKE operation on each row, and front-loads the work beforehand. For a full reindex, this typically reduces the time taken by more than 90%. --- .../Category/Product/AbstractAction.php | 79 +++++++++++++++++-- 1 file changed, 74 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php b/app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php index 03e733938dda8..d373b853d54ed 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php +++ b/app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php @@ -368,6 +368,8 @@ protected function createAnchorSelect(\Magento\Store\Model\Store $store) $rootCatIds = explode('/', $this->getPathFromCategoryId($store->getRootCategoryId())); array_pop($rootCatIds); + $temporaryTreeTable = $this->makeTempCategoryTreeIndex(); + $productMetadata = $this->getMetadataPool()->getMetadata(\Magento\Catalog\Api\Data\ProductInterface::class); $categoryMetadata = $this->getMetadataPool()->getMetadata(\Magento\Catalog\Api\Data\CategoryInterface::class); $productLinkField = $productMetadata->getLinkField(); @@ -377,17 +379,15 @@ protected function createAnchorSelect(\Magento\Store\Model\Store $store) ['cc' => $this->getTable('catalog_category_entity')], [] )->joinInner( - ['cc2' => $this->getTable('catalog_category_entity')], - 'cc2.path LIKE ' . $this->connection->getConcatSql( - [$this->connection->quoteIdentifier('cc.path'), $this->connection->quote('/%')] - ) . ' AND cc.entity_id NOT IN (' . implode( + ['cc2' => $temporaryTreeTable], + 'cc2.parent_id = cc.entity_id AND cc.entity_id NOT IN (' . implode( ',', $rootCatIds ) . ')', [] )->joinInner( ['ccp' => $this->getTable('catalog_category_product')], - 'ccp.category_id = cc2.entity_id', + 'ccp.category_id = cc2.child_id', [] )->joinInner( ['cpe' => $this->getTable('catalog_product_entity')], @@ -459,6 +459,75 @@ protected function createAnchorSelect(\Magento\Store\Model\Store $store) ); } + /** + * Build and populate the temporary category tree index table + * + * Returns the name of the temporary table to use in queries. + * + * @return string + */ + protected function makeTempCategoryTreeIndex() + { + // Note: this temporary table is per-connection, so won't conflict by prefix. + $temporaryName = $this->connection->getTableName('temp_catalog_category_tree_index'); + + $temporaryTable = $this->connection->newTable($temporaryName); + $temporaryTable->addColumn( + 'parent_id', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['nullable' => false, 'unsigned' => true] + ); + $temporaryTable->addColumn( + 'child_id', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['nullable' => false, 'unsigned' => true] + ); + // Each entry will be unique. + $temporaryTable->addIndex( + 'idx_primary', + ['parent_id', 'child_id'], + ['type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_PRIMARY] + ); + + // Drop the temporary table in case it already exists on this (persistent?) connection. + $this->connection->dropTemporaryTable($temporaryName); + $this->connection->createTemporaryTable($temporaryTable); + + $this->fillTempCategoryTreeIndex($temporaryName); + + return $temporaryName; + } + + /** + * Populate the temporary category tree index table + * + * @param string $temporaryName + */ + protected function fillTempCategoryTreeIndex($temporaryName) + { + // This finds all children (cc2) that descend from a parent (cc) by path. + // For example, cc.path may be '1/2', and cc2.path may be '1/2/3/4/5'. + $temporarySelect = $this->connection->select()->from( + ['cc' => $this->getTable('catalog_category_entity')], + ['parent_id' => 'entity_id'] + )->joinInner( + ['cc2' => $this->getTable('catalog_category_entity')], + 'cc2.path LIKE ' . $this->connection->getConcatSql( + [$this->connection->quoteIdentifier('cc.path'), $this->connection->quote('/%')] + ), + ['child_id' => 'entity_id'] + ); + + $this->connection->query( + $temporarySelect->insertFromSelect( + $temporaryName, + ['parent_id', 'child_id'] + ) + ); + } + /** * Retrieve select for reindex products of non anchor categories * From 15c31e13080c511d00a103013fcf0d98ac48dff3 Mon Sep 17 00:00:00 2001 From: Oleksandr Miroshnichenko Date: Mon, 16 May 2016 13:25:56 +0300 Subject: [PATCH 021/345] MAGETWO-52785: Save button doesn't work on category edit page --- lib/web/mage/validation.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/web/mage/validation.js b/lib/web/mage/validation.js index 26cd61df45c80..b809c92830e03 100644 --- a/lib/web/mage/validation.js +++ b/lib/web/mage/validation.js @@ -1423,11 +1423,17 @@ var errors = {}, valid = true, validateConfig = { - errorElement: 'label' + errorElement: 'label', + ignore: '.ignore-validate' }, form, validator, classes; - element = $(element); + element = $(element).not(validateConfig.ignore); + + if (!element.length) { + return true; + } + form = element.get(0).form; validator = form ? $(form).data('validator') : null; From b9b0acb0f4ae82025bca8ceaedf869b6d495c6c9 Mon Sep 17 00:00:00 2001 From: Ruslan Kostiv Date: Mon, 16 May 2016 16:34:21 +0300 Subject: [PATCH 022/345] MAGETWO-52512: Newsletter subscription is not subscribing when Need to confirm is set to yes --- app/code/Magento/Newsletter/Model/Subscriber.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Newsletter/Model/Subscriber.php b/app/code/Magento/Newsletter/Model/Subscriber.php index ef43df4104b93..cefab24640808 100644 --- a/app/code/Magento/Newsletter/Model/Subscriber.php +++ b/app/code/Magento/Newsletter/Model/Subscriber.php @@ -442,6 +442,7 @@ public function subscribe($email) $this->setStatusChanged(true); try { + $this->save(); if ($isConfirmNeed === true && $isOwnSubscribes === false ) { @@ -449,7 +450,6 @@ public function subscribe($email) } else { $this->sendConfirmationSuccessEmail(); } - $this->save(); return $this->getStatus(); } catch (\Exception $e) { throw new \Exception($e->getMessage()); From 2ad9f8f0afe4f71c785a9a110d1e2c2595e4de11 Mon Sep 17 00:00:00 2001 From: Roman Ganin Date: Mon, 16 May 2016 17:56:56 +0300 Subject: [PATCH 023/345] MAGETWO-52316: [GITHUB] Locking query on catalog category product index #4342 --- .../Category/Product/AbstractAction.php | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php b/app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php index d373b853d54ed..870f54c838ae1 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php +++ b/app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php @@ -97,6 +97,11 @@ abstract class AbstractAction */ protected $metadataPool; + /** + * @var string + */ + protected $tempTreeIndexTableName; + /** * @param ResourceConnection $resource * @param \Magento\Store\Model\StoreManagerInterface $storeManager @@ -459,6 +464,23 @@ protected function createAnchorSelect(\Magento\Store\Model\Store $store) ); } + /** + * Get temporary table name for concurrent indexing in persistent connection + * Temp table name is NOT shared between action instances and each action has it's own temp tree index + * + * @return string + */ + protected function getTemporaryTreeIndexTableName() + { + if (empty($this->tempTreeIndexTableName)) { + $this->tempTreeIndexTableName = $this->connection->getTableName('temp_catalog_category_tree_index') + . '_' + . substr(md5(time() . rand(0, 999999999)), 0, 8); + } + + return $this->tempTreeIndexTableName; + } + /** * Build and populate the temporary category tree index table * @@ -469,7 +491,7 @@ protected function createAnchorSelect(\Magento\Store\Model\Store $store) protected function makeTempCategoryTreeIndex() { // Note: this temporary table is per-connection, so won't conflict by prefix. - $temporaryName = $this->connection->getTableName('temp_catalog_category_tree_index'); + $temporaryName = $this->getTemporaryTreeIndexTableName(); $temporaryTable = $this->connection->newTable($temporaryName); $temporaryTable->addColumn( From 3d398cf790aa217eacc2393eaea18496a4ab77d3 Mon Sep 17 00:00:00 2001 From: Elena Marchenko Date: Mon, 16 May 2016 18:25:48 +0300 Subject: [PATCH 024/345] MAGETWO-52696: Fix ExpressCheckoutOnePageTest and ExpressCheckoutFromProductPageTest tests --- .../Paypal/Test/Block/Sandbox/SignupCreate.php | 2 +- .../ExpressCheckoutFromProductPageTest.xml | 2 +- .../ExpressCheckoutFromShoppingCartTest.xml | 14 +++++++------- .../TestStep/ExpressCheckoutOrderPlaceStep.php | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Paypal/Test/Block/Sandbox/SignupCreate.php b/dev/tests/functional/tests/app/Magento/Paypal/Test/Block/Sandbox/SignupCreate.php index a727c88a719f4..217e691205a6f 100644 --- a/dev/tests/functional/tests/app/Magento/Paypal/Test/Block/Sandbox/SignupCreate.php +++ b/dev/tests/functional/tests/app/Magento/Paypal/Test/Block/Sandbox/SignupCreate.php @@ -19,7 +19,7 @@ class SignupCreate extends Form * * @var string */ - protected $termsAgree = '#termsAgree'; + protected $termsAgree = '#termsAgreeLabel span'; /** * Continue personal account signup button. diff --git a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/ExpressCheckoutFromProductPageTest.xml b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/ExpressCheckoutFromProductPageTest.xml index 6105e8a65af43..4373523471cff 100644 --- a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/ExpressCheckoutFromProductPageTest.xml +++ b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/ExpressCheckoutFromProductPageTest.xml @@ -27,7 +27,7 @@ paypal_express paypal_express, freeshipping - test_type:3rd_party_test_deprecated + test_type:3rd_party_test diff --git a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/ExpressCheckoutFromShoppingCartTest.xml b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/ExpressCheckoutFromShoppingCartTest.xml index 5441a4749949c..b2e9ce9b56327 100644 --- a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/ExpressCheckoutFromShoppingCartTest.xml +++ b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/ExpressCheckoutFromShoppingCartTest.xml @@ -8,25 +8,25 @@ - catalogProductSimple::simple_10_dollar, configurableProduct::with_one_option, bundleProduct::fixed_100_dollar_with_required_options + catalogProductSimple::simple_10_dollar, configurableProduct::with_one_option, bundleProduct::bundle_fixed_100_dollar_product us_ca_ny_rule - sandbox_us_default + sandbox_us_default guest Fixed Flat Rate - 131.00 + 121.00 - 131.00 - 10.81 + 121.00 + 9.98 15.00 - 156.81 + 145.98 payflowpro - test_type:3rd_party_test_deprecated + test_type:3rd_party_test diff --git a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestStep/ExpressCheckoutOrderPlaceStep.php b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestStep/ExpressCheckoutOrderPlaceStep.php index efb5afd2e38a5..60109c51ed255 100644 --- a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestStep/ExpressCheckoutOrderPlaceStep.php +++ b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestStep/ExpressCheckoutOrderPlaceStep.php @@ -87,7 +87,7 @@ public function __construct( CheckoutOnepage $checkoutOnepage, CheckoutOnepageSuccess $checkoutOnepageSuccess, FixtureFactory $fixtureFactory, - array $products, + array $products = [], array $shipping = [], array $prices = [] ) { From 8be48f1e886319640853d94eec089c8ff4b452fa Mon Sep 17 00:00:00 2001 From: Elena Marchenko Date: Tue, 17 May 2016 13:05:18 +0300 Subject: [PATCH 025/345] MAGETWO-52696: Fix ExpressCheckoutOnePageTest and ExpressCheckoutFromProductPageTest tests --- .../app/Magento/Paypal/Test/Block/Sandbox/SignupAddCard.php | 1 + .../app/Magento/Paypal/Test/Repository/SandboxCustomer.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dev/tests/functional/tests/app/Magento/Paypal/Test/Block/Sandbox/SignupAddCard.php b/dev/tests/functional/tests/app/Magento/Paypal/Test/Block/Sandbox/SignupAddCard.php index 9f9edc52d601c..d1be4525c61d2 100644 --- a/dev/tests/functional/tests/app/Magento/Paypal/Test/Block/Sandbox/SignupAddCard.php +++ b/dev/tests/functional/tests/app/Magento/Paypal/Test/Block/Sandbox/SignupAddCard.php @@ -27,6 +27,7 @@ class SignupAddCard extends Form */ public function linkCardToAccount() { + $this->browser->selectWindow(); $this->_rootElement->find($this->linkCard)->click(); } } diff --git a/dev/tests/functional/tests/app/Magento/Paypal/Test/Repository/SandboxCustomer.xml b/dev/tests/functional/tests/app/Magento/Paypal/Test/Repository/SandboxCustomer.xml index 8bd0c3cc86002..7443516c3a70f 100644 --- a/dev/tests/functional/tests/app/Magento/Paypal/Test/Repository/SandboxCustomer.xml +++ b/dev/tests/functional/tests/app/Magento/Paypal/Test/Repository/SandboxCustomer.xml @@ -18,7 +18,7 @@ CA 90230 555-55-555-55 - 4032037915119131 + 4032034402702800 05/20 123 From 53c3de603888a068c9319f7cf9ca725c5e792dd3 Mon Sep 17 00:00:00 2001 From: Ruslan Kostiv Date: Tue, 17 May 2016 14:30:35 +0300 Subject: [PATCH 026/345] MAGETWO-52483: Product Video custom Preview Image is substituted with video default image --- .../ProductVideo/view/adminhtml/web/js/new-video-dialog.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/code/Magento/ProductVideo/view/adminhtml/web/js/new-video-dialog.js b/app/code/Magento/ProductVideo/view/adminhtml/web/js/new-video-dialog.js index 80f3c7f81bf6e..f19a2640c1401 100644 --- a/app/code/Magento/ProductVideo/view/adminhtml/web/js/new-video-dialog.js +++ b/app/code/Magento/ProductVideo/view/adminhtml/web/js/new-video-dialog.js @@ -330,9 +330,6 @@ define([ description: data.description } }); - } - - if (playerData.oldVideoId !== playerData.newVideoId) { this._loadRemotePreview(data.thumbnail); } self._onlyVideoPlayer = true; From 78afefc786f80f1358693369ef97fcbabe3dee16 Mon Sep 17 00:00:00 2001 From: Ruslan Kostiv Date: Wed, 18 May 2016 13:20:01 +0300 Subject: [PATCH 027/345] MAGETWO-52512: Newsletter subscription is not subscribing when Need to confirm is set to yes --- .../Newsletter/Model/SubscriberTest.php | 18 ++++++++++++++++++ .../Magento/Newsletter/_files/subscribers.php | 10 ++++++++++ 2 files changed, 28 insertions(+) diff --git a/dev/tests/integration/testsuite/Magento/Newsletter/Model/SubscriberTest.php b/dev/tests/integration/testsuite/Magento/Newsletter/Model/SubscriberTest.php index 9c94d84b9f167..1d61fd45f8708 100644 --- a/dev/tests/integration/testsuite/Magento/Newsletter/Model/SubscriberTest.php +++ b/dev/tests/integration/testsuite/Magento/Newsletter/Model/SubscriberTest.php @@ -20,6 +20,24 @@ protected function setUp() ); } + /** + * @magentoDataFixture Magento/Newsletter/_files/subscribers.php + * @magentoConfigFixture current_store newsletter/subscription/confirm 1 + */ + public function testEmailConfirmation() + { + $this->_model->subscribe('customer_confirm@example.com'); + $transportBuilder = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get('Magento\TestFramework\Mail\Template\TransportBuilderMock'); + // confirmationCode 'ysayquyajua23iq29gxwu2eax2qb6gvy' is taken from fixture + $this->assertContains( + '/newsletter/subscriber/confirm/id/' . $this->_model->getSubscriberId() + . '/code/ysayquyajua23iq29gxwu2eax2qb6gvy', + $transportBuilder->getSentMessage()->getBodyHtml()->getRawContent() + ); + $this->assertEquals(Subscriber::STATUS_NOT_ACTIVE, $this->_model->getSubscriberStatus()); + } + /** * @magentoDataFixture Magento/Newsletter/_files/subscribers.php */ diff --git a/dev/tests/integration/testsuite/Magento/Newsletter/_files/subscribers.php b/dev/tests/integration/testsuite/Magento/Newsletter/_files/subscribers.php index cdc67fc7a0dbd..47795630aef2b 100644 --- a/dev/tests/integration/testsuite/Magento/Newsletter/_files/subscribers.php +++ b/dev/tests/integration/testsuite/Magento/Newsletter/_files/subscribers.php @@ -34,3 +34,13 @@ ->setSubscriberEmail('customer_two@example.com') ->setSubscriberStatus(\Magento\Newsletter\Model\Subscriber::STATUS_SUBSCRIBED) ->save(); + +/** @var \Magento\Newsletter\Model\Subscriber $subscriber */ +$subscriber = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create('Magento\Newsletter\Model\Subscriber'); +$subscriber->setStoreId($currentStore) + ->setCustomerId(1) + ->setSubscriberEmail('customer_confirm@example.com') + ->setSubscriberConfirmCode('ysayquyajua23iq29gxwu2eax2qb6gvy') + ->setSubscriberStatus(\Magento\Newsletter\Model\Subscriber::STATUS_UNSUBSCRIBED) + ->save(); From ce3223e040700f11e04fd4768dd524bf10652c16 Mon Sep 17 00:00:00 2001 From: Yurii Hryhoriev Date: Wed, 18 May 2016 13:34:19 +0300 Subject: [PATCH 028/345] MAGETWO-52775: [Github] Updating products with Multiple Select Attribute #4346 #4312 --- .../Catalog/Ui/Component/ColumnFactory.php | 3 +- .../Ui/Component/Filters/Type/Select.php | 7 ++++- .../base/web/js/form/element/multiselect.js | 29 ++++--------------- .../view/base/web/js/grid/columns/select.js | 4 +++ 4 files changed, 17 insertions(+), 26 deletions(-) diff --git a/app/code/Magento/Catalog/Ui/Component/ColumnFactory.php b/app/code/Magento/Catalog/Ui/Component/ColumnFactory.php index 1f85ea746253a..3e5486507cbe4 100644 --- a/app/code/Magento/Catalog/Ui/Component/ColumnFactory.php +++ b/app/code/Magento/Catalog/Ui/Component/ColumnFactory.php @@ -18,6 +18,7 @@ class ColumnFactory protected $jsComponentMap = [ 'text' => 'Magento_Ui/js/grid/columns/column', 'select' => 'Magento_Ui/js/grid/columns/select', + 'multiselect' => 'Magento_Ui/js/grid/columns/select', 'date' => 'Magento_Ui/js/grid/columns/date', ]; @@ -29,7 +30,7 @@ class ColumnFactory 'text' => 'text', 'boolean' => 'select', 'select' => 'select', - 'multiselect' => 'select', + 'multiselect' => 'multiselect', 'date' => 'date', ]; diff --git a/app/code/Magento/Ui/Component/Filters/Type/Select.php b/app/code/Magento/Ui/Component/Filters/Type/Select.php index 77803d69ebf2e..5f0097ae7f364 100644 --- a/app/code/Magento/Ui/Component/Filters/Type/Select.php +++ b/app/code/Magento/Ui/Component/Filters/Type/Select.php @@ -96,9 +96,14 @@ protected function applyFilter() { if (isset($this->filterData[$this->getName()])) { $value = $this->filterData[$this->getName()]; - $conditionType = is_array($value) ? 'in' : 'eq'; if (!empty($value) || is_numeric($value)) { + if (is_array($value)) { + $conditionType = 'in'; + } else { + $dataType = $this->getData('config/dataType'); + $conditionType = $dataType == 'multiselect' ? 'finset' : 'eq'; + } $filter = $this->filterBuilder->setConditionType($conditionType) ->setField($this->getName()) ->setValue($value) diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/multiselect.js b/app/code/Magento/Ui/view/base/web/js/form/element/multiselect.js index 0626750d2ba7c..0a2d08b29f154 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/multiselect.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/multiselect.js @@ -16,28 +16,6 @@ define([ elementTmpl: 'ui/form/element/multiselect' }, - /** - * @inheritdoc - */ - initConfig: function () { - this._super(); - - this.value = this.normalizeData(this.value); - - return this; - }, - - /** - * @inheritdoc - */ - initLinks: function () { - var scope = this.source.get(this.dataScope); - - this.multipleScopeValue = _.isArray(scope) ? utils.copy(scope) : undefined; - - return this._super(); - }, - /** * @inheritdoc */ @@ -64,11 +42,14 @@ define([ * @inheritdoc */ getInitialValue: function () { - var values = [this.multipleScopeValue, this.default, this.value.peek(), []], + var values = [ + this.normalizeData(this.source.get(this.dataScope)), + this.normalizeData(this.default) + ], value; values.some(function (v) { - return _.isArray(v) && (value = utils.copy(v)); + return _.isArray(v) && (value = utils.copy(v)) && !_.isEmpty(v); }); return value; diff --git a/app/code/Magento/Ui/view/base/web/js/grid/columns/select.js b/app/code/Magento/Ui/view/base/web/js/grid/columns/select.js index d7cd43b639c71..c710ef606dcd0 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/columns/select.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/columns/select.js @@ -21,6 +21,10 @@ define([ values = this._super(), label = []; + if (_.isString(values)) { + values = values.split(','); + } + if (!Array.isArray(values)) { values = [values]; } From b85c6e0a78ee354040bfd988a91ea5cdded97e3e Mon Sep 17 00:00:00 2001 From: "Shmyheliuk, Oleksandr" Date: Wed, 18 May 2016 14:04:04 +0300 Subject: [PATCH 029/345] MAGETWO-52781: DeleteSavedCreditCardTest is failing on credit card deletion --- .../tests/app/Magento/Vault/Test/Block/CreditCards.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/functional/tests/app/Magento/Vault/Test/Block/CreditCards.php b/dev/tests/functional/tests/app/Magento/Vault/Test/Block/CreditCards.php index 8f55c177661bf..1869cf3673f2f 100644 --- a/dev/tests/functional/tests/app/Magento/Vault/Test/Block/CreditCards.php +++ b/dev/tests/functional/tests/app/Magento/Vault/Test/Block/CreditCards.php @@ -44,7 +44,7 @@ public function getCreditCards() foreach ($elements as $row) { $number = substr($row->find('./td[@data-th="Card Number"]', Locator::SELECTOR_XPATH)->getText(), -4, 4); $deleteButton = $row->find( - "./td[contains(text(), '{$number}')]/following-sibling::td[@data-th='Actions']//span[text()='Delete']", + "./td[text()[contains(.,'{$number}')]]/following-sibling::td[@data-th='Actions']//span[text()='Delete']", Locator::SELECTOR_XPATH ); $result[$number] = $deleteButton; From cd13a85fa7594a1d24af7cff1509011c04bb0f28 Mon Sep 17 00:00:00 2001 From: Dmytro Kvashnin Date: Wed, 18 May 2016 16:10:01 +0300 Subject: [PATCH 030/345] MAGETWO-52101: Mark insecure methods as deprecated in Message\ManagerInterface --- lib/internal/Magento/Framework/Message/ManagerInterface.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/internal/Magento/Framework/Message/ManagerInterface.php b/lib/internal/Magento/Framework/Message/ManagerInterface.php index 7fee32dc10c0e..08d8ea91b139a 100644 --- a/lib/internal/Magento/Framework/Message/ManagerInterface.php +++ b/lib/internal/Magento/Framework/Message/ManagerInterface.php @@ -52,6 +52,7 @@ public function addMessages(array $messages, $group = null); * @param string $message * @param string|null $group * @return ManagerInterface + * @deprecated * @see \Magento\Framework\Message\ManagerInterface::addErrorMessage */ public function addError($message, $group = null); @@ -62,6 +63,7 @@ public function addError($message, $group = null); * @param string $message * @param string|null $group * @return ManagerInterface + * @deprecated * @see \Magento\Framework\Message\ManagerInterface::addWarningMessage */ public function addWarning($message, $group = null); @@ -72,6 +74,7 @@ public function addWarning($message, $group = null); * @param string $message * @param string|null $group * @return ManagerInterface + * @deprecated * @see \Magento\Framework\Message\ManagerInterface::addNoticeMessage */ public function addNotice($message, $group = null); @@ -82,6 +85,7 @@ public function addNotice($message, $group = null); * @param string $message * @param string|null $group * @return ManagerInterface + * @deprecated * @see \Magento\Framework\Message\ManagerInterface::addSuccessMessage */ public function addSuccess($message, $group = null); @@ -178,6 +182,8 @@ public function addUniqueMessages(array $messages, $group = null); * @param string $alternativeText * @param string|null $group * @return ManagerInterface + * @deprecated + * @see \Magento\Framework\Message\ManagerInterface::addExceptionMessage */ public function addException(\Exception $exception, $alternativeText, $group = null); From bbe125d291832bb7da5e9507f677bda8cd740cdb Mon Sep 17 00:00:00 2001 From: "Yushkin, Dmytro" Date: Wed, 18 May 2016 18:58:58 +0300 Subject: [PATCH 031/345] MAGETWO-52552: [Github] Invoice status not changed after capturing saved invoice #4385 --- .../Invoice/AbstractInvoice/View.php | 36 +++++++++--- .../Order/Invoice/AddCommentTest.php | 42 ++++++-------- .../Adminhtml/Order/Invoice/CancelTest.php | 57 +++++++------------ .../Adminhtml/Order/Invoice/CaptureTest.php | 57 +++++++------------ .../Adminhtml/Order/Invoice/ViewTest.php | 45 ++++++--------- .../Adminhtml/Order/Invoice/VoidTest.php | 48 +++++++--------- 6 files changed, 125 insertions(+), 160 deletions(-) diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Invoice/AbstractInvoice/View.php b/app/code/Magento/Sales/Controller/Adminhtml/Invoice/AbstractInvoice/View.php index 25fb917184b32..2960f88190625 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Invoice/AbstractInvoice/View.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Invoice/AbstractInvoice/View.php @@ -7,7 +7,10 @@ namespace Magento\Sales\Controller\Adminhtml\Invoice\AbstractInvoice; use Magento\Backend\App\Action\Context; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Registry; +use Magento\Sales\Api\InvoiceRepositoryInterface; +use Magento\Sales\Model\Order\InvoiceRepository; abstract class View extends \Magento\Backend\App\Action { @@ -28,6 +31,11 @@ abstract class View extends \Magento\Backend\App\Action */ protected $resultForwardFactory; + /** + * @var InvoiceRepositoryInterface + */ + protected $invoiceRepository; + /** * @param Context $context * @param Registry $registry @@ -66,16 +74,28 @@ public function execute() */ protected function getInvoice() { - $invoiceId = $this->getRequest()->getParam('invoice_id'); - if (!$invoiceId) { + try { + $invoice = $this->getInvoiceRepository() + ->get($this->getRequest()->getParam('invoice_id')); + $this->registry->register('current_invoice', $invoice); + } catch (\Exception $e) { + $this->messageManager->addError(__('Invoice capturing error')); return false; } - /** @var \Magento\Sales\Model\Order\Invoice $invoice */ - $invoice = $this->_objectManager->create('Magento\Sales\Api\InvoiceRepositoryInterface')->get($invoiceId); - if (!$invoice) { - return false; - } - $this->registry->register('current_invoice', $invoice); + return $invoice; } + + /** + * @return InvoiceRepository + */ + private function getInvoiceRepository() + { + if ($this->invoiceRepository === null) { + $this->invoiceRepository = ObjectManager::getInstance() + ->get(InvoiceRepositoryInterface::class); + } + + return $this->invoiceRepository; + } } diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/AddCommentTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/AddCommentTest.php index 93d776a35d1f1..33d89a4173706 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/AddCommentTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/AddCommentTest.php @@ -7,10 +7,12 @@ use Magento\Backend\App\Action; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Sales\Api\InvoiceRepositoryInterface; /** * Class AddCommentTest * @package Magento\Sales\Controller\Adminhtml\Order\Invoice + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class AddCommentTest extends \PHPUnit_Framework_TestCase { @@ -34,11 +36,6 @@ class AddCommentTest extends \PHPUnit_Framework_TestCase */ protected $viewMock; - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $objectManagerMock; - /** * @var \Magento\Framework\View\Result\Page|\PHPUnit_Framework_MockObject_MockObject */ @@ -79,6 +76,11 @@ class AddCommentTest extends \PHPUnit_Framework_TestCase */ protected $resultJsonMock; + /** + * @var InvoiceRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $invoiceRepository; + /** * SetUp method * @@ -104,10 +106,6 @@ protected function setUp() ->disableOriginalConstructor() ->setMethods([]) ->getMock(); - $this->objectManagerMock = $this->getMockBuilder('Magento\Framework\ObjectManagerInterface') - ->disableOriginalConstructor() - ->setMethods([]) - ->getMock(); $this->resultPageMock = $this->getMockBuilder('Magento\Framework\View\Result\Page') ->disableOriginalConstructor() ->getMock(); @@ -133,9 +131,6 @@ protected function setUp() $contextMock->expects($this->any()) ->method('getView') ->will($this->returnValue($this->viewMock)); - $contextMock->expects($this->any()) - ->method('getObjectManager') - ->will($this->returnValue($this->objectManagerMock)); $this->viewMock->expects($this->any()) ->method('getPage') ->willReturn($this->resultPageMock); @@ -150,26 +145,26 @@ protected function setUp() ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); - $this->resultJsonMock = $this->getMockBuilder('Magento\Framework\Controller\Result\Json') ->disableOriginalConstructor() ->setMethods([]) ->getMock(); - $this->resultRawFactoryMock = $this->getMockBuilder('Magento\Framework\Controller\Result\RawFactory') ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); - $this->resultJsonFactoryMock = $this->getMockBuilder('Magento\Framework\Controller\Result\JsonFactory') ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); - $this->commentSenderMock = $this->getMockBuilder('Magento\Sales\Model\Order\Email\Sender\InvoiceCommentSender') ->disableOriginalConstructor() ->setMethods([]) ->getMock(); + $this->invoiceRepository = $this->getMockBuilder(InvoiceRepositoryInterface::class) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $this->controller = $objectManager->getObject( 'Magento\Sales\Controller\Adminhtml\Order\Invoice\AddComment', [ @@ -180,6 +175,12 @@ protected function setUp() 'resultJsonFactory' => $this->resultJsonFactoryMock ] ); + + $objectManager->setBackwardCompatibleProperty( + $this->controller, + 'invoiceRepository', + $this->invoiceRepository + ); } /** @@ -218,16 +219,9 @@ public function testExecute() $invoiceMock->expects($this->once()) ->method('save'); - $invoiceRepository = $this->getMockBuilder('Magento\Sales\Api\InvoiceRepositoryInterface') - ->disableOriginalConstructor() - ->getMock(); - $invoiceRepository->expects($this->any()) + $this->invoiceRepository->expects($this->once()) ->method('get') ->willReturn($invoiceMock); - $this->objectManagerMock->expects($this->once()) - ->method('create') - ->with('Magento\Sales\Api\InvoiceRepositoryInterface') - ->willReturn($invoiceRepository); $commentsBlockMock = $this->getMockBuilder('Magento\Sales\Block\Adminhtml\Order\Invoice\View\Comments') ->disableOriginalConstructor() diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/CancelTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/CancelTest.php index 6331e60c69d1c..56c3cf42146a8 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/CancelTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/CancelTest.php @@ -7,6 +7,7 @@ use Magento\Backend\App\Action; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Sales\Api\InvoiceRepositoryInterface; /** * Class CancelTest @@ -64,6 +65,11 @@ class CancelTest extends \PHPUnit_Framework_TestCase */ protected $controller; + /** + * @var InvoiceRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $invoiceRepository; + /** * @return void */ @@ -141,6 +147,10 @@ protected function setUp() ->method('getResultRedirectFactory') ->willReturn($this->resultRedirectFactoryMock); + $this->invoiceRepository = $this->getMockBuilder(InvoiceRepositoryInterface::class) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $this->controller = $objectManager->getObject( 'Magento\Sales\Controller\Adminhtml\Order\Invoice\Cancel', [ @@ -148,6 +158,12 @@ protected function setUp() 'resultForwardFactory' => $this->resultForwardFactoryMock ] ); + + $objectManager->setBackwardCompatibleProperty( + $this->controller, + 'invoiceRepository', + $this->invoiceRepository + ); } /** @@ -196,18 +212,11 @@ public function testExecute() ->method('addSuccess') ->with('You canceled the invoice.'); - $invoiceRepository = $this->getMockBuilder('Magento\Sales\Api\InvoiceRepositoryInterface') - ->disableOriginalConstructor() - ->getMock(); - $invoiceRepository->expects($this->any()) + $this->invoiceRepository->expects($this->once()) ->method('get') ->willReturn($invoiceMock); - $this->objectManagerMock->expects($this->at(0)) - ->method('create') - ->with('Magento\Sales\Api\InvoiceRepositoryInterface') - ->willReturn($invoiceRepository); - $this->objectManagerMock->expects($this->at(1)) + $this->objectManagerMock->expects($this->once()) ->method('create') ->with('Magento\Framework\DB\Transaction') ->will($this->returnValue($transactionMock)); @@ -241,18 +250,10 @@ public function testExecuteNoInvoice() ->with('invoice_id') ->will($this->returnValue($invoiceId)); - $invoiceRepository = $this->getMockBuilder('Magento\Sales\Api\InvoiceRepositoryInterface') - ->disableOriginalConstructor() - ->getMock(); - $invoiceRepository->expects($this->any()) + $this->invoiceRepository->expects($this->once()) ->method('get') ->willReturn(null); - $this->objectManagerMock->expects($this->at(0)) - ->method('create') - ->with('Magento\Sales\Api\InvoiceRepositoryInterface') - ->willReturn($invoiceRepository); - $resultForward = $this->getMockBuilder('Magento\Backend\Model\View\Result\Forward') ->disableOriginalConstructor() ->setMethods([]) @@ -297,18 +298,10 @@ public function testExecuteModelException() ->method('getId') ->will($this->returnValue($invoiceId)); - $invoiceRepository = $this->getMockBuilder('Magento\Sales\Api\InvoiceRepositoryInterface') - ->disableOriginalConstructor() - ->getMock(); - $invoiceRepository->expects($this->any()) + $this->invoiceRepository->expects($this->once()) ->method('get') ->willReturn($invoiceMock); - $this->objectManagerMock->expects($this->once()) - ->method('create') - ->with('Magento\Sales\Api\InvoiceRepositoryInterface') - ->willReturn($invoiceRepository); - $resultRedirect = $this->getMockBuilder('Magento\Backend\Model\View\Result\Redirect') ->disableOriginalConstructor() ->setMethods([]) @@ -353,18 +346,10 @@ public function testExecuteException() ->method('getId') ->will($this->returnValue($invoiceId)); - $invoiceRepository = $this->getMockBuilder('Magento\Sales\Api\InvoiceRepositoryInterface') - ->disableOriginalConstructor() - ->getMock(); - $invoiceRepository->expects($this->any()) + $this->invoiceRepository->expects($this->once()) ->method('get') ->willReturn($invoiceMock); - $this->objectManagerMock->expects($this->once()) - ->method('create') - ->with('Magento\Sales\Api\InvoiceRepositoryInterface') - ->willReturn($invoiceRepository); - $resultRedirect = $this->getMockBuilder('Magento\Backend\Model\View\Result\Redirect') ->disableOriginalConstructor() ->setMethods([]) diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/CaptureTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/CaptureTest.php index e74264e8fb681..88d39a0a885f0 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/CaptureTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/CaptureTest.php @@ -7,6 +7,7 @@ use Magento\Backend\App\Action; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Sales\Api\InvoiceRepositoryInterface; /** * Class CaptureTest @@ -69,6 +70,11 @@ class CaptureTest extends \PHPUnit_Framework_TestCase */ protected $invoiceManagement; + /** + * @var InvoiceRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $invoiceRepository; + /** * @return void */ @@ -149,11 +155,13 @@ protected function setUp() $this->invoiceManagement = $this->getMockBuilder('Magento\Sales\Api\InvoiceManagementInterface') ->disableOriginalConstructor() ->getMock(); - $this->objectManagerMock->expects($this->any()) ->method('get') ->with('Magento\Sales\Api\InvoiceManagementInterface') ->willReturn($this->invoiceManagement); + $this->invoiceRepository = $this->getMockBuilder(InvoiceRepositoryInterface::class) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); $this->controller = $objectManager->getObject( 'Magento\Sales\Controller\Adminhtml\Order\Invoice\Capture', @@ -162,6 +170,12 @@ protected function setUp() 'resultForwardFactory' => $this->resultForwardFactoryMock, ] ); + + $objectManager->setBackwardCompatibleProperty( + $this->controller, + 'invoiceRepository', + $this->invoiceRepository + ); } /** @@ -219,18 +233,11 @@ public function testExecute() ->method('getId') ->will($this->returnValue($invoiceId)); - $invoiceRepository = $this->getMockBuilder('Magento\Sales\Api\InvoiceRepositoryInterface') - ->disableOriginalConstructor() - ->getMock(); - $invoiceRepository->expects($this->any()) + $this->invoiceRepository->expects($this->once()) ->method('get') ->willReturn($invoiceMock); - $this->objectManagerMock->expects($this->at(0)) - ->method('create') - ->with('Magento\Sales\Api\InvoiceRepositoryInterface') - ->willReturn($invoiceRepository); - $this->objectManagerMock->expects($this->at(2)) + $this->objectManagerMock->expects($this->at(1)) ->method('create') ->with('Magento\Framework\DB\Transaction') ->will($this->returnValue($transactionMock)); @@ -259,18 +266,10 @@ public function testExecuteNoInvoice() ->with('invoice_id') ->will($this->returnValue($invoiceId)); - $invoiceRepository = $this->getMockBuilder('Magento\Sales\Api\InvoiceRepositoryInterface') - ->disableOriginalConstructor() - ->getMock(); - $invoiceRepository->expects($this->any()) + $this->invoiceRepository->expects($this->once()) ->method('get') ->willReturn(null); - $this->objectManagerMock->expects($this->once()) - ->method('create') - ->with('Magento\Sales\Api\InvoiceRepositoryInterface') - ->willReturn($invoiceRepository); - $resultForward = $this->getMockBuilder('Magento\Backend\Model\View\Result\Forward') ->disableOriginalConstructor() ->getMock(); @@ -318,18 +317,10 @@ public function testExecuteModelException() ->method('getEntityId') ->will($this->returnValue($invoiceId)); - $invoiceRepository = $this->getMockBuilder('Magento\Sales\Api\InvoiceRepositoryInterface') - ->disableOriginalConstructor() - ->getMock(); - $invoiceRepository->expects($this->any()) + $this->invoiceRepository->expects($this->once()) ->method('get') ->willReturn($invoiceMock); - $this->objectManagerMock->expects($this->once()) - ->method('create') - ->with('Magento\Sales\Api\InvoiceRepositoryInterface') - ->willReturn($invoiceRepository); - $resultRedirect = $this->getMockBuilder('Magento\Backend\Model\View\Result\Redirect') ->disableOriginalConstructor() ->getMock(); @@ -377,18 +368,10 @@ public function testExecuteException() ->method('getEntityId') ->will($this->returnValue($invoiceId)); - $invoiceRepository = $this->getMockBuilder('Magento\Sales\Api\InvoiceRepositoryInterface') - ->disableOriginalConstructor() - ->getMock(); - $invoiceRepository->expects($this->any()) + $this->invoiceRepository->expects($this->once()) ->method('get') ->willReturn($invoiceMock); - $this->objectManagerMock->expects($this->once()) - ->method('create') - ->with('Magento\Sales\Api\InvoiceRepositoryInterface') - ->willReturn($invoiceRepository); - $resultRedirect = $this->getMockBuilder('Magento\Backend\Model\View\Result\Redirect') ->disableOriginalConstructor() ->setMethods([]) diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/ViewTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/ViewTest.php index 8e4ade54c2911..1a6ca7c8b3e22 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/ViewTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/ViewTest.php @@ -7,6 +7,7 @@ use Magento\Backend\App\Action; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Sales\Api\InvoiceRepositoryInterface; /** * Class ViewTest @@ -49,11 +50,6 @@ class ViewTest extends \PHPUnit_Framework_TestCase */ protected $invoiceLoaderMock; - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $objectManagerMock; - /** * @var \Magento\Backend\Model\View\Result\Page|\PHPUnit_Framework_MockObject_MockObject */ @@ -84,6 +80,11 @@ class ViewTest extends \PHPUnit_Framework_TestCase */ protected $resultForwardFactoryMock; + /** + * @var InvoiceRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $invoiceRepository; + protected function setUp() { $objectManager = new ObjectManager($this); @@ -112,7 +113,6 @@ protected function setUp() ->disableOriginalConstructor() ->setMethods(['getCommentText', 'setIsUrlNotice']) ->getMock(); - $this->objectManagerMock = $this->getMock('Magento\Framework\ObjectManagerInterface'); $this->resultPageMock = $this->getMockBuilder('Magento\Backend\Model\View\Result\Page') ->disableOriginalConstructor() ->getMock(); @@ -145,9 +145,6 @@ protected function setUp() $contextMock->expects($this->any()) ->method('getSession') ->will($this->returnValue($this->sessionMock)); - $contextMock->expects($this->any()) - ->method('getObjectManager') - ->will($this->returnValue($this->objectManagerMock)); $this->viewMock->expects($this->any()) ->method('getPage') ->willReturn($this->resultPageMock); @@ -162,11 +159,13 @@ protected function setUp() ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); - $this->resultForwardFactoryMock = $this->getMockBuilder('Magento\Backend\Model\View\Result\ForwardFactory') ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); + $this->invoiceRepository = $this->getMockBuilder(InvoiceRepositoryInterface::class) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); $this->controller = $objectManager->getObject( 'Magento\Sales\Controller\Adminhtml\Order\Invoice\View', @@ -176,6 +175,12 @@ protected function setUp() 'resultForwardFactory' => $this->resultForwardFactoryMock ] ); + + $objectManager->setBackwardCompatibleProperty( + $this->controller, + 'invoiceRepository', + $this->invoiceRepository + ); } public function testExecute() @@ -226,18 +231,10 @@ public function testExecute() ->setMethods([]) ->getMock(); - $invoiceRepository = $this->getMockBuilder('Magento\Sales\Api\InvoiceRepositoryInterface') - ->disableOriginalConstructor() - ->getMock(); - $invoiceRepository->expects($this->any()) + $this->invoiceRepository->expects($this->once()) ->method('get') ->willReturn($invoiceMock); - $this->objectManagerMock->expects($this->at(0)) - ->method('create') - ->with('Magento\Sales\Api\InvoiceRepositoryInterface') - ->willReturn($invoiceRepository); - $this->resultPageMock->expects($this->once())->method('setActiveMenu')->with('Magento_Sales::sales_order'); $this->resultPageFactoryMock->expects($this->once()) @@ -256,18 +253,10 @@ public function testExecuteNoInvoice() ->with('invoice_id') ->will($this->returnValue($invoiceId)); - $invoiceRepository = $this->getMockBuilder('Magento\Sales\Api\InvoiceRepositoryInterface') - ->disableOriginalConstructor() - ->getMock(); - $invoiceRepository->expects($this->any()) + $this->invoiceRepository->expects($this->once()) ->method('get') ->willReturn(null); - $this->objectManagerMock->expects($this->at(0)) - ->method('create') - ->with('Magento\Sales\Api\InvoiceRepositoryInterface') - ->willReturn($invoiceRepository); - $resultForward = $this->getMockBuilder('Magento\Backend\Model\View\Result\Forward') ->disableOriginalConstructor() ->setMethods([]) diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/VoidTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/VoidTest.php index 4cd66680b139d..305c55ba63dca 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/VoidTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/VoidTest.php @@ -7,6 +7,7 @@ use Magento\Backend\App\Action; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Sales\Api\InvoiceRepositoryInterface; /** * Class VoidTest @@ -74,8 +75,14 @@ class VoidTest extends \PHPUnit_Framework_TestCase */ protected $invoiceManagement; + /** + * @var InvoiceRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $invoiceRepository; + /** * @return void + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ protected function setUp() { @@ -167,6 +174,10 @@ protected function setUp() ->method('getResultRedirectFactory') ->willReturn($this->resultRedirectFactoryMock); + $this->invoiceRepository = $this->getMockBuilder(InvoiceRepositoryInterface::class) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $this->controller = $objectManager->getObject( 'Magento\Sales\Controller\Adminhtml\Order\Invoice\Void', [ @@ -174,6 +185,12 @@ protected function setUp() 'resultForwardFactory' => $this->resultForwardFactoryMock ] ); + + $objectManager->setBackwardCompatibleProperty( + $this->controller, + 'invoiceRepository', + $this->invoiceRepository + ); } /** @@ -225,18 +242,11 @@ public function testExecute() $transactionMock->expects($this->at(2)) ->method('save'); - $invoiceRepository = $this->getMockBuilder('Magento\Sales\Api\InvoiceRepositoryInterface') - ->disableOriginalConstructor() - ->getMock(); - $invoiceRepository->expects($this->any()) + $this->invoiceRepository->expects($this->once()) ->method('get') ->willReturn($invoiceMock); - $this->objectManagerMock->expects($this->at(0)) - ->method('create') - ->with('Magento\Sales\Api\InvoiceRepositoryInterface') - ->willReturn($invoiceRepository); - $this->objectManagerMock->expects($this->at(2)) + $this->objectManagerMock->expects($this->at(1)) ->method('create') ->with('Magento\Framework\DB\Transaction') ->will($this->returnValue($transactionMock)); @@ -270,18 +280,10 @@ public function testExecuteNoInvoice() ->with('invoice_id') ->will($this->returnValue($invoiceId)); - $invoiceRepository = $this->getMockBuilder('Magento\Sales\Api\InvoiceRepositoryInterface') - ->disableOriginalConstructor() - ->getMock(); - $invoiceRepository->expects($this->any()) + $this->invoiceRepository->expects($this->once()) ->method('get') ->willReturn(null); - $this->objectManagerMock->expects($this->once()) - ->method('create') - ->with('Magento\Sales\Api\InvoiceRepositoryInterface') - ->willReturn($invoiceRepository); - $this->messageManagerMock->expects($this->never()) ->method('addError'); $this->messageManagerMock->expects($this->never()) @@ -329,18 +331,10 @@ public function testExecuteModelException() ->method('getId') ->will($this->returnValue($invoiceId)); - $invoiceRepository = $this->getMockBuilder('Magento\Sales\Api\InvoiceRepositoryInterface') - ->disableOriginalConstructor() - ->getMock(); - $invoiceRepository->expects($this->any()) + $this->invoiceRepository->expects($this->once()) ->method('get') ->willReturn($invoiceMock); - $this->objectManagerMock->expects($this->once()) - ->method('create') - ->with('Magento\Sales\Api\InvoiceRepositoryInterface') - ->willReturn($invoiceRepository); - $this->messageManagerMock->expects($this->once()) ->method('addError'); From 1664c512d20d2430fbf552145f93685a811eea57 Mon Sep 17 00:00:00 2001 From: Ivan Gavryshko Date: Wed, 18 May 2016 13:40:40 -0500 Subject: [PATCH 032/345] MAGETWO-52914: Setup UI Modifications - added show unstable checkbox to controll select version dropdown - by default we show only stable versions --- setup/pub/magento/setup/select-version.js | 46 ++++++++++++------- .../src/Magento/Setup/Model/SystemPackage.php | 38 +++++++++++++++ setup/view/magento/setup/select-version.phtml | 15 ++++++ 3 files changed, 82 insertions(+), 17 deletions(-) diff --git a/setup/pub/magento/setup/select-version.js b/setup/pub/magento/setup/select-version.js index 8e9eba9c5c413..89bf9b63c1be4 100644 --- a/setup/pub/magento/setup/select-version.js +++ b/setup/pub/magento/setup/select-version.js @@ -17,6 +17,7 @@ angular.module('select-version', ['ngStorage']) $scope.componentsReadyForNext = true; $scope.componentsProcessed = false; $scope.componentsProcessError = false; + $scope.showUnstable = false; $scope.tryAgainEnabled = function() { return ($scope.upgradeProcessed || $scope.upgradeProcessError) @@ -28,31 +29,23 @@ angular.module('select-version', ['ngStorage']) $http.get('index.php/select-version/systemPackage', {'responseType' : 'json'}) .success(function (data) { if (data.responseType != 'error') { - if (data.packages.length == 1 && data.packages[0].versions.length <=1) { + if (data.packages.length == 1) { $scope.upgradeProcessError = true; $scope.upgradeProcessErrorMessage = "You're already using the latest version, there's nothing for us to do."; } else { $scope.selectedOption = []; $scope.versions = []; - for (var i = 0; i < data.packages.length; i++) { - angular.forEach(data.packages[i].versions, function (value, key) { + $scope.data = data; + angular.forEach(data.packages, function (value, key) { + if (value.stable) { $scope.versions.push({ 'versionInfo': angular.toJson({ - 'package': data.packages[i].package, - 'version': value - }), 'version': value + 'package': value.package, + 'version': value.id + }), + 'version': value }); - }); - } - - $scope.versions = $scope.versions.sort(function (a, b) { - if (a.version.id < b.version.id) { - return 1; - } - if (a.version.id > b.version.id) { - return -1; } - return 0; }); $scope.selectedOption = $scope.versions[0].versionInfo; $scope.upgradeReadyForNext = true; @@ -160,10 +153,29 @@ angular.module('select-version', ['ngStorage']) return false; }; + $scope.showUnstableClick = function() { + $scope.upgradeReadyForNext = false; + $scope.selectedOption = []; + $scope.versions = []; + angular.forEach($scope.data.packages, function (value, key) { + if (value.stable || $scope.showUnstable) { + $scope.versions.push({ + 'versionInfo': angular.toJson({ + 'package': value.package, + 'version': value.id + }), + 'version': value + }); + } + }); + $scope.selectedOption = $scope.versions[0].versionInfo; + $scope.upgradeReadyForNext = true; + } + $scope.update = function() { var selectedVersionInfo = angular.fromJson($scope.selectedOption); $scope.packages[0]['name'] = selectedVersionInfo.package; - $scope.packages[0].version = selectedVersionInfo.version.id; + $scope.packages[0].version = selectedVersionInfo.version; if (angular.equals($scope.updateComponents.no, true)) { if ($scope.totalForGrid > 0) { $scope.packages.splice(1, $scope.totalForGrid); diff --git a/setup/src/Magento/Setup/Model/SystemPackage.php b/setup/src/Magento/Setup/Model/SystemPackage.php index 6ac9b9d3a60bc..5b920d298d781 100755 --- a/setup/src/Magento/Setup/Model/SystemPackage.php +++ b/setup/src/Magento/Setup/Model/SystemPackage.php @@ -87,6 +87,8 @@ public function getPackageVersions() if (!in_array('magento/product-enterprise-edition', $systemPackages)) { $result = array_merge($this->getAllowedEnterpriseVersions($currentCE), $result); } + + $result = $this->formatPackages($result); return $result; } @@ -194,6 +196,42 @@ public function sortVersions($enterpriseVersions) return $enterpriseVersions; } + /** + * @param array $packages + * @return array + */ + private function formatPackages($packages) { + + $versions = []; + + foreach ($packages as $package) { + foreach ($package['versions'] as $version) { + $version['package'] = $package['package']; + + if (preg_match('/^[0-9].[0-9].[0-9]$/', $version['id']) || strpos($version['name'], 'current')) { + $version['stable'] = true; + } else { + $version['name'] = $version['name'] . ' (unstable version)'; + $version['stable'] = false; + } + + $versions[] = $version; + } + } + + usort($versions, function ($versionOne, $versionTwo) { + if (version_compare($versionOne['id'], $versionTwo['id'], '==')) { + if ($versionOne['package'] === 'magento/product-community-edition') { + return 1; + } + return 0; + } + return (version_compare($versionOne['id'], $versionTwo['id'], '<')) ? 1 : -1; + }); + + return $versions; + } + /** * @param string $currentCE * @param array $enterpriseVersions diff --git a/setup/view/magento/setup/select-version.phtml b/setup/view/magento/setup/select-version.phtml index 17ed7061b1d4e..4f71e0885dbad 100644 --- a/setup/view/magento/setup/select-version.phtml +++ b/setup/view/magento/setup/select-version.phtml @@ -56,6 +56,21 @@ +
+
+ +
+
+ +
+
From f3f70f18d909383e57cd3d355324d632211021ed Mon Sep 17 00:00:00 2001 From: Ivan Gavryshko Date: Wed, 18 May 2016 13:59:33 -0500 Subject: [PATCH 033/345] MAGETWO-52914: Setup UI Modifications - fixed code static --- setup/src/Magento/Setup/Model/SystemPackage.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup/src/Magento/Setup/Model/SystemPackage.php b/setup/src/Magento/Setup/Model/SystemPackage.php index 5b920d298d781..393d901400359 100755 --- a/setup/src/Magento/Setup/Model/SystemPackage.php +++ b/setup/src/Magento/Setup/Model/SystemPackage.php @@ -197,10 +197,13 @@ public function sortVersions($enterpriseVersions) } /** + * Re-formats packages array to merge packages, sort versions and add technical data + * * @param array $packages * @return array */ - private function formatPackages($packages) { + private function formatPackages($packages) + { $versions = []; From 5f37661c4fd8e3541dcb3a7e36c1f1d145e59ed0 Mon Sep 17 00:00:00 2001 From: Ivan Gavryshko Date: Wed, 18 May 2016 14:11:37 -0500 Subject: [PATCH 034/345] MAGETWO-52914: Setup UI Modifications - fixed unittes --- .../Test/Unit/Model/SystemPackageTest.php | 44 +++++++++++++------ 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/setup/src/Magento/Setup/Test/Unit/Model/SystemPackageTest.php b/setup/src/Magento/Setup/Test/Unit/Model/SystemPackageTest.php index b9dde9b9176ab..39df8b2870412 100644 --- a/setup/src/Magento/Setup/Test/Unit/Model/SystemPackageTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Model/SystemPackageTest.php @@ -115,23 +115,41 @@ public function testGetPackageVersions() $expected = [ [ + 'id' => '1.2.0', + 'name' => 'Version 1.2.0 EE (latest)', + 'package' => 'magento/product-enterprise-edition', + 'stable' => true + ], + [ + 'id' => '1.2.0', + 'name' => 'Version 1.2.0 CE (latest)', 'package' => 'magento/product-community-edition', - 'versions' => - [ - ['id' => '1.2.0', 'name' => 'Version 1.2.0 CE (latest)'], - ['id' => '1.1.0', 'name' => 'Version 1.1.0 CE'], - ['id' => '1.0.0', 'name' => 'Version 1.0.0 CE (current)'] - ] + 'stable' => true ], [ + 'id' => '1.1.0', + 'name' => 'Version 1.1.0 EE', 'package' => 'magento/product-enterprise-edition', - 'versions' => - [ - ['id' => '1.2.0', 'name' => 'Version 1.2.0 EE (latest)'], - ['id' => '1.1.0', 'name' => 'Version 1.1.0 EE'], - ['id' => '1.0.0', 'name' => 'Version 1.0.0 EE (current)'] - ] - ] + 'stable' => true + ], + [ + 'id' => '1.1.0', + 'name' => 'Version 1.1.0 CE', + 'package' => 'magento/product-community-edition', + 'stable' => true + ], + [ + 'id' => '1.0.0', + 'name' => 'Version 1.0.0 EE (current)', + 'package' => 'magento/product-enterprise-edition', + 'stable' => true + ], + [ + 'id' => '1.0.0', + 'name' => 'Version 1.0.0 CE (current)', + 'package' => 'magento/product-community-edition', + 'stable' => true + ], ]; $this->infoCommand->expects($this->at(0)) From 5d8e3f38b610d8861804450db19bcd5fa2f9aea0 Mon Sep 17 00:00:00 2001 From: Maddy Chellathurai Date: Wed, 18 May 2016 14:38:15 -0500 Subject: [PATCH 035/345] MAGETWO-51929: Web Setup Wizard does not work when Magento is installed in pub - CR comments --- .../Backend/Model/Setup/MenuBuilder.php | 15 ++++--- .../Test/Unit/Model/MenuBuilderTest.php | 42 +++++++++++++++++++ .../App/{DocRoot.php => DocRootLocator.php} | 9 ++-- .../App/Test/Unit/DocRootLocatorTest.php | 41 ++++++++++++++++++ 4 files changed, 93 insertions(+), 14 deletions(-) create mode 100644 app/code/Magento/Backend/Test/Unit/Model/MenuBuilderTest.php rename lib/internal/Magento/Framework/App/{DocRoot.php => DocRootLocator.php} (79%) create mode 100644 lib/internal/Magento/Framework/App/Test/Unit/DocRootLocatorTest.php diff --git a/app/code/Magento/Backend/Model/Setup/MenuBuilder.php b/app/code/Magento/Backend/Model/Setup/MenuBuilder.php index 76d98a8a79fe8..70821e6ea85b5 100644 --- a/app/code/Magento/Backend/Model/Setup/MenuBuilder.php +++ b/app/code/Magento/Backend/Model/Setup/MenuBuilder.php @@ -7,27 +7,26 @@ use Magento\Backend\Model\Menu; use Magento\Backend\Model\Menu\Builder; -use Magento\Framework\App\DocRoot; +use Magento\Framework\App\DocRootLocator; /** * Plugin class to remove web setup wizard from menu if application root is pub/ and no setup url variable is specified. */ class MenuBuilder { - /** - * @var DocRoot + * @var DocRootLocator */ - protected $docRoot; + protected $docRootLocator; /** * MenuBuilder constructor. * - * @param DocRoot $docRoot + * @param DocRootLocator $docRootLocator */ - public function __construct(DocRoot $docRoot) + public function __construct(DocRootLocator $docRootLocator) { - $this->docRoot = $docRoot; + $this->docRootLocator = $docRootLocator; } /** @@ -40,7 +39,7 @@ public function __construct(DocRoot $docRoot) */ public function afterGetResult(Builder $subject, Menu $menu) { - if ($this->docRoot->hasThisSubDir('pub', 'setup')) { + if ($this->docRootLocator->isPub()) { $menu->remove('Magento_Backend::setup_wizard'); } return $menu; diff --git a/app/code/Magento/Backend/Test/Unit/Model/MenuBuilderTest.php b/app/code/Magento/Backend/Test/Unit/Model/MenuBuilderTest.php new file mode 100644 index 0000000000000..677c7f77e0be4 --- /dev/null +++ b/app/code/Magento/Backend/Test/Unit/Model/MenuBuilderTest.php @@ -0,0 +1,42 @@ +getMock('\Magento\Framework\App\DocRootLocator', [], [], '', false); + $docRootLocator->expects($this->once())->method('isPub')->willReturn($isPub); + $model = new MenuBuilder($docRootLocator); + /** @var \Magento\Backend\Model\Menu $menu */ + $menu = $this->getMock('\Magento\Backend\Model\Menu', [], [], '', false); + $menu->expects($this->exactly($times))->method('remove')->willReturn(true); + + /** @var \Magento\Backend\Model\Menu\Builder $menuBuilder */ + $menuBuilder = $this->getMock('\Magento\Backend\Model\Menu\Builder', [], [], '', false); + + $this->assertInstanceOf( + '\Magento\Backend\Model\Menu', + $model->afterGetResult($menuBuilder, $menu) + ); + } + + public function afterGetResultDataProvider() + { + return [[true, 1], [false, 0],]; + } +} diff --git a/lib/internal/Magento/Framework/App/DocRoot.php b/lib/internal/Magento/Framework/App/DocRootLocator.php similarity index 79% rename from lib/internal/Magento/Framework/App/DocRoot.php rename to lib/internal/Magento/Framework/App/DocRootLocator.php index 39a71f7e9b86a..39d40a6f1a00e 100644 --- a/lib/internal/Magento/Framework/App/DocRoot.php +++ b/lib/internal/Magento/Framework/App/DocRootLocator.php @@ -12,7 +12,7 @@ /** * This class calculates if document root is set to pub */ -class DocRoot +class DocRootLocator { /** * @var RequestInterface @@ -37,15 +37,12 @@ public function __construct(RequestInterface $request, ReadFactory $readFactory) /** * Returns true if doc root is pub/ and not BP * - * @param string $dirToCheck - * @param string $missingDir - * * @return bool */ - public function hasThisSubDir($dirToCheck, $missingDir) + public function isPub() { $rootBasePath = $this->request->getServer('DOCUMENT_ROOT'); $readDirectory = $this->readFactory->create(DirectoryList::ROOT); - return strpos($rootBasePath, $dirToCheck) && !$readDirectory->isExist($rootBasePath + $missingDir); + return strpos($rootBasePath, 'pub') && !$readDirectory->isExist($rootBasePath . 'setup'); } } diff --git a/lib/internal/Magento/Framework/App/Test/Unit/DocRootLocatorTest.php b/lib/internal/Magento/Framework/App/Test/Unit/DocRootLocatorTest.php new file mode 100644 index 0000000000000..59ec0721c9204 --- /dev/null +++ b/lib/internal/Magento/Framework/App/Test/Unit/DocRootLocatorTest.php @@ -0,0 +1,41 @@ +getMock('\Magento\Framework\App\Request\Http', [], [], '', false); + $request->expects($this->once())->method('getServer')->willReturn($path); + $reader = $this->getMock('\Magento\Framework\Filesystem\Directory\Read', [], [], '', false); + $reader->expects($this->any())->method('isExist')->willReturn($isExist); + $readFactory = $this->getMock('\Magento\Framework\Filesystem\Directory\ReadFactory', [], [], '', false); + $readFactory->expects($this->once())->method('create')->willReturn($reader); + $model = new DocRootLocator($request, $readFactory); + $this->assertSame($result, $model->isPub()); + } + + public function isPubDataProvider() + { + return [ + ['/some/path/to/root', false, false], + ['/some/path/to/root', true, false], + ['/some/path/to/pub', false, true], + ['/some/path/to/pub', true, false], + ]; + } +} From 54e00ace154ca23f17235b2a3e54f1a3c3246899 Mon Sep 17 00:00:00 2001 From: Ivan Gavryshko Date: Wed, 18 May 2016 15:18:10 -0500 Subject: [PATCH 036/345] MAGETWO-52914: Setup UI Modifications - fixed static test - added test coverage for unstable versions --- .../Test/Unit/Model/SystemPackageTest.php | 108 ++++++++++-------- 1 file changed, 61 insertions(+), 47 deletions(-) diff --git a/setup/src/Magento/Setup/Test/Unit/Model/SystemPackageTest.php b/setup/src/Magento/Setup/Test/Unit/Model/SystemPackageTest.php index 39df8b2870412..552a0f0408cf5 100644 --- a/setup/src/Magento/Setup/Test/Unit/Model/SystemPackageTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Model/SystemPackageTest.php @@ -45,6 +45,60 @@ class SystemPackageTest extends \PHPUnit_Framework_TestCase */ private $composer; + /** + * @var array + */ + private $expectedPackages = [ + [ + 'id' => '1.2.0', + 'name' => 'Version 1.2.0 EE (latest)', + 'package' => 'magento/product-enterprise-edition', + 'stable' => true + ], + [ + 'id' => '1.2.0', + 'name' => 'Version 1.2.0 CE (latest)', + 'package' => 'magento/product-community-edition', + 'stable' => true + ], + [ + 'id' => '1.1.0', + 'name' => 'Version 1.1.0 EE', + 'package' => 'magento/product-enterprise-edition', + 'stable' => true + ], + [ + 'id' => '1.1.0', + 'name' => 'Version 1.1.0 CE', + 'package' => 'magento/product-community-edition', + 'stable' => true + ], + [ + 'id' => '1.1.0-RC1', + 'name' => 'Version 1.1.0-RC1 EE (unstable version)', + 'package' => 'magento/product-enterprise-edition', + 'stable' => false + ], + [ + 'id' => '1.1.0-RC1', + 'name' => 'Version 1.1.0-RC1 CE (unstable version)', + 'package' => 'magento/product-community-edition', + 'stable' => false + ], + [ + 'id' => '1.0.0', + 'name' => 'Version 1.0.0 EE (current)', + 'package' => 'magento/product-enterprise-edition', + 'stable' => true + ], + [ + 'id' => '1.0.0', + 'name' => 'Version 1.0.0 CE (current)', + 'package' => 'magento/product-community-edition', + 'stable' => true + ], + ]; + /** * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\Composer\ComposerInformation */ @@ -113,45 +167,6 @@ public function testGetPackageVersions() $this->systemPackage = new SystemPackage($this->composerAppFactory, $this->composerInformation); - $expected = [ - [ - 'id' => '1.2.0', - 'name' => 'Version 1.2.0 EE (latest)', - 'package' => 'magento/product-enterprise-edition', - 'stable' => true - ], - [ - 'id' => '1.2.0', - 'name' => 'Version 1.2.0 CE (latest)', - 'package' => 'magento/product-community-edition', - 'stable' => true - ], - [ - 'id' => '1.1.0', - 'name' => 'Version 1.1.0 EE', - 'package' => 'magento/product-enterprise-edition', - 'stable' => true - ], - [ - 'id' => '1.1.0', - 'name' => 'Version 1.1.0 CE', - 'package' => 'magento/product-community-edition', - 'stable' => true - ], - [ - 'id' => '1.0.0', - 'name' => 'Version 1.0.0 EE (current)', - 'package' => 'magento/product-enterprise-edition', - 'stable' => true - ], - [ - 'id' => '1.0.0', - 'name' => 'Version 1.0.0 CE (current)', - 'package' => 'magento/product-community-edition', - 'stable' => true - ], - ]; - $this->infoCommand->expects($this->at(0)) ->method('run') ->with('magento/product-community-edition') @@ -160,14 +175,14 @@ public function testGetPackageVersions() 'name' => 'magento/product-community-edition', 'description' => 'eCommerce Platform for Growth (Enterprise Edition)', 'keywords' => '', - 'versions' => '1.2.0, 1.1.0, * 1.0.0', + 'versions' => '1.2.0, 1.1.0, 1.1.0-RC1, * 1.0.0', 'type' => 'metapackage', 'license' => 'OSL-3.0, AFL-3.0', 'source' => '[]', 'names' => 'magento/product-community-edition', 'current_version' => '1.0.0', - 'available_versions' => [1 => '1.2.0', 2 => '1.1.0', 3 => '1.0.0'], - 'new_versions' => ['1.2.0', '1.1.0'] + 'available_versions' => [1 => '1.2.0', 2 => '1.1.0', 3 => '1.1.0-RC1', 4 => '1.0.0'], + 'new_versions' => ['1.2.0', '1.1.0', '1.1.0-RC1'] ] ); @@ -179,18 +194,17 @@ public function testGetPackageVersions() 'name' => 'magento/product-enterprise-edition', 'description' => 'eCommerce Platform for Growth (Enterprise Edition)', 'keywords' => '', - 'versions' => '1.2.0, 1.1.0, * 1.0.0', + 'versions' => '1.2.0, 1.1.0, 1.1.0-RC1, * 1.0.0', 'type' => 'metapackage', 'license' => 'OSL-3.0, AFL-3.0', 'source' => '[]', 'names' => 'magento/product-enterprise-edition', 'current_version' => '1.0.0', - 'available_versions' => [1 => '1.2.0', 2 => '1.1.0', 3 => '1.0.0'], - 'new_versions' => ['1.2.0', '1.1.0'] + 'available_versions' => [1 => '1.2.0', 2 => '1.1.0', 3 => '1.1.0-RC1', 4 => '1.0.0'], + 'new_versions' => ['1.2.0', '1.1.0', '1.1.0-RC1'] ] ); - - $this->assertEquals($expected, $this->systemPackage->getPackageVersions()); + $this->assertEquals($this->expectedPackages, $this->systemPackage->getPackageVersions()); } /** From cc042e52b53b450de9d0777ace3066e218a7364e Mon Sep 17 00:00:00 2001 From: Roman Ganin Date: Thu, 19 May 2016 13:06:41 +0300 Subject: [PATCH 037/345] MAGETWO-52961: URL Rewrites incorrectly work with several store views --- .../CatalogUrlRewrite/Model/ProductUrlPathGenerator.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/CatalogUrlRewrite/Model/ProductUrlPathGenerator.php b/app/code/Magento/CatalogUrlRewrite/Model/ProductUrlPathGenerator.php index 935b638d48df6..20f6922e0f885 100644 --- a/app/code/Magento/CatalogUrlRewrite/Model/ProductUrlPathGenerator.php +++ b/app/code/Magento/CatalogUrlRewrite/Model/ProductUrlPathGenerator.php @@ -60,9 +60,9 @@ public function getUrlPath($product, $category = null) { $path = $product->getData('url_path'); if ($path === null) { - $path = $product->getUrlKey() === false - ? $this->prepareProductDefaultUrlKey($product) - : $this->prepareProductUrlKey($product); + $path = $product->getUrlKey() + ? $this->prepareProductUrlKey($product) + : $this->prepareProductDefaultUrlKey($product); } return $category === null ? $path From 93af3a1a7d948866d72535a8e27483d58647488c Mon Sep 17 00:00:00 2001 From: Vlad Veselov Date: Thu, 19 May 2016 09:49:55 -0400 Subject: [PATCH 038/345] Use splat operator instead of ReflectionClass::newInstanceArgs - it is possible due to no PHP 5.5 supported anymore --- .../ObjectManager/Factory/AbstractFactory.php | 114 +----------------- .../Unit/Helper/ObjectManager.php | 71 +++++------ 2 files changed, 34 insertions(+), 151 deletions(-) diff --git a/lib/internal/Magento/Framework/ObjectManager/Factory/AbstractFactory.php b/lib/internal/Magento/Framework/ObjectManager/Factory/AbstractFactory.php index d226faef11858..cbf7e37220b4b 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Factory/AbstractFactory.php +++ b/lib/internal/Magento/Framework/ObjectManager/Factory/AbstractFactory.php @@ -86,123 +86,11 @@ public function setArguments($arguments) * @param array $args * * @return object - * @SuppressWarnings(PHPMD.CyclomaticComplexity) - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) * */ protected function createObject($type, $args) { - switch (count($args)) { - case 0: - return new $type(); - case 1: - return new $type($args[0]); - case 2: - return new $type($args[0], $args[1]); - case 3: - return new $type($args[0], $args[1], $args[2]); - case 4: - return new $type($args[0], $args[1], $args[2], $args[3]); - case 5: - return new $type($args[0], $args[1], $args[2], $args[3], $args[4]); - case 6: - return new $type($args[0], $args[1], $args[2], $args[3], $args[4], $args[5]); - case 7: - return new $type($args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6]); - case 8: - return new $type($args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6], $args[7]); - case 9: - return new $type( - $args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6], $args[7], $args[8] - ); - case 10: - return new $type( - $args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6], $args[7], $args[8], $args[9] - ); - case 11: - return new $type( - $args[0], - $args[1], - $args[2], - $args[3], - $args[4], - $args[5], - $args[6], - $args[7], - $args[8], - $args[9], - $args[10] - ); - case 12: - return new $type( - $args[0], - $args[1], - $args[2], - $args[3], - $args[4], - $args[5], - $args[6], - $args[7], - $args[8], - $args[9], - $args[10], - $args[11] - ); - case 13: - return new $type( - $args[0], - $args[1], - $args[2], - $args[3], - $args[4], - $args[5], - $args[6], - $args[7], - $args[8], - $args[9], - $args[10], - $args[11], - $args[12] - ); - case 14: - return new $type( - $args[0], - $args[1], - $args[2], - $args[3], - $args[4], - $args[5], - $args[6], - $args[7], - $args[8], - $args[9], - $args[10], - $args[11], - $args[12], - $args[13] - ); - case 15: - return new $type( - $args[0], - $args[1], - $args[2], - $args[3], - $args[4], - $args[5], - $args[6], - $args[7], - $args[8], - $args[9], - $args[10], - $args[11], - $args[12], - $args[13], - $args[14] - ); - default: - $reflection = new \ReflectionClass($type); - return $reflection->newInstanceArgs($args); - } + return new $type(...$args); } /** diff --git a/lib/internal/Magento/Framework/TestFramework/Unit/Helper/ObjectManager.php b/lib/internal/Magento/Framework/TestFramework/Unit/Helper/ObjectManager.php index 4f7f73871ebe8..9a8cbaa9ae867 100644 --- a/lib/internal/Magento/Framework/TestFramework/Unit/Helper/ObjectManager.php +++ b/lib/internal/Magento/Framework/TestFramework/Unit/Helper/ObjectManager.php @@ -185,55 +185,50 @@ public function getObject($className, array $arguments = []) */ protected function getBuilder($className, array $arguments) { - $objectFactory = $this->_testObject->getMock('Magento\Framework\Api\ObjectFactory', [], [], '', false); - if (!isset($arguments['objectFactory'])) { - $arguments['objectFactory'] = $objectFactory; - } + $objectFactory = $this->_testObject->getMock('Magento\Framework\Api\ObjectFactory', [], [], '', false); - $constructArguments = $this->getConstructArguments($className, $arguments); - $reflectionClass = new \ReflectionClass($className); - $builderObject = $reflectionClass->newInstanceArgs($constructArguments); - - $objectFactory->expects($this->_testObject->any()) - ->method('populateWithArray') - ->will($this->_testObject->returnSelf()); - $objectFactory->expects($this->_testObject->any()) - ->method('populate') - ->will($this->_testObject->returnSelf()); - $objectFactory->expects($this->_testObject->any()) - ->method('create') - ->will($this->_testObject->returnCallback( - function ($className, $arguments) { - $reflectionClass = new \ReflectionClass($className); - $constructorMethod = $reflectionClass->getConstructor(); - $parameters = $constructorMethod->getParameters(); - $args = []; - foreach ($parameters as $parameter) { - $parameterName = $parameter->getName(); - if (isset($arguments[$parameterName])) { - $args[] = $arguments[$parameterName]; - } else { - if ($parameter->isArray()) { - $args[] = []; - } elseif ($parameter->allowsNull()) { - $args[] = null; + $objectFactory->expects($this->_testObject->any()) + ->method('populateWithArray') + ->will($this->_testObject->returnSelf()); + $objectFactory->expects($this->_testObject->any()) + ->method('populate') + ->will($this->_testObject->returnSelf()); + $objectFactory->expects($this->_testObject->any()) + ->method('create') + ->will($this->_testObject->returnCallback( + function ($className, $arguments) { + $reflectionClass = new \ReflectionClass($className); + $constructorMethod = $reflectionClass->getConstructor(); + $parameters = $constructorMethod->getParameters(); + $args = []; + foreach ($parameters as $parameter) { + $parameterName = $parameter->getName(); + if (isset($arguments[$parameterName])) { + $args[] = $arguments[$parameterName]; } else { - $mock = $this->_getMockWithoutConstructorCall($parameter->getClass()->getName()); - $args[] = $mock; + if ($parameter->isArray()) { + $args[] = []; + } elseif ($parameter->allowsNull()) { + $args[] = null; + } else { + $mock = $this->_getMockWithoutConstructorCall($parameter->getClass()->getName()); + $args[] = $mock; + } } } + return new $className(...$args); } + )); - return $reflectionClass->newInstanceArgs($args); - } - )); + $arguments['objectFactory'] = $objectFactory; + } - return $builderObject; + return new $className(...array_values($this->getConstructArguments($className, $arguments))); } /** - * Retrieve list of arguments that used for new object instance creation + * Retrieve associative array of arguments that used for new object instance creation * * @param string $className * @param array $arguments From 07b49c76126ca244cfd80d68ef8f1117181d57fd Mon Sep 17 00:00:00 2001 From: Denys Rul Date: Mon, 23 May 2016 11:33:11 +0300 Subject: [PATCH 039/345] MAGETWO-50522: Wysiwyg editor is removing html5 tags - Implement and apply HTML5 schema based on the data used in TinyMCE 4.x --- .../wysiwyg/tiny_mce/html5-schema.js | 204 ++++++++++++++++++ .../mage/adminhtml/wysiwyg/tiny_mce/setup.js | 48 ++++- 2 files changed, 243 insertions(+), 9 deletions(-) create mode 100644 lib/web/mage/adminhtml/wysiwyg/tiny_mce/html5-schema.js diff --git a/lib/web/mage/adminhtml/wysiwyg/tiny_mce/html5-schema.js b/lib/web/mage/adminhtml/wysiwyg/tiny_mce/html5-schema.js new file mode 100644 index 0000000000000..a74a9f12fb2df --- /dev/null +++ b/lib/web/mage/adminhtml/wysiwyg/tiny_mce/html5-schema.js @@ -0,0 +1,204 @@ +/** + * Copyright © 2016 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +define([ + 'underscore' +], function (_) { + 'use strict'; + + /* eslint-disable max-len */ + + var schema = { + blockContent: [ + 'address', 'article', 'aside', 'blockquote', 'details', 'dialog', 'div', 'dl', 'fieldset', + 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hgroup', 'hr', + 'menu', 'nav', 'ol', 'p', 'pre', 'section', 'table', 'ul' + ], + phrasingContent: [ + '#comment', '#text', 'a', 'abbr', 'audio', 'b', 'bdi', 'bdo', 'br', 'button', 'canvas', + 'cite','code', 'command', 'datalist', 'del', 'dfn', 'em', 'embed', 'i', 'iframe', 'img', + 'input', 'ins', 'kbd', 'keygen', 'label', 'map', 'mark', 'meter', 'noscript', 'object', + 'output', 'picture', 'progress', 'q', 'ruby', 's', 'samp', 'script', 'select', 'small', + 'span', 'strong', 'sub', 'sup', 'textarea', 'time', 'u', 'var', 'video', 'wbr' + ], + blockElements: [ + 'address', 'article', 'aside', 'blockquote', 'caption', 'center', 'datalist', 'dd', 'dir', 'div', + 'dl', 'dt', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', + 'header', 'hgroup', 'hr', 'isindex', 'li', 'menu', 'nav', 'noscript', 'ol', 'optgroup', 'option', + 'p', 'pre', 'section', 'select', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'ul' + ], + boolAttrs: [ + 'autoplay', 'checked', 'compact', 'controls', 'declare', 'defer', 'disabled', 'ismap', 'loop', + 'multiple', 'nohref', 'noresize', 'noshade', 'nowrap', 'readonly', 'selected' + ], + shortEnded: [ + 'area', 'base', 'basefont', 'br', 'col', 'embed', 'frame', 'hr', 'img', 'input', 'isindex', + 'link', 'meta', 'param', 'source', 'track', 'wbr' + ], + whiteSpace: [ + 'audio', 'iframe', 'noscript', 'object', 'pre', 'script', 'style', 'textarea', 'video' + ], + selfClosing: [ + 'colgroup', 'dd', 'dt', 'li', 'option', 'p', 'td', 'tfoot', 'th', 'thead', 'tr' + ] + }; + + schema.flowContent = schema.blockContent.concat(schema.phrasingContent, ['style']); + schema.nonEmpty = ['td', 'th', 'iframe', 'video', 'audio', 'object', 'script'].concat(schema.shortEnded); + + _.extend(schema, (function (phrasingContent, flowContent) { + var validElements = [], + validChildren = [], + compiled = {}, + globalAttrs, + rawData; + + globalAttrs = [ + 'id', 'dir', 'lang', 'class', 'style', 'title', 'hidden', 'onclick', 'onkeyup', + 'tabindex', 'dropzone', 'accesskey', 'draggable', 'translate', 'onmouseup', + 'onkeydown', 'spellcheck', 'ondblclick', 'onmouseout', 'onkeypress', 'contextmenu', + 'onmousedown', 'onmouseover', 'onmousemove', 'contenteditable' + ]; + + rawData = [ + ['html', 'manifest', 'head body'], + ['head', '', 'base command link meta noscript script style title'], + ['title hr noscript br'], + ['base', 'href target'], + ['link', 'href rel media hreflang type sizes hreflang'], + ['meta', 'name http-equiv content charset'], + ['style', 'media type scoped'], + ['script', 'src async defer type charset'], + ['body', 'onafterprint onbeforeprint onbeforeunload onblur onerror onfocus ' + + 'onhashchange onload onmessage onoffline ononline onpagehide onpageshow ' + + 'onpopstate onresize onscroll onstorage onunload background bgcolor text link vlink alink', flowContent + ], + ['caption', '', _.without(flowContent, 'table')], + ['address dt dd div', '', flowContent], + ['h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn', '', phrasingContent], + ['blockquote', 'cite', flowContent], + ['ol', 'reversed start type', 'li'], + ['ul', 'type compact', 'li'], + ['li', 'value type', flowContent], + ['dl', '', 'dt dd'], + ['a', 'href target rel media hreflang type charset name rev shape coords download', phrasingContent], + ['q', 'cite', phrasingContent], + ['ins del', 'cite datetime', flowContent], + ['img', 'src sizes srcset alt usemap ismap width height name longdesc align border hspace vspace'], + ['iframe', 'src name width height longdesc frameborder marginwidth marginheight scrolling align sandbox seamless allowfullscreen', flowContent], + ['embed', 'src type width height'], + ['object', 'data type typemustmatch name usemap form width height declare classid code codebase codetype archive standby align border hspace vspace', flowContent.concat(['param'])], + ['param', 'name value valuetype type'], + ['map', 'name', flowContent.concat(['area'])], + ['area', 'alt coords shape href target rel media hreflang type nohref'], + ['table', 'border summary width frame rules cellspacing cellpadding align bgcolor', 'caption colgroup thead tfoot tbody tr col'], + ['colgroup', 'span width align char charoff valign', 'col'], + ['col', 'span'], + ['tbody thead tfoot', 'align char charoff valign', 'tr'], + ['tr', 'align char charoff valign bgcolor', 'td th'], + ['td', 'colspan rowspan headers abbr axis scope align char charoff valign nowrap bgcolor width height', flowContent], + ['th', 'colspan rowspan headers scope abbr axis align char charoff valign nowrap bgcolor width height accept', flowContent], + ['form', 'accept-charset action autocomplete enctype method name novalidate target onsubmit onreset', flowContent], + ['fieldset', 'disabled form name', flowContent.concat(['legend'])], + ['label', 'form for', phrasingContent], + ['input', 'accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate ' + + 'formtarget height list max maxlength min multiple name pattern readonly required size src step type value width usemap align' + ], + ['button', 'disabled form formaction formenctype formmethod formnovalidate formtarget name type value', phrasingContent], + ['select', 'disabled form multiple name required size onfocus onblur onchange', 'option optgroup'], + ['optgroup', 'disabled label', 'option'], + ['option', 'disabled label selected value'], + ['textarea', 'cols dirname disabled form maxlength name readonly required rows wrap'], + ['menu', 'type label', flowContent.concat(['li'])], + ['noscript', '', flowContent], + ['wbr'], + ['ruby', '', phrasingContent.concat(['rt', 'rp'])], + ['figcaption', '', flowContent], + ['mark rt rp summary bdi', '', phrasingContent], + ['canvas', 'width height', flowContent], + ['video', 'src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered', flowContent.concat(['track', 'source'])], + ['audio', 'src crossorigin preload autoplay mediagroup loop muted controls buffered volume', flowContent.concat(['track', 'source'])], + ['picture', '', 'img source'], + ['source', 'src srcset type media sizes'], + ['track', 'kind src srclang label default'], + ['datalist', '', phrasingContent.concat(['option'])], + ['article section nav aside header footer', '', flowContent], + ['hgroup', '', 'h1 h2 h3 h4 h5 h6'], + ['figure', '', flowContent.concat(['figcaption'])], + ['time', 'datetime', phrasingContent], + ['dialog', 'open', flowContent], + ['command', 'type label icon disabled checked radiogroup command'], + ['output', 'for form name', phrasingContent], + ['progress', 'value max', phrasingContent], + ['meter', 'value min max low high optimum', phrasingContent], + ['details', 'open', flowContent.concat(['summary'])], + ['keygen', 'autofocus challenge disabled form keytype name'], + ['script', 'language xml:space'], + ['style', 'xml:space'], + ['embed', 'align name hspace vspace'], + ['br', 'clear'], + ['applet', 'codebase archive code object alt name width height align hspace vspace'], + ['font basefont', 'size color face'], + ['h1 h2 h3 h4 h5 h6 div p legend caption', 'align'], + ['ol dl menu dir', 'compact'], + ['pre', 'width xml:space'], + ['hr', 'align noshade size width'], + ['isindex', 'prompt'], + ['col', 'width align char charoff valign'], + ['input button select textarea', 'autofocus'], + ['input textarea', 'placeholder onselect onchange onfocus onblur'], + ['link script img', 'crossorigin'] + ]; + + rawData.forEach(function (data) { + var nodes = data[0].split(' '), + attributes = data[1] || [], + children = data[2] || [], + ni = nodes.length, + nodeName, + schemaData; + + if (typeof attributes === 'string') { + attributes = attributes.split(' '); + } + + if (typeof children === 'string') { + children = children.split(' '); + } + + while (ni--) { + nodeName = nodes[ni]; + schemaData = compiled[nodeName] || {}; + + compiled[nodeName] = { + attributes: _.union(schemaData.attributes, globalAttrs, attributes), + children: _.union(schemaData.children, children) + }; + } + }); + + ['a', 'dfn', 'form', 'meter', 'progress'].forEach(function (nodeName) { + var node = compiled[nodeName]; + + node.children = _.without(node.children, nodeName); + }); + + _.each(compiled, function (node, nodeName) { + var attributes = node.attributes.join('|'), + children = node.children.join('|'); + + validElements.push(nodeName + '[' + attributes + ']'); + validChildren.push(nodeName + '[' + children + ']'); + }); + + return { + nodes: compiled, + validElements: validElements, + validChildren: validChildren + }; + })(schema.phrasingContent, schema.flowContent)); + + return schema; +}); diff --git a/lib/web/mage/adminhtml/wysiwyg/tiny_mce/setup.js b/lib/web/mage/adminhtml/wysiwyg/tiny_mce/setup.js index 6f1952285549e..685502907bebb 100755 --- a/lib/web/mage/adminhtml/wysiwyg/tiny_mce/setup.js +++ b/lib/web/mage/adminhtml/wysiwyg/tiny_mce/setup.js @@ -6,11 +6,12 @@ define([ 'jquery', 'underscore', 'tinymce', + 'mage/adminhtml/wysiwyg/tiny_mce/html5-schema', 'mage/translate', 'prototype', 'mage/adminhtml/events', 'mage/adminhtml/browser' -], function(jQuery, _, tinyMCE) { +], function(jQuery, _, tinyMCE, html5Schema) { tinyMceWysiwygSetup = Class.create(); @@ -25,6 +26,7 @@ define([ this.id = htmlId; this.config = config; + this.schema = config.schema || html5Schema; _.bindAll(this, 'beforeSetContent', 'saveContent', 'onChangeContent', 'openFileBrowser', 'updateTextArea'); @@ -56,6 +58,7 @@ define([ getSettings: function(mode) { var plugins = 'inlinepopups,safari,pagebreak,style,layer,table,advhr,advimage,emotions,iespell,media,searchreplace,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras'; + var self = this; if (this.config.widget_plugin_src) { plugins = 'magentowidget,' + plugins; @@ -86,9 +89,8 @@ define([ theme_advanced_toolbar_location: 'top', theme_advanced_toolbar_align: 'left', theme_advanced_statusbar_location: 'bottom', - extended_valid_elements: 'style,input[placeholder|accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value]', - valid_children: '+body[style]', - custom_elements: 'style', + valid_elements: this.schema.validElements.join(','), + valid_children: this.schema.validChildren.join(','), theme_advanced_resizing: true, theme_advanced_resize_horizontal: false, convert_urls: false, @@ -99,6 +101,8 @@ define([ magentoPluginsOptions: magentoPluginsOptions, doctype: '', setup: function(ed){ + ed.onInit.add(self.onEditorInit.bind(self)); + ed.onSubmit.add(function(ed, e) { varienGlobalEvents.fireEvent('tinymceSubmit', e); }); @@ -162,6 +166,28 @@ define([ return settings; }, + applySchema: function (editor) { + var schema = editor.schema, + schemaData = this.schema, + makeMap = tinyMCE.makeMap; + + jQuery.extend(true, { + nonEmpty: schema.getNonEmptyElements(), + boolAttrs: schema.getBoolAttrs(), + whiteSpace: schema.getWhiteSpaceElements(), + shortEnded: schema.getShortEndedElements(), + selfClosing: schema.getSelfClosingElements(), + blockElements: schema.getBlockElements() + }, { + nonEmpty: makeMap(schemaData.nonEmpty), + boolAttrs: makeMap(schemaData.boolAttrs), + whiteSpace: makeMap(schemaData.whiteSpace), + shortEnded: makeMap(schemaData.shortEnded), + selfClosing: makeMap(schemaData.selfClosing), + blockElements: makeMap(schemaData.blockElements) + }); + }, + openFileBrowser: function(o) { var typeTitle, storeId = this.config.store_id !== null ? this.config.store_id : 0, @@ -215,21 +241,21 @@ define([ this.closePopups(); this.setup(mode); - + tinyMCE.execCommand('mceAddControl', false, this.id); - + this.getPluginButtons().each(function(e) { e.hide(); }); - + return this; }, turnOff: function() { this.closePopups(); - + tinyMCE.execCommand('mceRemoveControl', false, this.id); - + this.getPluginButtons().each(function(e) { e.show(); }); @@ -255,6 +281,10 @@ define([ } }, + onEditorInit: function (editor) { + this.applySchema(editor); + }, + onFormValidation: function() { if (tinyMCE.get(this.id)) { $(this.id).value = tinyMCE.get(this.id).getContent(); From 7a4f7850c923a01bb08bb06d27cb23568df9e669 Mon Sep 17 00:00:00 2001 From: Hayder Sharhan Date: Mon, 23 May 2016 17:45:42 -0500 Subject: [PATCH 040/345] MAGETWO-53008: [Github] Format of responses doesn't match Swagger - Convert swagger doc's model schema of the response to snake_case. --- .../Webapi/Model/Rest/Swagger/Generator.php | 39 ++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Webapi/Model/Rest/Swagger/Generator.php b/app/code/Magento/Webapi/Model/Rest/Swagger/Generator.php index 3a3b05645019c..0c4591c969949 100644 --- a/app/code/Magento/Webapi/Model/Rest/Swagger/Generator.php +++ b/app/code/Magento/Webapi/Model/Rest/Swagger/Generator.php @@ -541,10 +541,47 @@ protected function getDefinitions() ], ], ], - $this->definitions + $this->snakeCaseDefinitions($this->definitions) ); } + /** + * Converts definition's properties array into snake_case + * + * @param array $definitions + * @return array + */ + private function snakeCaseDefinitions($definitions) + { + foreach ($definitions as $name => $vals) { + if (!empty($vals['properties'])) { + $definitions[$name]['properties'] = $this->convertArrayToSnakeCase($vals['properties']); + } + } + return $definitions; + } + + /** + * Converts associative array's key names from camelCase into snake_case + * + * @param array $properties + * @return array + */ + private function convertArrayToSnakeCase($properties) + { + foreach ($properties as $name => $value) { + $snakeCaseName = preg_replace_callback( + "/([A-Z])/", + function ($matches) { return '_' . strtolower($matches[1]);}, + $name + ); + + $properties[$snakeCaseName] = $value; + unset($properties[$name]); + } + return $properties; + } + /** * Get definition reference * From fb08b7a8a6b8129eb827d9ac7f937d496abb7b9c Mon Sep 17 00:00:00 2001 From: "Kristof, Fooman" Date: Tue, 24 May 2016 15:18:38 +0200 Subject: [PATCH 041/345] Php 5.5 support was removed Removal of php 5.5 support should be reflected in the composer.json. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 83f10dac027d1..8a0df0af8f629 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ "AFL-3.0" ], "require": { - "php": "~5.5.22|~5.6.0|~7.0.0", + "php": "~5.6.0|~7.0.0", "zendframework/zend-stdlib": "~2.4.6", "zendframework/zend-code": "~2.4.6", "zendframework/zend-server": "~2.4.6", From 85abcdd93ebb7a8618353023f4934dc446f4cf9c Mon Sep 17 00:00:00 2001 From: "Kristof, Fooman" Date: Tue, 24 May 2016 16:23:35 +0200 Subject: [PATCH 042/345] Updated with specific Php 7 versions that are supported --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 8a0df0af8f629..f285a27bacc63 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ "AFL-3.0" ], "require": { - "php": "~5.6.0|~7.0.0", + "php": "~5.6.0|7.0.2|^7.0.6", "zendframework/zend-stdlib": "~2.4.6", "zendframework/zend-code": "~2.4.6", "zendframework/zend-server": "~2.4.6", From 3fabfa520e8d89ae92589bf2ac9cefc5d1e35794 Mon Sep 17 00:00:00 2001 From: "Partica, Cristian" Date: Tue, 24 May 2016 13:40:42 -0500 Subject: [PATCH 043/345] MAGETWO-50636: [API] For all the appropriate Rest calls with SearchCriteria filters, validate if response for search_criteria key is NOT null. - adding search criteria for the missing search action repositories --- app/code/Magento/Sales/Model/Order/AddressRepository.php | 2 +- app/code/Magento/Sales/Model/Order/CreditmemoRepository.php | 1 + app/code/Magento/Sales/Model/Order/InvoiceRepository.php | 1 + app/code/Magento/Sales/Model/Order/Payment/Repository.php | 1 + .../Sales/Model/Order/Payment/Transaction/Repository.php | 1 + app/code/Magento/Sales/Model/Order/ShipmentRepository.php | 2 +- 6 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Sales/Model/Order/AddressRepository.php b/app/code/Magento/Sales/Model/Order/AddressRepository.php index d314a08c10b72..8ca6285ca2c65 100644 --- a/app/code/Magento/Sales/Model/Order/AddressRepository.php +++ b/app/code/Magento/Sales/Model/Order/AddressRepository.php @@ -91,7 +91,7 @@ public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria) $searchResult->addFieldToFilter($filter->getField(), [$condition => $filter->getValue()]); } } - + $searchResult->setSearchCriteria($searchCriteria); $searchResult->setCurPage($searchCriteria->getCurrentPage()); $searchResult->setPageSize($searchCriteria->getPageSize()); diff --git a/app/code/Magento/Sales/Model/Order/CreditmemoRepository.php b/app/code/Magento/Sales/Model/Order/CreditmemoRepository.php index 439483fd65ba0..fb13153330312 100644 --- a/app/code/Magento/Sales/Model/Order/CreditmemoRepository.php +++ b/app/code/Magento/Sales/Model/Order/CreditmemoRepository.php @@ -99,6 +99,7 @@ public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria) $searchResult->addFieldToFilter($filter->getField(), [$condition => $filter->getValue()]); } } + $searchResult->setSearchCriteria($searchCriteria); $searchResult->setCurPage($searchCriteria->getCurrentPage()); $searchResult->setPageSize($searchCriteria->getPageSize()); return $searchResult; diff --git a/app/code/Magento/Sales/Model/Order/InvoiceRepository.php b/app/code/Magento/Sales/Model/Order/InvoiceRepository.php index 87f28c39bb050..38cd7bdc97f0f 100644 --- a/app/code/Magento/Sales/Model/Order/InvoiceRepository.php +++ b/app/code/Magento/Sales/Model/Order/InvoiceRepository.php @@ -95,6 +95,7 @@ public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria) $collection->addFieldToFilter($filter->getField(), [$condition => $filter->getValue()]); } } + $collection->setSearchCriteria($searchCriteria); $collection->setCurPage($searchCriteria->getCurrentPage()); $collection->setPageSize($searchCriteria->getPageSize()); return $collection; diff --git a/app/code/Magento/Sales/Model/Order/Payment/Repository.php b/app/code/Magento/Sales/Model/Order/Payment/Repository.php index c4a1cea24da6d..e3dd51e14132f 100644 --- a/app/code/Magento/Sales/Model/Order/Payment/Repository.php +++ b/app/code/Magento/Sales/Model/Order/Payment/Repository.php @@ -60,6 +60,7 @@ public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria) $collection->addFieldToFilter($filter->getField(), [$condition => $filter->getValue()]); } } + $collection->setSearchCriteria($searchCriteria); $collection->setCurPage($searchCriteria->getCurrentPage()); $collection->setPageSize($searchCriteria->getPageSize()); return $collection; diff --git a/app/code/Magento/Sales/Model/Order/Payment/Transaction/Repository.php b/app/code/Magento/Sales/Model/Order/Payment/Transaction/Repository.php index a9b66e71bf468..687260cb185cc 100644 --- a/app/code/Magento/Sales/Model/Order/Payment/Transaction/Repository.php +++ b/app/code/Magento/Sales/Model/Order/Payment/Transaction/Repository.php @@ -193,6 +193,7 @@ public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria) $collection->addFieldToFilter($filter->getField(), [$condition => $filter->getValue()]); } } + $collection->setSearchCriteria($searchCriteria); $collection->setCurPage($searchCriteria->getCurrentPage()); $collection->setPageSize($searchCriteria->getPageSize()); $collection->addPaymentInformation(['method']); diff --git a/app/code/Magento/Sales/Model/Order/ShipmentRepository.php b/app/code/Magento/Sales/Model/Order/ShipmentRepository.php index b1dce96d6a215..d32a5f83f2d41 100644 --- a/app/code/Magento/Sales/Model/Order/ShipmentRepository.php +++ b/app/code/Magento/Sales/Model/Order/ShipmentRepository.php @@ -91,7 +91,7 @@ public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria) $searchResult->addFieldToFilter($filter->getField(), [$condition => $filter->getValue()]); } } - + $searchResult->setSearchCriteria($searchCriteria); $searchResult->setCurPage($searchCriteria->getCurrentPage()); $searchResult->setPageSize($searchCriteria->getPageSize()); From 6f33dc8ef16cc27aed4d11e6e2166513c0dbe3a2 Mon Sep 17 00:00:00 2001 From: Igor Melnikov Date: Tue, 24 May 2016 13:45:02 -0500 Subject: [PATCH 044/345] MAGETWO-51578: Remove Cm_Cache_Backend_File and Cm_Cache_Backend_Redis libraries from the repo and install via composer Merging with remote tracking branch. Regenerating composer.lock --- composer.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.lock b/composer.lock index 32d85651b461a..144dd681be5bf 100644 --- a/composer.lock +++ b/composer.lock @@ -554,16 +554,16 @@ }, { "name": "magento/magento-composer-installer", - "version": "0.1.8", + "version": "0.1.9", "source": { "type": "git", "url": "https://github.com/magento/magento-composer-installer.git", - "reference": "3dfac2f626ca36053f68853afe8847f5b290c84d" + "reference": "109eedd74dc94ffe77e71bf91d594f6fa95dd33e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/magento/magento-composer-installer/zipball/3dfac2f626ca36053f68853afe8847f5b290c84d", - "reference": "3dfac2f626ca36053f68853afe8847f5b290c84d", + "url": "https://api.github.com/repos/magento/magento-composer-installer/zipball/109eedd74dc94ffe77e71bf91d594f6fa95dd33e", + "reference": "109eedd74dc94ffe77e71bf91d594f6fa95dd33e", "shasum": "" }, "require": { @@ -626,7 +626,7 @@ "composer-installer", "magento" ], - "time": "2016-05-17 20:24:41" + "time": "2016-05-24 16:22:26" }, { "name": "magento/zendframework1", From 495347656f240f7c83fa701d38fa04d169363afd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Corr=C3=AAa=20Gomes?= Date: Tue, 24 May 2016 17:22:13 -0300 Subject: [PATCH 045/345] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 62269ab7713e9..e3540d959fa5d 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Use the following table to verify you have the correct prerequisites to install Apache - PHP ~5.5.22,5.6.x or 7.0.2 – 7.0.4 + PHP 5.6.x or 7.0.2-7.0.6 (with exception of 7.0.5) php -v PHP Ubuntu
PHP CentOS From c2264e26a69c89d32f826392c837cd5b6d7e5961 Mon Sep 17 00:00:00 2001 From: "Partica, Cristian" Date: Tue, 24 May 2016 16:09:52 -0500 Subject: [PATCH 046/345] MAGETWO-50636: [API] For all the appropriate Rest calls with SearchCriteria filters, validate if response for search_criteria key is NOT null. - adding functional api assertion for modified repo - removing un-needed search criteria echo because it's only needed for exposed apis defined in webapi.xml --- app/code/Magento/Sales/Model/Order/AddressRepository.php | 1 - app/code/Magento/Sales/Model/Order/Payment/Repository.php | 1 - .../testsuite/Magento/Sales/Service/V1/CreditmemoListTest.php | 2 ++ .../testsuite/Magento/Sales/Service/V1/InvoiceListTest.php | 2 ++ .../testsuite/Magento/Sales/Service/V1/ShipmentListTest.php | 2 ++ .../testsuite/Magento/Sales/Service/V1/TransactionTest.php | 2 ++ 6 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Sales/Model/Order/AddressRepository.php b/app/code/Magento/Sales/Model/Order/AddressRepository.php index 8ca6285ca2c65..e075d4afdcd34 100644 --- a/app/code/Magento/Sales/Model/Order/AddressRepository.php +++ b/app/code/Magento/Sales/Model/Order/AddressRepository.php @@ -91,7 +91,6 @@ public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria) $searchResult->addFieldToFilter($filter->getField(), [$condition => $filter->getValue()]); } } - $searchResult->setSearchCriteria($searchCriteria); $searchResult->setCurPage($searchCriteria->getCurrentPage()); $searchResult->setPageSize($searchCriteria->getPageSize()); diff --git a/app/code/Magento/Sales/Model/Order/Payment/Repository.php b/app/code/Magento/Sales/Model/Order/Payment/Repository.php index e3dd51e14132f..c4a1cea24da6d 100644 --- a/app/code/Magento/Sales/Model/Order/Payment/Repository.php +++ b/app/code/Magento/Sales/Model/Order/Payment/Repository.php @@ -60,7 +60,6 @@ public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria) $collection->addFieldToFilter($filter->getField(), [$condition => $filter->getValue()]); } } - $collection->setSearchCriteria($searchCriteria); $collection->setCurPage($searchCriteria->getCurrentPage()); $collection->setPageSize($searchCriteria->getPageSize()); return $collection; diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoListTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoListTest.php index 34cd077c4620c..b6157c36a3766 100644 --- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoListTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoListTest.php @@ -85,5 +85,7 @@ public function testCreditmemoList() // TODO Test fails, due to the inability of the framework API to handle data collection $this->assertArrayHasKey('items', $result); $this->assertCount(1, $result['items']); + $this->assertArrayHasKey('search_criteria', $result); + $this->assertEquals($searchData, $result['search_criteria']); } } diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/InvoiceListTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/InvoiceListTest.php index 06b5856230b52..daad3c442ea7f 100644 --- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/InvoiceListTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/InvoiceListTest.php @@ -70,5 +70,7 @@ public function testInvoiceList() // TODO Test fails, due to the inability of the framework API to handle data collection $this->assertArrayHasKey('items', $result); $this->assertCount(1, $result['items']); + $this->assertArrayHasKey('search_criteria', $result); + $this->assertEquals($searchData, $result['search_criteria']); } } diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentListTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentListTest.php index f4cd591bba56b..6123d1a112a6d 100644 --- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentListTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentListTest.php @@ -63,5 +63,7 @@ public function testShipmentList() // TODO Test fails, due to the inability of the framework API to handle data collection $this->assertArrayHasKey('items', $result); $this->assertCount(1, $result['items']); + $this->assertArrayHasKey('search_criteria', $result); + $this->assertEquals($searchData, $result['search_criteria']); } } diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/TransactionTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/TransactionTest.php index b85ef9e08ce46..d88775f46f00c 100644 --- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/TransactionTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/TransactionTest.php @@ -141,6 +141,8 @@ public function testTransactionList($filters) $expectedData = [$transactionData, $childTransactionData]; $this->assertEquals($expectedData, $result['items']); + $this->assertArrayHasKey('search_criteria', $result); + $this->assertEquals($searchData, $result['search_criteria']); } /** From 210bdc55f7006b547fe21c8122c5865ab4dd313d Mon Sep 17 00:00:00 2001 From: Ievgen Sentiabov Date: Wed, 25 May 2016 13:25:44 +0300 Subject: [PATCH 047/345] MAGETWO-53286: Error while creating shipping label for FedEx - Refactored code to remove link for array --- app/code/Magento/Fedex/Model/Carrier.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/Fedex/Model/Carrier.php b/app/code/Magento/Fedex/Model/Carrier.php index 4cd95cb5b4ba9..2d9e162d85f1c 100644 --- a/app/code/Magento/Fedex/Model/Carrier.php +++ b/app/code/Magento/Fedex/Model/Carrier.php @@ -1260,7 +1260,6 @@ protected function _formShipmentRequest(\Magento\Framework\DataObject $request) $width = $packageParams->getWidth(); $length = $packageParams->getLength(); $weightUnits = $packageParams->getWeightUnits() == \Zend_Measure_Weight::POUND ? 'LB' : 'KG'; - $dimensionsUnits = $packageParams->getDimensionUnits() == \Zend_Measure_Length::INCH ? 'IN' : 'CM'; $unitPrice = 0; $itemsQty = 0; $itemsDesc = []; @@ -1403,12 +1402,12 @@ protected function _formShipmentRequest(\Magento\Framework\DataObject $request) // set dimensions if ($length || $width || $height) { - $requestClient['RequestedShipment']['RequestedPackageLineItems']['Dimensions'] = []; - $dimenssions = &$requestClient['RequestedShipment']['RequestedPackageLineItems']['Dimensions']; - $dimenssions['Length'] = $length; - $dimenssions['Width'] = $width; - $dimenssions['Height'] = $height; - $dimenssions['Units'] = $dimensionsUnits; + $requestClient['RequestedShipment']['RequestedPackageLineItems']['Dimensions'] = [ + 'Length' => $length, + 'Width' => $width, + 'Height' => $height, + 'Units' => $packageParams->getDimensionUnits() == \Zend_Measure_Length::INCH ? 'IN' : 'CM' + ]; } return $this->_getAuthDetails() + $requestClient; From 32a855055ca95d0b462b48733c18ee2113bc9c6f Mon Sep 17 00:00:00 2001 From: Denys Rul Date: Wed, 25 May 2016 14:25:48 +0300 Subject: [PATCH 048/345] MAGETWO-53263: [Github] Issue with blank theme search input #4282 - Prevent default label click behavior when search field is active --- .../Search/view/frontend/web/form-mini.js | 42 ++++++++++++++----- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/app/code/Magento/Search/view/frontend/web/form-mini.js b/app/code/Magento/Search/view/frontend/web/form-mini.js index cceda751f6317..7c9bc4255fb21 100644 --- a/app/code/Magento/Search/view/frontend/web/form-mini.js +++ b/app/code/Magento/Search/view/frontend/web/form-mini.js @@ -71,14 +71,18 @@ define([ }.bind(this) }); + this.searchLabel.on('click', function (e) { + // allow input to lose its' focus when clicking on label + if (this.isExpandable && this.isActive()) { + e.preventDefault(); + } + }.bind(this)); + this.element.on('blur', $.proxy(function () { setTimeout($.proxy(function () { if (this.autoComplete.is(':hidden')) { - this.searchLabel.removeClass('active'); - if (this.isExpandable === true) { - this.element.attr('aria-expanded', 'false'); - } + this.setActiveState(false); } this.autoComplete.hide(); this._updateAriaHasPopup(false); @@ -87,12 +91,7 @@ define([ this.element.trigger('blur'); - this.element.on('focus', $.proxy(function () { - this.searchLabel.addClass('active'); - if (this.isExpandable === true) { - this.element.attr('aria-expanded', 'true'); - } - }, this)); + this.element.on('focus', this.setActiveState.bind(this, true)); this.element.on('keydown', this._onKeyDown); this.element.on('input propertychange', this._onPropertyChange); @@ -101,6 +100,29 @@ define([ this._updateAriaHasPopup(false); }, this)); }, + + /** + * Checks if search field is active. + * + * @returns {Boolean} + */ + isActive: function () { + return this.searchLabel.hasClass('active'); + }, + + /** + * Sets state of the search field to provided value. + * + * @param {Boolean} isActive + */ + setActiveState: function (isActive) { + this.searchLabel.toggleClass('active', isActive); + + if (this.isExpandable) { + this.element.attr('aria-expanded', isActive); + } + }, + /** * @private * @return {Element} The first element in the suggestion list. From d608f9eb3ff35d60a90d7bab38db62e69f0b6f93 Mon Sep 17 00:00:00 2001 From: Oleksandr Miroshnichenko Date: Wed, 25 May 2016 16:23:52 +0300 Subject: [PATCH 049/345] MAGETWO-53439: [Github][PR] Removed inline JavaScript from template #4141 --- .../templates/product/view/addtocart.phtml | 31 +++++-------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/view/addtocart.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/view/addtocart.phtml index 9a7db79414836..063f4011879c7 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/view/addtocart.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/view/addtocart.phtml @@ -40,7 +40,6 @@
-isRedirectToCartEnabled()) : ?> - - \ No newline at end of file From e8eea7136b93d62cde15d190c24b8eae6dd53e31 Mon Sep 17 00:00:00 2001 From: Denys Rul Date: Wed, 25 May 2016 17:00:11 +0300 Subject: [PATCH 050/345] MAGETWO-50522: Wysiwyg editor is removing html5 tags - Fix code style --- lib/web/mage/adminhtml/wysiwyg/tiny_mce/setup.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/web/mage/adminhtml/wysiwyg/tiny_mce/setup.js b/lib/web/mage/adminhtml/wysiwyg/tiny_mce/setup.js index 685502907bebb..94de561da986d 100755 --- a/lib/web/mage/adminhtml/wysiwyg/tiny_mce/setup.js +++ b/lib/web/mage/adminhtml/wysiwyg/tiny_mce/setup.js @@ -57,8 +57,8 @@ define([ }, getSettings: function(mode) { - var plugins = 'inlinepopups,safari,pagebreak,style,layer,table,advhr,advimage,emotions,iespell,media,searchreplace,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras'; - var self = this; + var plugins = 'inlinepopups,safari,pagebreak,style,layer,table,advhr,advimage,emotions,iespell,media,searchreplace,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras', + self = this; if (this.config.widget_plugin_src) { plugins = 'magentowidget,' + plugins; From c8422e8fd20766605878d916f58d7c6bfa67fb4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Corr=C3=AAa=20Gomes?= Date: Wed, 25 May 2016 11:18:14 -0300 Subject: [PATCH 051/345] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e3540d959fa5d..5f6b4716af5d1 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Use the following table to verify you have the correct prerequisites to install Apache - PHP 5.6.x or 7.0.2-7.0.6 (with exception of 7.0.5) + PHP 5.6.x, 7.0.2 or 7.0.6 php -v PHP Ubuntu
PHP CentOS From ca0feac3d850268ff8526cbda73d99cff095e622 Mon Sep 17 00:00:00 2001 From: Iurii Ivashchenko Date: Wed, 25 May 2016 17:31:43 +0300 Subject: [PATCH 052/345] MAGETWO-53299: "Go Today" button is not working for dates range component --- lib/web/mage/calendar.js | 47 ++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/lib/web/mage/calendar.js b/lib/web/mage/calendar.js index 0f86c83e7f8be..4ebd91662812f 100644 --- a/lib/web/mage/calendar.js +++ b/lib/web/mage/calendar.js @@ -23,6 +23,24 @@ var calendarBasePrototype; + /** + * Get date/time according to store settings + * @returns {Date} + */ + function getTimezoneDate() { + // Get local time in ms + var ms = Date.now(), + options = $.calendarConfig ? $.calendarConfig : {}; + + // Use store timestamp based on store timezone settings + if (typeof options.serverTimezoneSeconds !== 'undefined') { + //Adjust milliseconds according to client local timezone offset + ms = (options.serverTimezoneSeconds + new Date().getTimezoneOffset() * 60) * 1000; + } + + return new Date(ms); + } + $.datepicker.markerClassName = '_has-datepicker'; /** @@ -72,8 +90,6 @@ * Wrapper for overwrite jQuery UI datepicker function. */ _overwriteGenerateHtml: function () { - var self = this; - /** * Overwrite jQuery UI datepicker function. * Reason: magento date could be set before calendar show @@ -83,7 +99,7 @@ * @return {String} html template */ $.datepicker.constructor.prototype._generateHTML = function (inst) { - var today = self.getTimezoneDate(), + var today = getTimezoneDate(), isRTL = this._get(inst, 'isRTL'), showButtonPanel = this._get(inst, 'showButtonPanel'), hideIfNoPrevNext = this._get(inst, 'hideIfNoPrevNext'), @@ -316,24 +332,6 @@ }; }, - /** - * If server timezone is defined then take to account server timezone shift - * @return {Object} date - */ - getTimezoneDate: function () { - - // Get local time in ms - var ms = Date.now(); - - // Use store timestamp based on store timezone settings - if (typeof this.options.serverTimezoneSeconds !== 'undefined') { - //Adjust milliseconds according to client local timezone offset - ms = (this.options.serverTimezoneSeconds + new Date().getTimezoneOffset() * 60) * 1000; - } - - return new Date(ms); - }, - /** * Set current date if the date is not set * @protected @@ -341,7 +339,7 @@ */ _setCurrentDate: function (element) { if (!element.val()) { - element[this._picker()]('setDate', this.getTimezoneDate()) + element[this._picker()]('setDate', getTimezoneDate()) .val(''); } }, @@ -356,6 +354,7 @@ pickerButtonText = picker.next('.ui-datepicker-trigger') .find('img') .attr('title'); + picker.next('.ui-datepicker-trigger') .addClass('v-middle') .text('') // Remove jQuery UI datepicker generated image @@ -523,8 +522,8 @@ $.datepicker._gotoToday = function (el) { var pickerObject = $(el); - // Set date/time according to timezone offset - pickerObject.datepicker( "setDate", pickerObject.calendar("getTimezoneDate") ) + //Set date/time according to timezone offset + pickerObject.datepicker('setDate', getTimezoneDate()) // To ensure that user can re-select date field without clicking outside it first. .blur(); }; From 7527a1e3ec2da98046183d66349bf08bda32e348 Mon Sep 17 00:00:00 2001 From: Roman Liukshyn Date: Wed, 25 May 2016 15:37:23 +0000 Subject: [PATCH 053/345] MAGETWO-53317: Unable to place order within direct payment method from admin - Solo/Switch cc form related methods are marked as deprecated - Start Year, Start Month and Issue Number fields are removed from cc forms --- app/code/Magento/Payment/Block/Form/Cc.php | 2 + app/code/Magento/Payment/Model/CcConfig.php | 2 + .../Payment/Model/CcGenericConfigProvider.php | 4 +- .../Payment/Test/Unit/Model/CcConfigTest.php | 11 --- .../view/adminhtml/templates/form/cc.phtml | 68 ------------------- .../view/frontend/templates/form/cc.phtml | 59 ---------------- .../web/template/payment/cc-form.html | 62 ----------------- .../Sales/Api/Data/OrderPaymentInterface.php | 18 ++++- .../Order/Create/Billing/Method/Form.php | 1 + .../Magento/Sales/Model/Order/Payment.php | 9 +++ 10 files changed, 31 insertions(+), 205 deletions(-) diff --git a/app/code/Magento/Payment/Block/Form/Cc.php b/app/code/Magento/Payment/Block/Form/Cc.php index 1871da613b254..a6eb1a9324f8e 100644 --- a/app/code/Magento/Payment/Block/Form/Cc.php +++ b/app/code/Magento/Payment/Block/Form/Cc.php @@ -108,6 +108,7 @@ public function hasVerification() /** * Whether switch/solo card type available * + * @deprecated * @return bool */ public function hasSsCardType() @@ -123,6 +124,7 @@ public function hasSsCardType() /** * Solo/switch card start year * + * @deprecated * @return array */ public function getSsStartYears() diff --git a/app/code/Magento/Payment/Model/CcConfig.php b/app/code/Magento/Payment/Model/CcConfig.php index e80edc45da0ef..605014519faa8 100644 --- a/app/code/Magento/Payment/Model/CcConfig.php +++ b/app/code/Magento/Payment/Model/CcConfig.php @@ -62,6 +62,7 @@ public function __construct( * Solo/switch card start years * * @return array + * @deprecated */ public function getSsStartYears() { @@ -119,6 +120,7 @@ public function hasVerification() * Whether switch/solo card type available * * @return bool + * @deprecated */ public function hasSsCardType() { diff --git a/app/code/Magento/Payment/Model/CcGenericConfigProvider.php b/app/code/Magento/Payment/Model/CcGenericConfigProvider.php index 768c1368f3af4..6c04de009a402 100644 --- a/app/code/Magento/Payment/Model/CcGenericConfigProvider.php +++ b/app/code/Magento/Payment/Model/CcGenericConfigProvider.php @@ -51,8 +51,6 @@ public function getConfig() 'months' => [$methodCode => $this->getCcMonths()], 'years' => [$methodCode => $this->getCcYears()], 'hasVerification' => [$methodCode => $this->hasVerification($methodCode)], - 'hasSsCardType' => [$methodCode => $this->hasSsCardType($methodCode)], - 'ssStartYears' => [$methodCode => $this->getSsStartYears()], 'cvvImageUrl' => [$methodCode => $this->getCvvImageUrl()] ] ] @@ -66,6 +64,7 @@ public function getConfig() * Solo/switch card start years * * @return array + * @deprecated */ protected function getSsStartYears() { @@ -144,6 +143,7 @@ protected function hasVerification($methodCode) * * @param string $methodCode * @return bool + * @deprecated */ protected function hasSsCardType($methodCode) { diff --git a/app/code/Magento/Payment/Test/Unit/Model/CcConfigTest.php b/app/code/Magento/Payment/Test/Unit/Model/CcConfigTest.php index aa4b8c0587a69..46663d30d8a0d 100644 --- a/app/code/Magento/Payment/Test/Unit/Model/CcConfigTest.php +++ b/app/code/Magento/Payment/Test/Unit/Model/CcConfigTest.php @@ -44,12 +44,6 @@ protected function setUp() ); } - public function testGetSsStartYears() - { - $this->assertCount(6, $this->model->getSsStartYears()); - $this->assertEquals(date("Y"), $this->model->getSsStartYears()[date("Y")]); - } - public function testGetCcAvailableTypes() { $data = [1, 2, 3]; @@ -85,11 +79,6 @@ public function testHasVerification() $this->assertEquals(true, $this->model->hasVerification()); } - public function testHasSsCardType() - { - $this->assertEquals(false, $this->model->hasSsCardType()); - } - public function testGetCvvImageUrl() { $params = ['_secure' => true]; diff --git a/app/code/Magento/Payment/view/adminhtml/templates/form/cc.phtml b/app/code/Magento/Payment/view/adminhtml/templates/form/cc.phtml index f07aceb5ddb5f..bddf821c3b376 100644 --- a/app/code/Magento/Payment/view/adminhtml/templates/form/cc.phtml +++ b/app/code/Magento/Payment/view/adminhtml/templates/form/cc.phtml @@ -80,72 +80,4 @@ $ccExpYear = $block->getInfoData('cc_exp_year'); - - hasSsCardType()): ?> -
-
- -
-
- - -
- -
-
-
- -
- - -
-
- -
 
- - -
- diff --git a/app/code/Magento/Payment/view/frontend/templates/form/cc.phtml b/app/code/Magento/Payment/view/frontend/templates/form/cc.phtml index 3a2a342c207fe..0f2782db469ac 100644 --- a/app/code/Magento/Payment/view/frontend/templates/form/cc.phtml +++ b/app/code/Magento/Payment/view/frontend/templates/form/cc.phtml @@ -109,64 +109,5 @@ $ccExpYear = $block->getInfoData('cc_exp_year'); - hasSsCardType()): ?> -
-
-
- -
-
- -
- -
-
- -
- -
-
-
-
- -
-
-
-
- -
-
-
-
-
-
 
-
-
- getChildHtml() ?> diff --git a/app/code/Magento/Payment/view/frontend/web/template/payment/cc-form.html b/app/code/Magento/Payment/view/frontend/web/template/payment/cc-form.html index 2b3ea564912b9..c1cc8f009bcec 100644 --- a/app/code/Magento/Payment/view/frontend/web/template/payment/cc-form.html +++ b/app/code/Magento/Payment/view/frontend/web/template/payment/cc-form.html @@ -124,66 +124,4 @@ - -
-
-
- -
-
- -
- -
-
- -
- -
-
-
-
- -
-
-
-
- -
-
-
-
-
-
 
-
-
- diff --git a/app/code/Magento/Sales/Api/Data/OrderPaymentInterface.php b/app/code/Magento/Sales/Api/Data/OrderPaymentInterface.php index 7e408a0ec5cf6..9bf5a60b0ec9e 100644 --- a/app/code/Magento/Sales/Api/Data/OrderPaymentInterface.php +++ b/app/code/Magento/Sales/Api/Data/OrderPaymentInterface.php @@ -110,8 +110,11 @@ interface OrderPaymentInterface extends \Magento\Framework\Api\ExtensibleDataInt * Credit card expiration month. */ const CC_EXP_MONTH = 'cc_exp_month'; - /* + + /** * Credit card SS start year. + * + * @deprecated */ const CC_SS_START_YEAR = 'cc_ss_start_year'; /* @@ -154,8 +157,11 @@ interface OrderPaymentInterface extends \Magento\Framework\Api\ExtensibleDataInt * Credit card debug response serialized. */ const CC_DEBUG_RESPONSE_SERIALIZED = 'cc_debug_response_serialized'; - /* + + /** * Credit card SS start month. + * + * @deprecated */ const CC_SS_START_MONTH = 'cc_ss_start_month'; /* @@ -206,8 +212,11 @@ interface OrderPaymentInterface extends \Magento\Framework\Api\ExtensibleDataInt * Credit card debug response body. */ const CC_DEBUG_RESPONSE_BODY = 'cc_debug_response_body'; - /* + + /** * Credit card SS issue. + * + * @deprecated */ const CC_SS_ISSUE = 'cc_ss_issue'; /* @@ -463,6 +472,7 @@ public function getCcSecureVerify(); * Gets the credit card SS issue for the order payment. * * @return string|null Credit card SS issue. + * @deprecated */ public function getCcSsIssue(); @@ -470,6 +480,7 @@ public function getCcSsIssue(); * Gets the credit card SS start month for the order payment. * * @return string|null Credit card SS start month. + * @deprecated */ public function getCcSsStartMonth(); @@ -477,6 +488,7 @@ public function getCcSsStartMonth(); * Gets the credit card SS start year for the order payment. * * @return string|null Credit card SS start year. + * @deprecated */ public function getCcSsStartYear(); diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Billing/Method/Form.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Billing/Method/Form.php index 99310038a02f4..8d769f53b36ff 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Billing/Method/Form.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Billing/Method/Form.php @@ -101,6 +101,7 @@ public function getQuote() * Whether switch/solo card type available * * @return true + * @deprecated */ public function hasSsCardType() { diff --git a/app/code/Magento/Sales/Model/Order/Payment.php b/app/code/Magento/Sales/Model/Order/Payment.php index 76f612851359d..31369455e8d74 100644 --- a/app/code/Magento/Sales/Model/Order/Payment.php +++ b/app/code/Magento/Sales/Model/Order/Payment.php @@ -1703,6 +1703,7 @@ public function getCcSecureVerify() * Returns cc_ss_issue * * @return string + * @deprecated */ public function getCcSsIssue() { @@ -1713,6 +1714,7 @@ public function getCcSsIssue() * Returns cc_ss_start_month * * @return string + * @deprecated */ public function getCcSsStartMonth() { @@ -1723,6 +1725,7 @@ public function getCcSsStartMonth() * Returns cc_ss_start_year * * @return string + * @deprecated */ public function getCcSsStartYear() { @@ -2087,6 +2090,8 @@ public function setCcExpMonth($ccExpMonth) /** * {@inheritdoc} + * + * @deprecated */ public function setCcSsStartYear($ccSsStartYear) { @@ -2175,6 +2180,8 @@ public function setCcDebugResponseSerialized($ccDebugResponseSerialized) /** * {@inheritdoc} + * + * @deprecated */ public function setCcSsStartMonth($ccSsStartMonth) { @@ -2279,6 +2286,8 @@ public function setCcDebugResponseBody($ccDebugResponseBody) /** * {@inheritdoc} + * + * @deprecated */ public function setCcSsIssue($ccSsIssue) { From f58a49880106d00353be6666870b770bc017605e Mon Sep 17 00:00:00 2001 From: "Partica, Cristian" Date: Wed, 25 May 2016 10:53:11 -0500 Subject: [PATCH 054/345] MAGETWO-50636: [API] For all the appropriate Rest calls with SearchCriteria filters, validate if response for search_criteria key is NOT null. - fixing search criteria assertion --- .../Magento/Sales/Service/V1/CreditmemoListTest.php | 3 ++- .../Magento/Sales/Service/V1/InvoiceListTest.php | 3 ++- .../Magento/Sales/Service/V1/ShipmentListTest.php | 10 +++++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoListTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoListTest.php index b6157c36a3766..18cababd5998c 100644 --- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoListTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoListTest.php @@ -62,7 +62,8 @@ public function testCreditmemoList() [ $filterBuilder ->setField('state') - ->setValue(\Magento\Sales\Model\Order\Creditmemo::STATE_OPEN) + ->setValue((string)\Magento\Sales\Model\Order\Creditmemo::STATE_OPEN) + ->setConditionType('eq') ->create(), ] ); diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/InvoiceListTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/InvoiceListTest.php index daad3c442ea7f..d19b9f53d9496 100644 --- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/InvoiceListTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/InvoiceListTest.php @@ -47,7 +47,8 @@ public function testInvoiceList() [ $filterBuilder ->setField('state') - ->setValue(2) + ->setValue((string)\Magento\Sales\Model\Order\Invoice::STATE_PAID) + ->setConditionType('eq') ->create(), ] ); diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentListTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentListTest.php index 6123d1a112a6d..89d377fb2aceb 100644 --- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentListTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentListTest.php @@ -43,7 +43,15 @@ public function testShipmentList() 'Magento\Framework\Api\FilterBuilder' ); - $searchCriteriaBuilder->addFilters([$filterBuilder->setField('shipment_status')->setValue(1)->create()]); + $searchCriteriaBuilder->addFilters( + [ + $filterBuilder + ->setField('shipment_status') + ->setValue((string)\Magento\Sales\Model\Order\Shipment::STATUS_NEW) + ->setConditionType('eq') + ->create() + ] + ); $searchData = $searchCriteriaBuilder->create()->__toArray(); $requestData = ['searchCriteria' => $searchData]; From d2932296704de215955149a4e0110392565f59e2 Mon Sep 17 00:00:00 2001 From: Hayder Sharhan Date: Wed, 25 May 2016 15:33:27 -0500 Subject: [PATCH 055/345] MAGETWO-53008: [Github] Format of responses doesn't match Swagger - Address notes from CR. --- .../Webapi/Model/Rest/Swagger/Generator.php | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/Webapi/Model/Rest/Swagger/Generator.php b/app/code/Magento/Webapi/Model/Rest/Swagger/Generator.php index 0c4591c969949..3ac5aa9306b93 100644 --- a/app/code/Magento/Webapi/Model/Rest/Swagger/Generator.php +++ b/app/code/Magento/Webapi/Model/Rest/Swagger/Generator.php @@ -546,7 +546,7 @@ protected function getDefinitions() } /** - * Converts definition's properties array into snake_case + * Converts definitions' properties array to snake_case. * * @param array $definitions * @return array @@ -557,12 +557,20 @@ private function snakeCaseDefinitions($definitions) if (!empty($vals['properties'])) { $definitions[$name]['properties'] = $this->convertArrayToSnakeCase($vals['properties']); } + if (!empty($vals['required'])) { + $snakeCaseRequired = []; + foreach ($vals['required'] as $requiredProperty) { + $snakeCaseRequired[] + = \Magento\Framework\Api\SimpleDataObjectConverter::camelCaseToSnakeCase($requiredProperty); + } + $definitions[$name]['required'] = $snakeCaseRequired; + } } return $definitions; } /** - * Converts associative array's key names from camelCase into snake_case + * Converts associative array's key names from camelCase to snake_case, recursively. * * @param array $properties * @return array @@ -570,14 +578,12 @@ private function snakeCaseDefinitions($definitions) private function convertArrayToSnakeCase($properties) { foreach ($properties as $name => $value) { - $snakeCaseName = preg_replace_callback( - "/([A-Z])/", - function ($matches) { return '_' . strtolower($matches[1]);}, - $name - ); - - $properties[$snakeCaseName] = $value; + $snakeCaseName = \Magento\Framework\Api\SimpleDataObjectConverter::camelCaseToSnakeCase($name); + if (is_array($value)) { + $value = $this->convertArrayToSnakeCase($value); + } unset($properties[$name]); + $properties[$snakeCaseName] = $value; } return $properties; } From be98d559010ea17bb01473261cbffe6925375b96 Mon Sep 17 00:00:00 2001 From: Dale Sikkema Date: Wed, 25 May 2016 15:44:46 -0500 Subject: [PATCH 056/345] MAGETWO-53126: [Github] Multi-Site Cache isn't showing the right site's content #4556 --- .../Framework/App/PageCache/Identifier.php | 3 +- .../Test/Unit/PageCache/IdentifierTest.php | 132 +++++++++++------- 2 files changed, 86 insertions(+), 49 deletions(-) diff --git a/lib/internal/Magento/Framework/App/PageCache/Identifier.php b/lib/internal/Magento/Framework/App/PageCache/Identifier.php index 0c95ded21bce4..f0d2c502406cd 100644 --- a/lib/internal/Magento/Framework/App/PageCache/Identifier.php +++ b/lib/internal/Magento/Framework/App/PageCache/Identifier.php @@ -40,8 +40,7 @@ public function __construct( public function getValue() { $data = [ - $this->request->isSecure(), - $this->request->getRequestUri(), + $this->request->getUriString(), $this->request->get(\Magento\Framework\App\Response\Http::COOKIE_VARY_STRING) ?: $this->context->getVaryString() ]; diff --git a/lib/internal/Magento/Framework/App/Test/Unit/PageCache/IdentifierTest.php b/lib/internal/Magento/Framework/App/Test/Unit/PageCache/IdentifierTest.php index c6fbe72a76367..79e433c2de4ef 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/PageCache/IdentifierTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/PageCache/IdentifierTest.php @@ -5,10 +5,17 @@ */ namespace Magento\Framework\App\Test\Unit\PageCache; +use Magento\Framework\App\Http\Context; +use Magento\Framework\App\PageCache\Identifier; +use Magento\Framework\App\Response\Http; +use Magento\Framework\App\Request\Http as HttpRequest; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; class IdentifierTest extends \PHPUnit_Framework_TestCase { + /** Test value for cache vary string */ + const VARY = '123'; + /** * @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager */ @@ -23,76 +30,107 @@ protected function setUp() } /** - * @param string $uri - * @param string|null $vary - * @return \Magento\Framework\App\Request\Http - */ - protected function getRequestMock($uri, $vary = null) - { - $requestMock = $this->getMock('\Magento\Framework\App\Request\Http', [], [], '', false); - $requestMock->expects($this->once()) - ->method('isSecure') - ->willReturn(false); - $requestMock->expects($this->once()) - ->method('getRequestUri') - ->willReturn($uri); - $requestMock->expects($this->once()) - ->method('get') - ->with($this->equalTo(\Magento\Framework\App\Response\Http::COOKIE_VARY_STRING)) - ->willReturn($vary); - return $requestMock; - } - - /** - * @param int $getVeryStringCalledTimes - * @param string|null $vary - * @return \Magento\Framework\App\Http\Context + * @param bool $expectToBeCalled + * + * @return Context | \PHPUnit_Framework_MockObject_MockObject */ - protected function getContextMock($getVeryStringCalledTimes, $vary) + private function getContextMock($expectToBeCalled) { - $contextMock = $this->getMock('\Magento\Framework\App\Http\Context', [], [], '', false); - $contextMock->expects($this->exactly($getVeryStringCalledTimes)) + $contextMock = $this->getMockBuilder(Context::class) + ->disableOriginalConstructor() + ->getMock(); + $contextMock->expects($this->exactly((int)$expectToBeCalled)) ->method('getVaryString') - ->willReturn($vary); + ->willReturn(self::VARY); return $contextMock; } /** * @param string $uri - * @param string|null $varyStringCookie - * @param string|null $varyStringContext + * @param bool $getVaryFromCookie * @param string $expected - * @dataProvider dataProvider + * + * @dataProvider getValueDataProvider */ - public function testGetValue($uri, $varyStringCookie, $varyStringContext, $expected) + public function testGetValue($uri, $getVaryFromCookie, $expected) { - $request = $this->getRequestMock($uri, $varyStringCookie); - $context = $this->getContextMock($varyStringCookie ? 0 : 1, $varyStringContext); + /** @var Http | \PHPUnit_Framework_MockObject_MockObject$requestMock */ + $requestMock = $this->getMockBuilder(HttpRequest::class) + ->disableOriginalConstructor() + ->getMock(); + $requestMock->method('getUriString') + ->willReturn($uri); + $requestMock->method('get') + ->with($this->equalTo(Http::COOKIE_VARY_STRING)) + ->willReturn($getVaryFromCookie ? self::VARY : null); - $model = $this->objectManager->getObject( - '\Magento\Framework\App\PageCache\Identifier', + $context = $this->getContextMock(!$getVaryFromCookie); + + $model = $this->getModel($requestMock, $context); + $this->assertEquals($expected, $model->getValue()); + } + + /** + * @param Http $request + * @param Context $context + * + * @return Identifier + */ + private function getModel($request, $context) + { + return $this->objectManager->getObject( + Identifier::class, [ 'request' => $request, 'context' => $context, ] ); - $this->assertEquals($expected, $model->getValue()); } - /** - * @return array - */ - public function dataProvider() + public function getValueDataProvider() { - $uri = 'http://domain.com/customer'; - $vary = 1; - $data = [false, $uri, $vary]; + $uri = 'http://example.com/customer'; + $vary = self::VARY; + $data = [$uri, $vary]; ksort($data); - $expected = md5(serialize($data)); + $expectedWithVaryString = md5(serialize($data)); return [ - [$uri, $vary, null, $expected], - [$uri, null, $vary, $expected] + 'Vary string retrieved from cookie' => [$uri, true, $expectedWithVaryString], + 'Vary string retrieved from context' => [$uri, false, $expectedWithVaryString], ]; } + + public function testCacheDifferentiators() + { + // Test that HTTP security status, path, and domain cause the identifier to be unique + $secureValues = [true, false]; + $requestPaths = ['/request/path/1', '/request/2', '/third/request']; + $domains = ['example.net', 'example.com']; + $contextMock = $this->getContextMock(true); + $varyStrings = []; + $uris = []; + foreach ($secureValues as $secure) { + foreach ($requestPaths as $path) { + foreach ($domains as $domain) { + $uris = ($secure ? 'https' : 'http') . '://' . $domain . $path; + } + } + } + $requestMock = $this->getMockBuilder(HttpRequest::class) + ->disableOriginalConstructor() + ->getMock(); + for ($i = 0; $i < count($uris); $i++) { + $requestMock->expects($this->at($i))->method('getUriString')->willReturn($uris[$i]); + } + $model = $this->getModel($requestMock, $contextMock); + for ($i = 0; $i < count($uris); $i++) { + $varyStrings[] = $model->getValue(); + } + $this->assertEquals( + count($varyStrings), + count(array_unique($varyStrings)), + 'Vary strings for different URIs are the same.' + ); + } } From 503643c342720dc02f7d6a1d4b3c812a78597115 Mon Sep 17 00:00:00 2001 From: Maddy Chellathurai Date: Wed, 25 May 2016 16:22:56 -0500 Subject: [PATCH 057/345] MAGETWO-53474: [Github] Caches Aren't Enabled by Default on RC1 with Composer when Upgrading via CLI - Moving logic to re-enable cache to setup:upgrade --- .../Magento/Framework/Code/GeneratedFiles.php | 2 ++ .../Setup/Console/Command/UpgradeCommand.php | 26 +++++++++++++++++++ .../Magento/Setup/Model/Cron/JobUpgrade.php | 22 ---------------- 3 files changed, 28 insertions(+), 22 deletions(-) diff --git a/lib/internal/Magento/Framework/Code/GeneratedFiles.php b/lib/internal/Magento/Framework/Code/GeneratedFiles.php index 99fb41c30a7c3..ec6e43b8c67f1 100644 --- a/lib/internal/Magento/Framework/Code/GeneratedFiles.php +++ b/lib/internal/Magento/Framework/Code/GeneratedFiles.php @@ -52,6 +52,7 @@ public function __construct(DirectoryList $directoryList, WriteFactory $writeFac public function regenerate() { if ($this->write->isExist(self::REGENERATE_FLAG)) { + //TODO: to be removed in scope of MAGETWO-53476 //clean cache $deploymentConfig = $this->directoryList->getPath(DirectoryList::CONFIG); $configPool = new ConfigFilePool(); @@ -59,6 +60,7 @@ public function regenerate() if ($this->write->isExist($this->write->getRelativePath($envPath))) { $this->saveCacheStatus($envPath); } + //TODO: Till here $cachePath = $this->write->getRelativePath($this->directoryList->getPath(DirectoryList::CACHE)); $generationPath = $this->write->getRelativePath($this->directoryList->getPath(DirectoryList::GENERATION)); $diPath = $this->write->getRelativePath($this->directoryList->getPath(DirectoryList::DI)); diff --git a/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php b/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php index c4ca7c833394b..68c54f4f64828 100644 --- a/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php +++ b/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php @@ -5,10 +5,13 @@ */ namespace Magento\Setup\Console\Command; +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Backend\Console\Command\AbstractCacheManageCommand; use Magento\Framework\ObjectManagerInterface; use Magento\Framework\Setup\ConsoleLogger; use Magento\Setup\Model\InstallerFactory; use Magento\Setup\Model\ObjectManagerProvider; +use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; @@ -94,5 +97,28 @@ protected function execute(InputInterface $input, OutputInterface $output) if (!$keepGenerated) { $output->writeln('Please re-run Magento compile command'); } + + //TODO: to be removed in scope of MAGETWO-53476 + $writeFactory = $objectManager->get('\Magento\Framework\Filesystem\Directory\WriteFactory'); + $write = $writeFactory->create(BP); + /** @var \Magento\Framework\App\Filesystem\DirectoryList $dirList */ + $dirList = $objectManager->get('\Magento\Framework\App\Filesystem\DirectoryList'); + + $pathToCacheStatus = $write->getRelativePath($dirList->getPath(DirectoryList::VAR_DIR) . '/.cachestates.json'); + + if ($write->isExist($pathToCacheStatus)) { + $params = array_keys(json_decode($write->readFile($pathToCacheStatus), true)); + $command = $this->getApplication()->find('cache:enable'); + + $arguments = ['command' => 'cache:enable', AbstractCacheManageCommand::INPUT_KEY_TYPES => $params ]; + $returnCode = $command->run(new ArrayInput($arguments), $output); + + $write->delete($pathToCacheStatus); + if (isset($returnCode) && $returnCode > 0) { + $output->writeln(' Error occured during upgrade'); + return \Magento\Framework\Console\Cli::RETURN_FAILURE; + } + return \Magento\Framework\Console\Cli::RETURN_SUCCESS; + } } } diff --git a/setup/src/Magento/Setup/Model/Cron/JobUpgrade.php b/setup/src/Magento/Setup/Model/Cron/JobUpgrade.php index 490af5576d090..ef2e12606bd04 100644 --- a/setup/src/Magento/Setup/Model/Cron/JobUpgrade.php +++ b/setup/src/Magento/Setup/Model/Cron/JobUpgrade.php @@ -5,8 +5,6 @@ */ namespace Magento\Setup\Model\Cron; -use Magento\Framework\App\Filesystem\DirectoryList; -use Magento\Framework\Filesystem; use Magento\Setup\Console\Command\AbstractSetupCommand; use Magento\Setup\Model\ObjectManagerProvider; use Symfony\Component\Console\Input\ArrayInput; @@ -72,26 +70,6 @@ public function execute() ); $this->params['command'] = 'setup:upgrade'; $this->command->run(new ArrayInput($this->params), $this->output); - - /** - * @var \Magento\Framework\Filesystem\Directory\WriteFactory $writeFactory - */ - $writeFactory = $this->objectManager->get('\Magento\Framework\Filesystem\Directory\WriteFactory'); - $write = $writeFactory->create(BP); - $dirList = $this->objectManager->get('\Magento\Framework\App\Filesystem\DirectoryList'); - $pathToCacheStatus = $write->getRelativePath( - $dirList->getPath(DirectoryList::VAR_DIR) . '/.cachestates.json' - ); - - if ($write->isExist($pathToCacheStatus)) { - $params = array_keys(json_decode($write->readFile($pathToCacheStatus), true)); - - $this->queue->addJobs( - [['name' => JobFactory::JOB_ENABLE_CACHE, 'params' => [implode(' ', $params)]]] - ); - $write->delete($pathToCacheStatus); - } - } catch (\Exception $e) { $this->status->toggleUpdateError(true); throw new \RuntimeException(sprintf('Could not complete %s successfully: %s', $this, $e->getMessage())); From a8310151e8570b5e9d08a9c21fb12bcc714609e2 Mon Sep 17 00:00:00 2001 From: "Shmyheliuk, Oleksandr" Date: Thu, 26 May 2016 09:55:53 +0300 Subject: [PATCH 058/345] MAGETWO-53237: Exception if try to apply Gift Card Account/Discount Code on review page using PayPal (Braintree) --- .../Braintree/Controller/Paypal/Review.php | 23 +++---- .../Unit/Controller/Paypal/ReviewTest.php | 64 ++++++++++++++++++- 2 files changed, 74 insertions(+), 13 deletions(-) diff --git a/app/code/Magento/Braintree/Controller/Paypal/Review.php b/app/code/Magento/Braintree/Controller/Paypal/Review.php index b2b95f7897856..35ff1877110e5 100644 --- a/app/code/Magento/Braintree/Controller/Paypal/Review.php +++ b/app/code/Magento/Braintree/Controller/Paypal/Review.php @@ -10,6 +10,7 @@ use Magento\Framework\Controller\ResultFactory; use Magento\Braintree\Gateway\Config\PayPal\Config; use Magento\Braintree\Model\Paypal\Helper\QuoteUpdater; +use Magento\Framework\Exception\LocalizedException; /** * Class Review @@ -52,13 +53,16 @@ public function execute() try { $this->validateQuote($quote); - $this->validateRequestData($requestData); - $this->quoteUpdater->execute( - $requestData['nonce'], - $requestData['details'], - $quote - ); + if ($this->validateRequestData($requestData)) { + $this->quoteUpdater->execute( + $requestData['nonce'], + $requestData['details'], + $quote + ); + } elseif (!$quote->getPayment()->getAdditionalInformation('payment_method_nonce')) { + throw new LocalizedException(__('We can\'t initialize checkout.')); + } /** @var \Magento\Framework\View\Result\Page $resultPage */ $resultPage = $this->resultFactory->create(ResultFactory::TYPE_PAGE); @@ -82,13 +86,10 @@ public function execute() /** * @param array $requestData - * @return void - * @throws \InvalidArgumentException + * @return boolean */ private function validateRequestData(array $requestData) { - if (empty($requestData['nonce']) || empty($requestData['details'])) { - throw new \InvalidArgumentException('Data of request cannot be empty.'); - } + return !empty($requestData['nonce']) && !empty($requestData['details']); } } diff --git a/app/code/Magento/Braintree/Test/Unit/Controller/Paypal/ReviewTest.php b/app/code/Magento/Braintree/Test/Unit/Controller/Paypal/ReviewTest.php index 4f1c053d31fba..838625133030b 100644 --- a/app/code/Magento/Braintree/Test/Unit/Controller/Paypal/ReviewTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Controller/Paypal/ReviewTest.php @@ -172,6 +172,14 @@ public function testExecuteException() ->method('getItemsCount') ->willReturn(1); + $paymentMock = $this->getMockBuilder('Magento\Quote\Model\Quote\Payment') + ->disableOriginalConstructor() + ->getMock(); + + $quoteMock->expects(self::once()) + ->method('getPayment') + ->willReturn($paymentMock); + $this->requestMock->expects(self::once()) ->method('getPostValue') ->with('result', '{}') @@ -187,8 +195,8 @@ public function testExecuteException() $this->messageManagerMock->expects(self::once()) ->method('addExceptionMessage') ->with( - self::isInstanceOf('\InvalidArgumentException'), - 'Data of request cannot be empty.' + self::isInstanceOf('\Magento\Framework\Exception\LocalizedException'), + 'We can\'t initialize checkout.' ); $this->resultFactoryMock->expects(self::once()) @@ -204,6 +212,58 @@ public function testExecuteException() self::assertEquals($this->review->execute(), $resultRedirectMock); } + /** + * @param array $data + * @param bool $result + * + * @dataProvider dataProviderValidateRequestData + */ + public function testValidateRequestData(array $data, $result) + { + $this->assertEquals( + $result, + $this->invokeMethod($this->review, 'validateRequestData', [$data]) + ); + } + + /** + * Invoke any method of an object. + * + * @param $object + * @param $methodName + * @param array $parameters + * @return mixed + */ + protected function invokeMethod(&$object, $methodName, array $parameters = []) + { + $reflection = new \ReflectionClass(get_class($object)); + $method = $reflection->getMethod($methodName); + $method->setAccessible(true); + + return $method->invokeArgs($object, $parameters); + } + + /** + * @return array + */ + public function dataProviderValidateRequestData() + { + return [ + [ + [ + ], + false + ], + [ + [ + 'nonce' => 'nonceValue', + 'details' => 'detailsValue' + ], + true + ] + ]; + } + /** * @return Redirect|\PHPUnit_Framework_MockObject_MockObject */ From cddfba2180ec0eb7673759cdbc3de8b104686e8a Mon Sep 17 00:00:00 2001 From: "Shmyheliuk, Oleksandr" Date: Thu, 26 May 2016 11:02:58 +0300 Subject: [PATCH 059/345] MAGETWO-53237: Exception if try to apply Gift Card Account/Discount Code on review page using PayPal (Braintree) --- .../Braintree/Controller/Paypal/Review.php | 7 +- .../Unit/Controller/Paypal/ReviewTest.php | 97 ++++++++----------- 2 files changed, 48 insertions(+), 56 deletions(-) diff --git a/app/code/Magento/Braintree/Controller/Paypal/Review.php b/app/code/Magento/Braintree/Controller/Paypal/Review.php index 35ff1877110e5..1b6c3a3ab5a91 100644 --- a/app/code/Magento/Braintree/Controller/Paypal/Review.php +++ b/app/code/Magento/Braintree/Controller/Paypal/Review.php @@ -22,6 +22,11 @@ class Review extends AbstractAction */ private $quoteUpdater; + /** + * @var string + */ + private static $paymentMethodNonce = 'payment_method_nonce'; + /** * Constructor * @@ -60,7 +65,7 @@ public function execute() $requestData['details'], $quote ); - } elseif (!$quote->getPayment()->getAdditionalInformation('payment_method_nonce')) { + } elseif (!$quote->getPayment()->getAdditionalInformation(self::$paymentMethodNonce)) { throw new LocalizedException(__('We can\'t initialize checkout.')); } diff --git a/app/code/Magento/Braintree/Test/Unit/Controller/Paypal/ReviewTest.php b/app/code/Magento/Braintree/Test/Unit/Controller/Paypal/ReviewTest.php index 838625133030b..d5342aa8b3deb 100644 --- a/app/code/Magento/Braintree/Test/Unit/Controller/Paypal/ReviewTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Controller/Paypal/ReviewTest.php @@ -168,6 +168,48 @@ public function testExecuteException() $quoteMock = $this->getQuoteMock(); $resultRedirectMock = $this->getResultRedirectMock(); + $quoteMock->expects(self::once()) + ->method('getItemsCount') + ->willReturn(0); + + $this->requestMock->expects(self::once()) + ->method('getPostValue') + ->with('result', '{}') + ->willReturn($result); + + $this->checkoutSessionMock->expects(self::once()) + ->method('getQuote') + ->willReturn($quoteMock); + + $this->quoteUpdaterMock->expects(self::never()) + ->method('execute'); + + $this->messageManagerMock->expects(self::once()) + ->method('addExceptionMessage') + ->with( + self::isInstanceOf('\InvalidArgumentException'), + 'We can\'t initialize checkout.' + ); + + $this->resultFactoryMock->expects(self::once()) + ->method('create') + ->with(ResultFactory::TYPE_REDIRECT) + ->willReturn($resultRedirectMock); + + $resultRedirectMock->expects(self::once()) + ->method('setPath') + ->with('checkout/cart') + ->willReturnSelf(); + + self::assertEquals($this->review->execute(), $resultRedirectMock); + } + + public function testExecuteExceptionPaymentWithoutNonce() + { + $result = '{}'; + $quoteMock = $this->getQuoteMock(); + $resultRedirectMock = $this->getResultRedirectMock(); + $quoteMock->expects(self::once()) ->method('getItemsCount') ->willReturn(1); @@ -189,9 +231,6 @@ public function testExecuteException() ->method('getQuote') ->willReturn($quoteMock); - $this->quoteUpdaterMock->expects(self::never()) - ->method('execute'); - $this->messageManagerMock->expects(self::once()) ->method('addExceptionMessage') ->with( @@ -212,58 +251,6 @@ public function testExecuteException() self::assertEquals($this->review->execute(), $resultRedirectMock); } - /** - * @param array $data - * @param bool $result - * - * @dataProvider dataProviderValidateRequestData - */ - public function testValidateRequestData(array $data, $result) - { - $this->assertEquals( - $result, - $this->invokeMethod($this->review, 'validateRequestData', [$data]) - ); - } - - /** - * Invoke any method of an object. - * - * @param $object - * @param $methodName - * @param array $parameters - * @return mixed - */ - protected function invokeMethod(&$object, $methodName, array $parameters = []) - { - $reflection = new \ReflectionClass(get_class($object)); - $method = $reflection->getMethod($methodName); - $method->setAccessible(true); - - return $method->invokeArgs($object, $parameters); - } - - /** - * @return array - */ - public function dataProviderValidateRequestData() - { - return [ - [ - [ - ], - false - ], - [ - [ - 'nonce' => 'nonceValue', - 'details' => 'detailsValue' - ], - true - ] - ]; - } - /** * @return Redirect|\PHPUnit_Framework_MockObject_MockObject */ From ffe608f254396c2367c41d9452075a31c2da70fa Mon Sep 17 00:00:00 2001 From: "Shmyheliuk, Oleksandr" Date: Thu, 26 May 2016 11:05:32 +0300 Subject: [PATCH 060/345] MAGETWO-53237: Exception if try to apply Gift Card Account/Discount Code on review page using PayPal (Braintree) --- .../Braintree/Test/Unit/Controller/Paypal/ReviewTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Braintree/Test/Unit/Controller/Paypal/ReviewTest.php b/app/code/Magento/Braintree/Test/Unit/Controller/Paypal/ReviewTest.php index d5342aa8b3deb..a5cdaf3e35b70 100644 --- a/app/code/Magento/Braintree/Test/Unit/Controller/Paypal/ReviewTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Controller/Paypal/ReviewTest.php @@ -214,7 +214,7 @@ public function testExecuteExceptionPaymentWithoutNonce() ->method('getItemsCount') ->willReturn(1); - $paymentMock = $this->getMockBuilder('Magento\Quote\Model\Quote\Payment') + $paymentMock = $this->getMockBuilder(\Magento\Quote\Model\Quote\Payment::class) ->disableOriginalConstructor() ->getMock(); @@ -234,7 +234,7 @@ public function testExecuteExceptionPaymentWithoutNonce() $this->messageManagerMock->expects(self::once()) ->method('addExceptionMessage') ->with( - self::isInstanceOf('\Magento\Framework\Exception\LocalizedException'), + self::isInstanceOf(\Magento\Framework\Exception\LocalizedException::class), 'We can\'t initialize checkout.' ); From 3992ec2b1e7690e042f5d577de1868cf967a43e1 Mon Sep 17 00:00:00 2001 From: vzabaznov Date: Thu, 26 May 2016 13:28:48 +0300 Subject: [PATCH 061/345] MAGETWO-53489: setStoreId in AbstractCollection should check for SotreInterface but not Store --- .../Model/ResourceModel/Collection/AbstractCollection.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Collection/AbstractCollection.php b/app/code/Magento/Catalog/Model/ResourceModel/Collection/AbstractCollection.php index e15952d152225..5098fef99779e 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Collection/AbstractCollection.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Collection/AbstractCollection.php @@ -97,12 +97,12 @@ public function setStore($store) /** * Set store scope * - * @param int|string|\Magento\Store\Model\Store $storeId + * @param int|string|\Magento\Store\Api\Data\StoreInterface $storeId * @return $this */ public function setStoreId($storeId) { - if ($storeId instanceof \Magento\Store\Model\Store) { + if ($storeId instanceof \Magento\Store\Api\Data\StoreInterface) { $storeId = $storeId->getId(); } $this->_storeId = (int)$storeId; From a99620075fa5f5b3f0ea64187cdaf04724762b97 Mon Sep 17 00:00:00 2001 From: Viktor Tymchynskyi Date: Thu, 26 May 2016 14:24:38 +0300 Subject: [PATCH 062/345] MAGETWO-50972: Move to Shopping Cart action does not work inside creation offline order - Save backend quote after creation with is_active = false since quote was created with is_active = true --- app/code/Magento/Backend/Model/Session/Quote.php | 1 + .../Magento/Backend/Test/Unit/Model/Session/QuoteTest.php | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Backend/Model/Session/Quote.php b/app/code/Magento/Backend/Model/Session/Quote.php index 1ecbde15f840e..04458dc54cc86 100644 --- a/app/code/Magento/Backend/Model/Session/Quote.php +++ b/app/code/Magento/Backend/Model/Session/Quote.php @@ -159,6 +159,7 @@ public function getQuote() $this->_quote = $this->quoteRepository->get($this->getQuoteId(), [$this->getStoreId()]); $this->_quote->setCustomerGroupId($this->groupManagement->getDefaultGroup()->getId()); $this->_quote->setIsActive(false); + $this->quoteRepository->save($this->_quote); } else { $this->_quote = $this->quoteRepository->get($this->getQuoteId(), [$this->getStoreId()]); $this->_quote->setStoreId($this->getStoreId()); diff --git a/app/code/Magento/Backend/Test/Unit/Model/Session/QuoteTest.php b/app/code/Magento/Backend/Test/Unit/Model/Session/QuoteTest.php index d02422ebdc93d..8ea5665baaa79 100644 --- a/app/code/Magento/Backend/Test/Unit/Model/Session/QuoteTest.php +++ b/app/code/Magento/Backend/Test/Unit/Model/Session/QuoteTest.php @@ -296,7 +296,12 @@ public function testGetQuoteWithoutQuoteId() '', false ); - $this->quoteRepositoryMock->expects($this->once())->method('get')->willReturn($quoteMock); + $this->quoteRepositoryMock->expects($this->once()) + ->method('get') + ->willReturn($quoteMock); + $this->quoteRepositoryMock->expects($this->once()) + ->method('save') + ->with($quoteMock); $quoteMock->expects($this->once()) ->method('setCustomerGroupId') ->with($customerGroupId) From ae6db442afafab2b4277c6314ab9b07945ebfc2e Mon Sep 17 00:00:00 2001 From: Dmytro Kvashnin Date: Thu, 26 May 2016 14:31:48 +0300 Subject: [PATCH 063/345] MAGETWO-53312: Click on "Submit invoice" button cause to expose php error log - removed code --- .../Model/ResourceModel/AbstractResource.php | 1 - .../ResourceModel/AbstractResourceStub.php | 20 +++- .../ResourceModel/AbstractResourceTest.php | 93 +++++++++++++++++++ 3 files changed, 111 insertions(+), 3 deletions(-) diff --git a/lib/internal/Magento/Framework/Model/ResourceModel/AbstractResource.php b/lib/internal/Magento/Framework/Model/ResourceModel/AbstractResource.php index 4e38d13aa72f6..905db99ab17a6 100644 --- a/lib/internal/Magento/Framework/Model/ResourceModel/AbstractResource.php +++ b/lib/internal/Magento/Framework/Model/ResourceModel/AbstractResource.php @@ -82,7 +82,6 @@ public function commit() call_user_func($callback); } } catch (\Exception $e) { - echo $e; throw $e; } } diff --git a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/AbstractResourceStub.php b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/AbstractResourceStub.php index 13370114aa7ae..287e12e8abdf3 100644 --- a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/AbstractResourceStub.php +++ b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/AbstractResourceStub.php @@ -6,10 +6,16 @@ namespace Magento\Framework\Model\Test\Unit\ResourceModel; use Magento\Framework\DataObject; +use Magento\Framework\DB\Adapter\AdapterInterface; use Magento\Framework\Model\ResourceModel\AbstractResource; class AbstractResourceStub extends AbstractResource { + /** + * @var AdapterInterface + */ + private $connectionAdapter; + /** * Resource initialization * @@ -23,11 +29,21 @@ protected function _construct() /** * Get connection * - * @return \Magento\Framework\DB\Adapter\AdapterInterface + * @return AdapterInterface */ protected function getConnection() { - return null; + return $this->connectionAdapter; + } + + /** + * @param AdapterInterface $adapter + * + * @return void + */ + public function setConnection(AdapterInterface $adapter) + { + $this->connectionAdapter = $adapter; } /** diff --git a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/AbstractResourceTest.php b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/AbstractResourceTest.php index 6508f3d8122d3..217f5c8252378 100644 --- a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/AbstractResourceTest.php +++ b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/AbstractResourceTest.php @@ -6,6 +6,7 @@ namespace Magento\Framework\Model\Test\Unit\ResourceModel; use Magento\Framework\DataObject; +use Magento\Framework\DB\Adapter\AdapterInterface; class AbstractResourceTest extends \PHPUnit_Framework_TestCase { @@ -105,4 +106,96 @@ public function unserializableFieldsDataProvider() [[$dataObject, 'serialized_boolean_false', null], false] ]; } + + public function testCommitZeroLevel() + { + /** @var AdapterInterface|\PHPUnit_Framework_MockObject_MockObject $connection */ + $connection = $this->getMock(AdapterInterface::class); + /** @var DataObject|\PHPUnit_Framework_MockObject_MockObject $closureExpectation */ + $closureExpectation = $this->getMockBuilder(DataObject::class) + ->disableOriginalConstructor() + ->getMock(); + + $abstractResource = new AbstractResourceStub(); + $abstractResource->setConnection($connection); + $abstractResource->addCommitCallback( + function () use ($closureExpectation) { + $closureExpectation->setData(1); + } + ); + + $abstractResource->addCommitCallback( + function () use ($closureExpectation) { + $closureExpectation->getData(); + } + ); + + $connection->expects(static::once()) + ->method('commit'); + $connection->expects(static::once()) + ->method('getTransactionLevel') + ->willReturn(0); + $closureExpectation->expects(static::once()) + ->method('setData') + ->with(1); + $closureExpectation->expects(static::once()) + ->method('getData'); + + $abstractResource->commit(); + } + + /** + * @expectedException \Exception + */ + public function testCommitZeroLevelCallbackException() + { + /** @var AdapterInterface|\PHPUnit_Framework_MockObject_MockObject $connection */ + $connection = $this->getMock(AdapterInterface::class); + + $abstractResource = new AbstractResourceStub(); + $abstractResource->setConnection($connection); + $abstractResource->addCommitCallback( + function () { + throw new \Exception(); + } + ); + + $connection->expects(static::once()) + ->method('commit'); + $connection->expects(static::once()) + ->method('getTransactionLevel') + ->willReturn(0); + + $abstractResource->commit(); + } + + public function testCommitNotCompletedTransaction() + { + /** @var AdapterInterface|\PHPUnit_Framework_MockObject_MockObject $connection */ + $connection = $this->getMock(AdapterInterface::class); + /** @var DataObject|\PHPUnit_Framework_MockObject_MockObject $closureExpectation */ + $closureExpectation = $this->getMockBuilder(DataObject::class) + ->disableOriginalConstructor() + ->getMock(); + + $abstractResource = new AbstractResourceStub(); + $abstractResource->setConnection($connection); + $abstractResource->addCommitCallback( + function () use ($closureExpectation) { + $closureExpectation->setData(1); + } + ); + + $connection->expects(static::once()) + ->method('commit'); + $connection->expects(static::once()) + ->method('getTransactionLevel') + ->willReturn(1); + + $closureExpectation->expects(static::never()) + ->method('setData') + ->with(1); + + $abstractResource->commit(); + } } From 4d147bb65d5f61365083e886a1a88bdef3ce471a Mon Sep 17 00:00:00 2001 From: Ievgen Sentiabov Date: Thu, 26 May 2016 14:44:00 +0300 Subject: [PATCH 064/345] MAGETWO-53240: There is no ability to preform Checkout for virtual product using PayPal (Braintree) - Added ability to retrieve billing address from PayPal side --- .../js/view/payment/method-renderer/paypal.js | 63 +++++++++++++++---- 1 file changed, 51 insertions(+), 12 deletions(-) diff --git a/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/paypal.js b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/paypal.js index 4155f2c25f8b0..ce83fb215d9b2 100644 --- a/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/paypal.js +++ b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/paypal.js @@ -144,12 +144,36 @@ define([ this.paymentMethodNonce = paymentMethodNonce; }, + /** + * Update quote billing address + * @param {Object}customer + * @param {Object}address + */ + setBillingAddress: function (customer, address) { + var billingAddress = { + street: [address.streetAddress], + city: address.locality, + regionCode: address.region, + postcode: address.postalCode, + countryId: address.countryCodeAlpha2, + firstname: customer.firstName, + lastname: customer.lastName, + telephone: customer.phone + }; + + quote.billingAddress(billingAddress); + }, + /** * Prepare data to place order * @param {Object} data */ beforePlaceOrder: function (data) { this.setPaymentMethodNonce(data.nonce); + + if (quote.billingAddress() === null && typeof data.details.billingAddress !== 'undefined') { + this.setBillingAddress(data.details, data.details.billingAddress); + } this.placeOrder(); }, @@ -200,8 +224,7 @@ define([ * @returns {Object} */ getPayPalConfig: function () { - var address = quote.shippingAddress(), - totals = quote.totals(), + var totals = quote.totals(), config = {}; config.paypal = { @@ -212,16 +235,6 @@ define([ currency: totals['base_currency_code'], locale: this.getLocale(), enableShippingAddress: true, - shippingAddressOverride: { - recipientName: address.firstname + ' ' + address.lastname, - streetAddress: address.street[0], - locality: address.city, - countryCodeAlpha2: address.countryId, - postalCode: address.postcode, - region: address.regionCode, - phone: address.telephone, - editable: this.isAllowOverrideShippingAddress() - }, /** * Triggers on any Braintree error @@ -238,6 +251,8 @@ define([ } }; + config.paypal.shippingAddressOverride = this.getShippingAddress(); + if (this.getMerchantName()) { config.paypal.displayName = this.getMerchantName(); } @@ -245,6 +260,30 @@ define([ return config; }, + /** + * Get shipping address + * @returns {Object} + */ + getShippingAddress: function () { + var address = quote.shippingAddress(); + + if (address.postcode === null) { + + return {}; + } + + return { + recipientName: address.firstname + ' ' + address.lastname, + streetAddress: address.street[0], + locality: address.city, + countryCodeAlpha2: address.countryId, + postalCode: address.postcode, + region: address.regionCode, + phone: address.telephone, + editable: this.isAllowOverrideShippingAddress() + }; + }, + /** * Get merchant name * @returns {String} From 867126f99ae9b6e13ee405ae892f32f547f17f5d Mon Sep 17 00:00:00 2001 From: Roman Liukshyn Date: Thu, 26 May 2016 13:22:36 +0000 Subject: [PATCH 065/345] MAGETWO-53317: Unable to place order within direct payment method from admin - Removed redundant usages of deprecated methods - Fixed code style --- app/code/Magento/Payment/Block/Form/Cc.php | 4 ++-- app/code/Magento/Payment/Model/CcConfig.php | 4 ++-- .../Payment/Model/CcGenericConfigProvider.php | 4 ++-- app/code/Magento/Paypal/Model/Direct.php | 7 ------- .../Sales/Api/Data/OrderPaymentInterface.php | 12 ++++++------ .../Order/Create/Billing/Method/Form.php | 2 +- app/code/Magento/Sales/Model/Order/Payment.php | 15 ++++++--------- 7 files changed, 19 insertions(+), 29 deletions(-) diff --git a/app/code/Magento/Payment/Block/Form/Cc.php b/app/code/Magento/Payment/Block/Form/Cc.php index a6eb1a9324f8e..9fcd03b446470 100644 --- a/app/code/Magento/Payment/Block/Form/Cc.php +++ b/app/code/Magento/Payment/Block/Form/Cc.php @@ -108,7 +108,7 @@ public function hasVerification() /** * Whether switch/solo card type available * - * @deprecated + * @deprecated unused * @return bool */ public function hasSsCardType() @@ -124,7 +124,7 @@ public function hasSsCardType() /** * Solo/switch card start year * - * @deprecated + * @deprecated unused * @return array */ public function getSsStartYears() diff --git a/app/code/Magento/Payment/Model/CcConfig.php b/app/code/Magento/Payment/Model/CcConfig.php index 605014519faa8..bb57756fb7e1d 100644 --- a/app/code/Magento/Payment/Model/CcConfig.php +++ b/app/code/Magento/Payment/Model/CcConfig.php @@ -62,7 +62,7 @@ public function __construct( * Solo/switch card start years * * @return array - * @deprecated + * @deprecated unused */ public function getSsStartYears() { @@ -120,7 +120,7 @@ public function hasVerification() * Whether switch/solo card type available * * @return bool - * @deprecated + * @deprecated unused */ public function hasSsCardType() { diff --git a/app/code/Magento/Payment/Model/CcGenericConfigProvider.php b/app/code/Magento/Payment/Model/CcGenericConfigProvider.php index 6c04de009a402..a29bff3576a16 100644 --- a/app/code/Magento/Payment/Model/CcGenericConfigProvider.php +++ b/app/code/Magento/Payment/Model/CcGenericConfigProvider.php @@ -64,7 +64,7 @@ public function getConfig() * Solo/switch card start years * * @return array - * @deprecated + * @deprecated unused */ protected function getSsStartYears() { @@ -143,7 +143,7 @@ protected function hasVerification($methodCode) * * @param string $methodCode * @return bool - * @deprecated + * @deprecated unused */ protected function hasSsCardType($methodCode) { diff --git a/app/code/Magento/Paypal/Model/Direct.php b/app/code/Magento/Paypal/Model/Direct.php index b22913c7d9048..c31c708a669d1 100644 --- a/app/code/Magento/Paypal/Model/Direct.php +++ b/app/code/Magento/Paypal/Model/Direct.php @@ -437,15 +437,8 @@ protected function _placeOrder(Payment $payment, $amount) $this->_getFormattedCcExpirationDate($payment->getCcExpMonth(), $payment->getCcExpYear()) )->setCreditCardCvv2( $payment->getCcCid() - )->setMaestroSoloIssueNumber( - $payment->getCcSsIssue() ); - if ($payment->getCcSsStartMonth() && $payment->getCcSsStartYear()) { - $year = sprintf('%02d', substr($payment->getCcSsStartYear(), -2, 2)); - $api->setMaestroSoloIssueDate($this->_getFormattedCcExpirationDate($payment->getCcSsStartMonth(), $year)); - } - // add shipping and billing addresses if ($order->getIsVirtual()) { $api->setAddress($order->getBillingAddress())->setSuppressShipping(true); diff --git a/app/code/Magento/Sales/Api/Data/OrderPaymentInterface.php b/app/code/Magento/Sales/Api/Data/OrderPaymentInterface.php index 9bf5a60b0ec9e..4b98fe9309b76 100644 --- a/app/code/Magento/Sales/Api/Data/OrderPaymentInterface.php +++ b/app/code/Magento/Sales/Api/Data/OrderPaymentInterface.php @@ -114,7 +114,7 @@ interface OrderPaymentInterface extends \Magento\Framework\Api\ExtensibleDataInt /** * Credit card SS start year. * - * @deprecated + * @deprecated unused constant */ const CC_SS_START_YEAR = 'cc_ss_start_year'; /* @@ -161,7 +161,7 @@ interface OrderPaymentInterface extends \Magento\Framework\Api\ExtensibleDataInt /** * Credit card SS start month. * - * @deprecated + * @deprecated unused constant */ const CC_SS_START_MONTH = 'cc_ss_start_month'; /* @@ -216,7 +216,7 @@ interface OrderPaymentInterface extends \Magento\Framework\Api\ExtensibleDataInt /** * Credit card SS issue. * - * @deprecated + * @deprecated unused constant */ const CC_SS_ISSUE = 'cc_ss_issue'; /* @@ -472,7 +472,7 @@ public function getCcSecureVerify(); * Gets the credit card SS issue for the order payment. * * @return string|null Credit card SS issue. - * @deprecated + * @deprecated unused */ public function getCcSsIssue(); @@ -480,7 +480,7 @@ public function getCcSsIssue(); * Gets the credit card SS start month for the order payment. * * @return string|null Credit card SS start month. - * @deprecated + * @deprecated unused */ public function getCcSsStartMonth(); @@ -488,7 +488,7 @@ public function getCcSsStartMonth(); * Gets the credit card SS start year for the order payment. * * @return string|null Credit card SS start year. - * @deprecated + * @deprecated unused */ public function getCcSsStartYear(); diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Billing/Method/Form.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Billing/Method/Form.php index 8d769f53b36ff..9a910e48ec0f2 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Billing/Method/Form.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Billing/Method/Form.php @@ -101,7 +101,7 @@ public function getQuote() * Whether switch/solo card type available * * @return true - * @deprecated + * @deprecated unused */ public function hasSsCardType() { diff --git a/app/code/Magento/Sales/Model/Order/Payment.php b/app/code/Magento/Sales/Model/Order/Payment.php index 31369455e8d74..898a205481d1a 100644 --- a/app/code/Magento/Sales/Model/Order/Payment.php +++ b/app/code/Magento/Sales/Model/Order/Payment.php @@ -1703,7 +1703,7 @@ public function getCcSecureVerify() * Returns cc_ss_issue * * @return string - * @deprecated + * @deprecated unused */ public function getCcSsIssue() { @@ -1714,7 +1714,7 @@ public function getCcSsIssue() * Returns cc_ss_start_month * * @return string - * @deprecated + * @deprecated unused */ public function getCcSsStartMonth() { @@ -1725,7 +1725,7 @@ public function getCcSsStartMonth() * Returns cc_ss_start_year * * @return string - * @deprecated + * @deprecated unused */ public function getCcSsStartYear() { @@ -2090,8 +2090,7 @@ public function setCcExpMonth($ccExpMonth) /** * {@inheritdoc} - * - * @deprecated + * @deprecated unused */ public function setCcSsStartYear($ccSsStartYear) { @@ -2180,8 +2179,7 @@ public function setCcDebugResponseSerialized($ccDebugResponseSerialized) /** * {@inheritdoc} - * - * @deprecated + * @deprecated unused */ public function setCcSsStartMonth($ccSsStartMonth) { @@ -2286,8 +2284,7 @@ public function setCcDebugResponseBody($ccDebugResponseBody) /** * {@inheritdoc} - * - * @deprecated + * @deprecated unused */ public function setCcSsIssue($ccSsIssue) { From 960ac5982ded3eeef02f43df446f09672861fc26 Mon Sep 17 00:00:00 2001 From: Maddy Chellathurai Date: Thu, 26 May 2016 09:21:02 -0500 Subject: [PATCH 066/345] MAGETWO-53474: [Github] Caches Aren't Enabled by Default on RC1 with Composer when Upgrading via CLI - Updating tests. --- .../Setup/Console/Command/UpgradeCommand.php | 4 +-- .../Console/Command/UpgradeCommandTest.php | 24 ++++++++++++----- .../Test/Unit/Model/Cron/JobUpgradeTest.php | 26 +------------------ 3 files changed, 21 insertions(+), 33 deletions(-) diff --git a/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php b/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php index 68c54f4f64828..07453181a886d 100644 --- a/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php +++ b/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php @@ -99,10 +99,10 @@ protected function execute(InputInterface $input, OutputInterface $output) } //TODO: to be removed in scope of MAGETWO-53476 - $writeFactory = $objectManager->get('\Magento\Framework\Filesystem\Directory\WriteFactory'); + $writeFactory = $objectManager->get('Magento\Framework\Filesystem\Directory\WriteFactory'); $write = $writeFactory->create(BP); /** @var \Magento\Framework\App\Filesystem\DirectoryList $dirList */ - $dirList = $objectManager->get('\Magento\Framework\App\Filesystem\DirectoryList'); + $dirList = $objectManager->get('Magento\Framework\App\Filesystem\DirectoryList'); $pathToCacheStatus = $write->getRelativePath($dirList->getPath(DirectoryList::VAR_DIR) . '/.cachestates.json'); diff --git a/setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php b/setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php index 1b493e9cf330c..9066201ace7b3 100644 --- a/setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php @@ -20,12 +20,6 @@ public function testExecute() $state = $this->getMock('Magento\Framework\App\State', [], [], '', false); $state->expects($this->once())->method('setAreaCode')->with('setup'); $objectManagerProvider->expects($this->once())->method('get')->willReturn($objectManager); - $objectManager->expects($this->exactly(2)) - ->method('get') - ->will($this->returnValueMap([ - ['Magento\Framework\App\State', $state], - ['Magento\Framework\ObjectManager\ConfigLoaderInterface', $configLoader], - ])); $objectManager->expects($this->once())->method('configure'); $state->expects($this->once())->method('setAreaCode')->with('setup'); $installer = $this->getMock('Magento\Setup\Model\Installer', [], [], '', false); @@ -33,6 +27,24 @@ public function testExecute() $installer->expects($this->at(1))->method('installSchema'); $installer->expects($this->at(2))->method('installDataFixtures'); $installerFactory->expects($this->once())->method('create')->willReturn($installer); + + $pathToCacheStatus = '/path/to/cachefile'; + $writeFactory = $this->getMock('\Magento\Framework\Filesystem\Directory\WriteFactory', [], [], '', false); + $write = $this->getMock('\Magento\Framework\Filesystem\Directory\Write', [], [], '', false); + $write->expects($this->once())->method('isExist')->with('/path/to/cachefile')->willReturn(false); + $write->expects($this->once())->method('getRelativePath')->willReturn($pathToCacheStatus); + + $writeFactory->expects($this->once())->method('create')->willReturn($write); + $directoryList = $this->getMock('\Magento\Framework\App\Filesystem\DirectoryList', [], [], '', false); + $objectManager->expects($this->exactly(4)) + ->method('get') + ->will($this->returnValueMap([ + ['Magento\Framework\App\State', $state], + ['Magento\Framework\ObjectManager\ConfigLoaderInterface', $configLoader], + ['Magento\Framework\Filesystem\Directory\WriteFactory', $writeFactory], + ['Magento\Framework\App\Filesystem\DirectoryList', $directoryList], + ])); + $commandTester = new CommandTester(new UpgradeCommand($installerFactory, $objectManagerProvider)); $commandTester->execute([]); } diff --git a/setup/src/Magento/Setup/Test/Unit/Model/Cron/JobUpgradeTest.php b/setup/src/Magento/Setup/Test/Unit/Model/Cron/JobUpgradeTest.php index a9d8ac8dbde14..bcd9e7ca5785d 100644 --- a/setup/src/Magento/Setup/Test/Unit/Model/Cron/JobUpgradeTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Model/Cron/JobUpgradeTest.php @@ -12,7 +12,7 @@ class JobUpgradeTest extends \PHPUnit_Framework_TestCase public function testExecute() { $queue = $this->getMock('Magento\Setup\Model\Cron\Queue', [], [], '', false); - $queue->expects($this->exactly(3))->method('addJobs'); + $queue->expects($this->exactly(2))->method('addJobs'); $command = $this->getMock('Magento\Setup\Console\Command\UpgradeCommand', [], [], '', false); $command->expects($this->once())->method('run'); $status = $this->getMock('Magento\Setup\Model\Cron\Status', [], [], '', false); @@ -21,30 +21,6 @@ public function testExecute() $objectManagerProvider = $this->getMock('Magento\Setup\Model\ObjectManagerProvider', ['get'], [], '', false); $objectManagerProvider->expects($this->once())->method('get')->willReturn($objectManager); - $cleanupFiles = $this->getMock('\Magento\Framework\App\State\CleanupFiles', [], [], '', false); - $cache = $this->getMock('\Magento\Framework\App\Cache', [], [], '', false); - - $pathToCacheStatus = '/path/to/cachefile'; - $writeFactory = $this->getMock('\Magento\Framework\Filesystem\Directory\WriteFactory', [], [], '', false); - $write = $this->getMock('\Magento\Framework\Filesystem\Directory\Write', [], [], '', false); - $write->expects($this->once())->method('isExist')->with('/path/to/cachefile')->willReturn(true); - $write->expects($this->once())->method('readFile')->with('/path/to/cachefile')->willReturn( - '{"cacheOne":1,"cacheTwo":1,"cacheThree":1}' - ); - $write->expects($this->once())->method('delete')->with('/path/to/cachefile')->willReturn(true); - $write->expects($this->once())->method('getRelativePath')->willReturn($pathToCacheStatus); - - $writeFactory->expects($this->once())->method('create')->willReturn($write); - $directoryList = $this->getMock('\Magento\Framework\App\Filesystem\DirectoryList', [], [], '', false); - $directoryList->expects($this->once())->method('getPath')->willReturn('/some/full/path' . $pathToCacheStatus); - - $objectManager->expects($this->any())->method('get')->will($this->returnValueMap([ - ['\Magento\Framework\Filesystem\Directory\WriteFactory', $writeFactory], - ['\Magento\Framework\App\Filesystem\DirectoryList', $directoryList], - ['\Magento\Framework\App\State\CleanupFiles', $cleanupFiles], - ['\Magento\Framework\App\Cache', $cache], - ])); - $jobUpgrade = new JobUpgrade( $command, $objectManagerProvider, From 3b0ec04dca77d8db26e9004532da06dec3dd3015 Mon Sep 17 00:00:00 2001 From: Dmytro Yushkin Date: Thu, 26 May 2016 17:23:04 +0300 Subject: [PATCH 067/345] MAGETWO-53320: [Conflict Resolution] In-Context Experience is disabled after enabling of Express Checkout in Australia --- app/code/Magento/Paypal/etc/adminhtml/rules/payment_au.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Paypal/etc/adminhtml/rules/payment_au.xml b/app/code/Magento/Paypal/etc/adminhtml/rules/payment_au.xml index 733fbcdb36521..4ee83da9c2ab8 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/rules/payment_au.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/rules/payment_au.xml @@ -122,6 +122,7 @@ + From 6690cd626c586f0aa529bdbdc504ac86a39bc24b Mon Sep 17 00:00:00 2001 From: Yaroslav Onischenko Date: Thu, 26 May 2016 17:23:11 +0300 Subject: [PATCH 068/345] MAGETWO-51100: Notice: Array to string conversion --- .../CustomOptions/CustomOptionProcessor.php | 1 - .../Unit/Model/ProductOptionProcessorTest.php | 7 ---- .../Download/DownloadCustomOption.php | 10 +----- app/code/Magento/Sales/Model/Download.php | 3 +- .../Download/DownloadCustomOptionTest.php | 34 ++----------------- 5 files changed, 5 insertions(+), 50 deletions(-) diff --git a/app/code/Magento/Catalog/Model/CustomOptions/CustomOptionProcessor.php b/app/code/Magento/Catalog/Model/CustomOptions/CustomOptionProcessor.php index 4dba2a45ce5ad..c21390e7e8e47 100644 --- a/app/code/Magento/Catalog/Model/CustomOptions/CustomOptionProcessor.php +++ b/app/code/Magento/Catalog/Model/CustomOptions/CustomOptionProcessor.php @@ -66,7 +66,6 @@ public function convertToBuyRequest(CartItemInterface $cartItem) return null; } - /** * @inheritDoc */ diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductOptionProcessorTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ProductOptionProcessorTest.php index 1162aad97cd1c..eed65fa175177 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductOptionProcessorTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductOptionProcessorTest.php @@ -208,13 +208,6 @@ public function dataProviderConvertToProductOption() ], 'expected' => 'custom_options', ], - [ - 'options' => [ - 1 => 'value', - 2 => [1, 2, [1, 2]], - ], - 'expected' => 'custom_options', - ], [ 'options' => [], 'expected' => null, diff --git a/app/code/Magento/Sales/Controller/Download/DownloadCustomOption.php b/app/code/Magento/Sales/Controller/Download/DownloadCustomOption.php index 8d4969ceb1213..f79528d5988b3 100644 --- a/app/code/Magento/Sales/Controller/Download/DownloadCustomOption.php +++ b/app/code/Magento/Sales/Controller/Download/DownloadCustomOption.php @@ -77,17 +77,9 @@ public function execute() if ($optionId) { /** @var $productOption \Magento\Catalog\Model\Product\Option */ $productOption = $this->_objectManager->create('Magento\Catalog\Model\Product\Option')->load($optionId); - if ($productOption) { - $product = $this->_objectManager->get('\Magento\Catalog\Api\ProductRepositoryInterface')->getById($option->getProductId()); - $productOption->setProduct($product); - } } - if (!$productOption || - !$productOption->getId() || - $productOption->getProduct()->getId() != $option->getProductId() || - $productOption->getType() != 'file' - ) { + if (!$productOption || !$productOption->getId() || $productOption->getType() != 'file') { return $resultForward->forward('noroute'); } diff --git a/app/code/Magento/Sales/Model/Download.php b/app/code/Magento/Sales/Model/Download.php index 58a3548cf011e..58c626947eb09 100644 --- a/app/code/Magento/Sales/Model/Download.php +++ b/app/code/Magento/Sales/Model/Download.php @@ -89,7 +89,8 @@ public function downloadFile($info) protected function _isCanProcessed($relativePath) { $filePath = $this->_rootDir->getAbsolutePath($relativePath); - return (strpos(str_replace('\\', '/', $this->_rootDir->getDriver()->getRealPath($filePath)), $relativePath) !== false + $pathWithFixedSeparator = str_replace('\\', '/', $this->_rootDir->getDriver()->getRealPath($filePath)); + return (strpos($pathWithFixedSeparator, $relativePath) !== false && $this->_rootDir->isFile($relativePath) && $this->_rootDir->isReadable($relativePath)) || $this->_processDatabaseFile($filePath, $relativePath); } diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Download/DownloadCustomOptionTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Download/DownloadCustomOptionTest.php index 613b55bb49ba6..3ebbca491d602 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Download/DownloadCustomOptionTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Download/DownloadCustomOptionTest.php @@ -72,16 +72,6 @@ class DownloadCustomOptionTest extends \PHPUnit_Framework_TestCase */ protected $objectMock; - /** - * @var \Magento\Catalog\Api\ProductRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject - */ - protected $productRepositoryMock; - - /** - * @var \Magento\Catalog\Model\Product|\PHPUnit_Framework_MockObject_MockObject - */ - protected $productMock; - protected function setUp() { $resultForwardFactoryMock = $this->getMockBuilder('Magento\Framework\Controller\Result\ForwardFactory') @@ -123,25 +113,14 @@ protected function setUp() ->setMethods(['load', 'getId', 'getCode', 'getProductId', 'getValue']) ->getMock(); - $this->productMock = $this->getMockBuilder('\Magento\Catalog\Model\Product') - ->disableOriginalConstructor() - ->setMethods(['getId']) - ->getMock(); - - $this->productRepositoryMock = $this->getMockBuilder('\Magento\Catalog\Api\ProductRepositoryInterface') - ->setMethods(['getById']) - ->getMockForAbstractClass(); - $this->productRepositoryMock->expects($this->any())->method('getById')->willReturn($this->productMock); - $this->productOptionMock = $this->getMockBuilder('Magento\Catalog\Model\Product\Option') ->disableOriginalConstructor() - ->setMethods(['load', 'getId', 'getProductId', 'getType', 'getProduct', 'setProduct']) + ->setMethods(['load', 'getId', 'getProductId', 'getType']) ->getMock(); - $this->productOptionMock->expects($this->any())->method('getProduct')->willReturn($this->productMock); $objectManagerMock = $this->getMockBuilder('Magento\Sales\Model\Download') ->disableOriginalConstructor() - ->setMethods(['create', 'get']) + ->setMethods(['create']) ->getMock(); $objectManagerMock->expects($this->any())->method('create') ->will( @@ -152,11 +131,6 @@ protected function setUp() ] ) ); - $objectManagerMock->expects($this->any())->method('get')->willReturnMap( - [ - ['\Magento\Catalog\Api\ProductRepositoryInterface', $this->productRepositoryMock], - ] - ); $contextMock = $this->getMockBuilder('Magento\Backend\App\Action\Context') ->disableOriginalConstructor() @@ -217,8 +191,6 @@ public function testExecute($itemOptionValues, $productOptionValues, $noRouteOcc $this->productOptionMock->expects($this->any()) ->method('getType') ->willReturn($productOptionValues[self::OPTION_TYPE]); - - $this->productMock->expects($this->any())->method('getId')->willReturn($productOptionValues[self::OPTION_PRODUCT_ID]); } if ($noRouteOccurs) { $this->resultForwardMock->expects($this->once())->method('forward')->with('noroute')->willReturn(true); @@ -349,8 +321,6 @@ public function testExecuteBadSecretKey() $this->productOptionMock->expects($this->any())->method('getProductId')->willReturn(self::OPTION_PRODUCT_ID); $this->productOptionMock->expects($this->any())->method('getType')->willReturn(self::OPTION_TYPE); - $this->productMock->expects($this->any())->method('getId')->willReturn(self::OPTION_PRODUCT_ID); - $this->unserializeMock->expects($this->once()) ->method('unserialize') ->with(self::OPTION_VALUE) From 153b15cc816e4fc4f359499ef76ab7489b8ea434 Mon Sep 17 00:00:00 2001 From: "Shmyheliuk, Oleksandr" Date: Thu, 26 May 2016 17:23:42 +0300 Subject: [PATCH 069/345] MAGETWO-53412: Error during creation of international USPS shipment label with dimensions filled in inches --- .../Magento/Shipping/view/adminhtml/web/order/packaging.js | 5 ++--- .../Rma/Edit/Tab/General/Shipping/Packaging/Plugin.php | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Shipping/view/adminhtml/web/order/packaging.js b/app/code/Magento/Shipping/view/adminhtml/web/order/packaging.js index 3a5959e1b0358..2ad2ff596a707 100644 --- a/app/code/Magento/Shipping/view/adminhtml/web/order/packaging.js +++ b/app/code/Magento/Shipping/view/adminhtml/web/order/packaging.js @@ -230,7 +230,7 @@ Packaging.prototype = { validate: function() { var dimensionElements = $("packaging_window").select( - 'input[name=container_length],input[name=container_width],input[name=container_height]' + 'input[name=container_length],input[name=container_width],input[name=container_height],input[name=container_girth]:not("._disabled")' ); var callback = null; if ( dimensionElements.any(function(element) { return !!element.value; })) { @@ -543,8 +543,7 @@ Packaging.prototype = { return; } - var girthEnabled = (packageSize[0].value == 'LARGE' && (packageContainer[0].value == 'NONRECTANGULAR' - || packageContainer[0].value == 'VARIABLE' )); + var girthEnabled = packageContainer[0].value == 'NONRECTANGULAR' || packageContainer[0].value == 'VARIABLE'; if (!girthEnabled) { packageGirth[0].value=''; diff --git a/app/code/Magento/Usps/Block/Rma/Adminhtml/Rma/Edit/Tab/General/Shipping/Packaging/Plugin.php b/app/code/Magento/Usps/Block/Rma/Adminhtml/Rma/Edit/Tab/General/Shipping/Packaging/Plugin.php index 3118cd9b7669e..b0a91da7a07bc 100644 --- a/app/code/Magento/Usps/Block/Rma/Adminhtml/Rma/Edit/Tab/General/Shipping/Packaging/Plugin.php +++ b/app/code/Magento/Usps/Block/Rma/Adminhtml/Rma/Edit/Tab/General/Shipping/Packaging/Plugin.php @@ -69,7 +69,7 @@ public function aroundCheckSizeAndGirthParameter(\Magento\Framework\DataObject $ $girthEnabled = false; $sizeEnabled = false; if ($carrier && isset($size[0]['value'])) { - if ($size[0]['value'] == Carrier::SIZE_LARGE && in_array( + if (in_array( key($subject->getContainers()), [Carrier::CONTAINER_NONRECTANGULAR, Carrier::CONTAINER_VARIABLE] ) From fd87a6e7c9e1f9efc57dbdb5939d093059955d47 Mon Sep 17 00:00:00 2001 From: Dmytro Kvashnin Date: Thu, 26 May 2016 18:07:34 +0300 Subject: [PATCH 070/345] MAGETWO-53403: Terms and conditions agreement causes fatal error during checkout with PayPal Payments Pro method - repaired checkout agreements for set-payment-agreements --- .../Model/Checkout/Plugin/Validation.php | 12 ++++--- .../Model/Checkout/Plugin/ValidationTest.php | 6 ++-- .../view/frontend/requirejs-config.js | 3 ++ .../web/js/model/agreements-assigner.js | 36 +++++++++++++++++++ .../web/js/model/place-order-mixin.js | 27 +++----------- .../js/model/set-payment-information-mixin.js | 23 ++++++++++++ .../frontend/web/template/payment/form.html | 6 +++- 7 files changed, 82 insertions(+), 31 deletions(-) create mode 100644 app/code/Magento/CheckoutAgreements/view/frontend/web/js/model/agreements-assigner.js create mode 100644 app/code/Magento/CheckoutAgreements/view/frontend/web/js/model/set-payment-information-mixin.js diff --git a/app/code/Magento/CheckoutAgreements/Model/Checkout/Plugin/Validation.php b/app/code/Magento/CheckoutAgreements/Model/Checkout/Plugin/Validation.php index ca520a6a0acaf..a57a1f91dcf66 100644 --- a/app/code/Magento/CheckoutAgreements/Model/Checkout/Plugin/Validation.php +++ b/app/code/Magento/CheckoutAgreements/Model/Checkout/Plugin/Validation.php @@ -58,7 +58,7 @@ public function beforeSavePaymentInformationAndPlaceOrder( \Magento\Quote\Api\Data\AddressInterface $billingAddress = null ) { if ($this->isAgreementEnabled()) { - $this->validateAgreements($paymentMethod->getExtensionAttributes()->getAgreementIds()); + $this->validateAgreements($paymentMethod); } } @@ -77,17 +77,21 @@ public function beforeSavePaymentInformation( \Magento\Quote\Api\Data\AddressInterface $billingAddress = null ) { if ($this->isAgreementEnabled()) { - $this->validateAgreements($paymentMethod->getExtensionAttributes()->getAgreementIds()); + $this->validateAgreements($paymentMethod); } } /** - * @param int[] $agreements + * @param \Magento\Quote\Api\Data\PaymentInterface $paymentMethod * @throws \Magento\Framework\Exception\CouldNotSaveException * @return void */ - protected function validateAgreements($agreements) + protected function validateAgreements(\Magento\Quote\Api\Data\PaymentInterface $paymentMethod) { + $agreements = $paymentMethod->getExtensionAttributes() === null + ? [] + : $paymentMethod->getExtensionAttributes()->getAgreementIds(); + if (!$this->agreementsValidator->isValid($agreements)) { throw new \Magento\Framework\Exception\CouldNotSaveException( __('Please agree to all the terms and conditions before placing the order.') diff --git a/app/code/Magento/CheckoutAgreements/Test/Unit/Model/Checkout/Plugin/ValidationTest.php b/app/code/Magento/CheckoutAgreements/Test/Unit/Model/Checkout/Plugin/ValidationTest.php index 268a746d91998..a2440cf7641a2 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Unit/Model/Checkout/Plugin/ValidationTest.php +++ b/app/code/Magento/CheckoutAgreements/Test/Unit/Model/Checkout/Plugin/ValidationTest.php @@ -85,7 +85,7 @@ public function testBeforeSavePaymentInformationAndPlaceOrder() $this->repositoryMock->expects($this->once())->method('getList')->willReturn([1]); $this->extensionAttributesMock->expects($this->once())->method('getAgreementIds')->willReturn($agreements); $this->agreementsValidatorMock->expects($this->once())->method('isValid')->with($agreements)->willReturn(true); - $this->paymentMock->expects($this->once()) + $this->paymentMock->expects(static::atLeastOnce()) ->method('getExtensionAttributes') ->willReturn($this->extensionAttributesMock); $this->model->beforeSavePaymentInformation($this->subjectMock, $cartId, $this->paymentMock, $this->addressMock); @@ -107,7 +107,7 @@ public function testBeforeSavePaymentInformationAndPlaceOrderIfAgreementsNotVali $this->repositoryMock->expects($this->once())->method('getList')->willReturn([1]); $this->extensionAttributesMock->expects($this->once())->method('getAgreementIds')->willReturn($agreements); $this->agreementsValidatorMock->expects($this->once())->method('isValid')->with($agreements)->willReturn(false); - $this->paymentMock->expects($this->once()) + $this->paymentMock->expects(static::atLeastOnce()) ->method('getExtensionAttributes') ->willReturn($this->extensionAttributesMock); $this->model->beforeSavePaymentInformation($this->subjectMock, $cartId, $this->paymentMock, $this->addressMock); @@ -125,7 +125,7 @@ public function testBeforeSavePaymentInformation() $this->repositoryMock->expects($this->once())->method('getList')->willReturn([1]); $this->extensionAttributesMock->expects($this->once())->method('getAgreementIds')->willReturn($agreements); $this->agreementsValidatorMock->expects($this->once())->method('isValid')->with($agreements)->willReturn(true); - $this->paymentMock->expects($this->once()) + $this->paymentMock->expects(static::atLeastOnce()) ->method('getExtensionAttributes') ->willReturn($this->extensionAttributesMock); $this->model->beforeSavePaymentInformation($this->subjectMock, $cartId, $this->paymentMock, $this->addressMock); diff --git a/app/code/Magento/CheckoutAgreements/view/frontend/requirejs-config.js b/app/code/Magento/CheckoutAgreements/view/frontend/requirejs-config.js index 0e0bd2c2234b5..d0876cc49ce0f 100644 --- a/app/code/Magento/CheckoutAgreements/view/frontend/requirejs-config.js +++ b/app/code/Magento/CheckoutAgreements/view/frontend/requirejs-config.js @@ -9,6 +9,9 @@ var config = { mixins: { 'Magento_Checkout/js/action/place-order': { 'Magento_CheckoutAgreements/js/model/place-order-mixin': true + }, + 'Magento_Checkout/js/action/set-payment-information': { + 'Magento_CheckoutAgreements/js/model/set-payment-information-mixin': true } } } diff --git a/app/code/Magento/CheckoutAgreements/view/frontend/web/js/model/agreements-assigner.js b/app/code/Magento/CheckoutAgreements/view/frontend/web/js/model/agreements-assigner.js new file mode 100644 index 0000000000000..7b2ef55762bdb --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/view/frontend/web/js/model/agreements-assigner.js @@ -0,0 +1,36 @@ +/** + * Copyright © 2016 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +/*jshint browser:true jquery:true*/ +/*global alert*/ +define([ + 'jquery' +], function ($) { + 'use strict'; + + var agreementsConfig = window.checkoutConfig.checkoutAgreements; + + /** Override default place order action and add agreement_ids to request */ + return function (paymentData) { + var agreementForm, + agreementData, + agreementIds; + + if (!agreementsConfig.isEnabled) { + return; + } + + agreementForm = $('.payment-method._active div[data-role=checkout-agreements] input'); + agreementData = agreementForm.serializeArray(); + agreementIds = []; + + agreementData.forEach(function (item) { + agreementIds.push(item.value); + }); + + paymentData.extension_attributes = { + agreement_ids: agreementIds + }; + } +}); diff --git a/app/code/Magento/CheckoutAgreements/view/frontend/web/js/model/place-order-mixin.js b/app/code/Magento/CheckoutAgreements/view/frontend/web/js/model/place-order-mixin.js index b7008e8556223..ac459e573f9f2 100644 --- a/app/code/Magento/CheckoutAgreements/view/frontend/web/js/model/place-order-mixin.js +++ b/app/code/Magento/CheckoutAgreements/view/frontend/web/js/model/place-order-mixin.js @@ -6,35 +6,16 @@ /*global alert*/ define([ 'jquery', - 'mage/utils/wrapper' -], function ($, wrapper) { + 'mage/utils/wrapper', + 'Magento_CheckoutAgreements/js/model/agreements-assigner' +], function ($, wrapper, agreementsAssigner) { 'use strict'; - var agreementsConfig = window.checkoutConfig.checkoutAgreements; - return function (placeOrderAction) { /** Override default place order action and add agreement_ids to request */ return wrapper.wrap(placeOrderAction, function (originalAction, paymentData, messageContainer) { - var agreementForm, - agreementData, - agreementIds; - - if (!agreementsConfig.isEnabled) { - return originalAction(paymentData, messageContainer); - } - - agreementForm = $('.payment-method._active form[data-role=checkout-agreements]'); - agreementData = agreementForm.serializeArray(); - agreementIds = []; - - agreementData.forEach(function (item) { - agreementIds.push(item.value); - }); - - paymentData.extension_attributes = { - agreement_ids: agreementIds - }; + agreementsAssigner(paymentData); return originalAction(paymentData, messageContainer); }); diff --git a/app/code/Magento/CheckoutAgreements/view/frontend/web/js/model/set-payment-information-mixin.js b/app/code/Magento/CheckoutAgreements/view/frontend/web/js/model/set-payment-information-mixin.js new file mode 100644 index 0000000000000..7a94b958f4b0c --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/view/frontend/web/js/model/set-payment-information-mixin.js @@ -0,0 +1,23 @@ +/** + * Copyright © 2016 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +/*jshint browser:true jquery:true*/ +/*global alert*/ +define([ + 'jquery', + 'mage/utils/wrapper', + 'Magento_CheckoutAgreements/js/model/agreements-assigner' +], function ($, wrapper, agreementsAssigner) { + 'use strict'; + + return function (placeOrderAction) { + + /** Override place-order-mixin for set-payment-information action as they differs only by method signature */ + return wrapper.wrap(placeOrderAction, function (originalAction, messageContainer, paymentData) { + agreementsAssigner(paymentData); + + return originalAction(messageContainer, paymentData); + }); + }; +}); \ No newline at end of file diff --git a/app/code/Magento/Vault/view/frontend/web/template/payment/form.html b/app/code/Magento/Vault/view/frontend/web/template/payment/form.html index b444ebbebdaf6..85ff6148bb6f0 100644 --- a/app/code/Magento/Vault/view/frontend/web/template/payment/form.html +++ b/app/code/Magento/Vault/view/frontend/web/template/payment/form.html @@ -32,7 +32,11 @@
- +
+ + + +
+
getChildHtml('wysiwyg_images.uploader') ?>
diff --git a/app/code/Magento/Cms/view/adminhtml/templates/browser/content/uploader.phtml b/app/code/Magento/Cms/view/adminhtml/templates/browser/content/uploader.phtml index 6fe3f0b285fbc..120dc057b30e9 100644 --- a/app/code/Magento/Cms/view/adminhtml/templates/browser/content/uploader.phtml +++ b/app/code/Magento/Cms/view/adminhtml/templates/browser/content/uploader.phtml @@ -69,16 +69,16 @@ require([ }, done: function (e, data) { var progressSelector = '#' + data.fileId + ' .progressbar-container .progressbar'; + var tempErrorMessage = document.createElement("div"); $(progressSelector).css('width', '100%'); if (data.result && !data.result.hasOwnProperty('errorcode')) { - $("#content_header").children(".message").remove(); + $('[data-action="show-error"]').children(".message").remove(); $(progressSelector).removeClass('upload-progress').addClass('upload-success'); } else { - var tempErrorMessage = document.createElement("div"); tempErrorMessage.className = "message message-warning warning"; tempErrorMessage.innerHTML = data.result.error; - $("#content_header").append(tempErrorMessage); + $('[data-action="show-error"]').append(tempErrorMessage); $(progressSelector).removeClass('upload-progress').addClass('upload-failure'); } }, From 0d254a4e4ba3d84666911620eb5c2d5a067b6eab Mon Sep 17 00:00:00 2001 From: brywaters Date: Tue, 7 Jun 2016 12:55:24 -0500 Subject: [PATCH 227/345] MAGETWO-52923: Switching to Varnish causes category menu to force HTTPS links - Change Scope pool to use getHttpHost to make compatible with TestFramework/Request.php --- lib/internal/Magento/Framework/App/Config/ScopePool.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/internal/Magento/Framework/App/Config/ScopePool.php b/lib/internal/Magento/Framework/App/Config/ScopePool.php index d007ab080d434..e33e6817d37cc 100644 --- a/lib/internal/Magento/Framework/App/Config/ScopePool.php +++ b/lib/internal/Magento/Framework/App/Config/ScopePool.php @@ -93,13 +93,12 @@ public function getScope($scopeType, $scopeCode = null) $scopeCode = $this->_getScopeCode($scopeType, $scopeCode); //Key by url to support dynamic {{base_url}} and port assignments - $host = $this->getRequest()->getServer('HTTP_HOST'); + $host = $this->getRequest()->getHttpHost(); $port = $this->getRequest()->getServer('SERVER_PORT'); $path = $this->getRequest()->getBasePath(); - $host = ($host == null) ? 'localhost' : $host; $urlInfo = $host . $port . trim($path, '/'); $code = $scopeType . '|' . $scopeCode . '|' . $urlInfo; - + if (!isset($this->_scopes[$code])) { $cacheKey = $this->_cacheId . '|' . $code; $data = $this->_cache->load($cacheKey); From 0afd7b5bafff048aa5b4a94a4227f90868c516f8 Mon Sep 17 00:00:00 2001 From: Dale Sikkema Date: Tue, 7 Jun 2016 13:30:17 -0500 Subject: [PATCH 228/345] MAGETWO-52867: [APPSEC-1446] Sensitive server information disclosure upon specific URL requests --- pub/.htaccess | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pub/.htaccess b/pub/.htaccess index 6d70d0f19a838..926c012eef6a5 100644 --- a/pub/.htaccess +++ b/pub/.htaccess @@ -197,6 +197,10 @@ deny from all +# For 404s and 403s that aren't handled by the application, show plain 404 response +ErrorDocument 404 /errors/404.php +ErrorDocument 403 /errors/404.php + ############################################ ## If running in cluster environment, uncomment this ## http://developer.yahoo.com/performance/rules.html#etags From 43cf72eb1d43e351f314ccb42ba2199f70e2f204 Mon Sep 17 00:00:00 2001 From: Dale Sikkema Date: Tue, 7 Jun 2016 13:39:01 -0500 Subject: [PATCH 229/345] MAGETWO-52867: [APPSEC-1446] Sensitive server information disclosure upon specific URL requests --- .htaccess | 4 ++-- .htaccess.sample | 61 ++++++++++++++++++++++++++---------------------- 2 files changed, 35 insertions(+), 30 deletions(-) diff --git a/.htaccess b/.htaccess index 9db22a53dde42..61a6e70d03e7f 100644 --- a/.htaccess +++ b/.htaccess @@ -277,8 +277,8 @@ deny from all - order allow,deny - deny from all + order allow,deny + deny from all # For 404s and 403s that aren't handled by the application, show plain 404 response diff --git a/.htaccess.sample b/.htaccess.sample index a6818c1e6b89a..61a6e70d03e7f 100644 --- a/.htaccess.sample +++ b/.htaccess.sample @@ -1,11 +1,12 @@ ############################################ -## Optional override of deployment mode. We recommend you use the -## command bin/magento deploy:mode:set to switch modes instead -# SetEnv MAGE_MODE default # or production or developer +## overrides deployment configuration mode value +## use command bin/magento deploy:mode:set to switch modes + +# SetEnv MAGE_MODE developer ############################################ -## Uncomment these lines for CGI mode. -## Make sure to specify the correct cgi php binary file name +## uncomment these lines for CGI mode +## make sure to specify the correct cgi php binary file name ## it might be /cgi-bin/php-cgi # Action php5-cgi /cgi-bin/php5-cgi @@ -16,42 +17,42 @@ # Options -MultiViews -## You might also need to add this line to php.ini +## you might also need to add this line to php.ini ## cgi.fix_pathinfo = 1 -## If it still doesn't work, rename php.ini to php5.ini +## if it still doesn't work, rename php.ini to php5.ini ############################################ -## This line is specific for 1and1 hosting +## this line is specific for 1and1 hosting #AddType x-mapp-php5 .php #AddHandler x-mapp-php5 .php ############################################ -## Default index file +## default index file DirectoryIndex index.php ############################################ -## Adjust memory limit +## adjust memory limit php_value memory_limit 768M php_value max_execution_time 18000 ############################################ -## Disable automatic session start +## disable automatic session start ## before autoload was initialized php_flag session.auto_start off ############################################ -## Enable resulting html compression +## enable resulting html compression #php_flag zlib.output_compression on ########################################### -## Disable user agent verification to not break multiple image upload +## disable user agent verification to not break multiple image upload php_flag suhosin.session.cryptua off @@ -60,24 +61,24 @@ ############################################ -## Adjust memory limit +## adjust memory limit php_value memory_limit 768M php_value max_execution_time 18000 ############################################ -## Disable automatic session start +## disable automatic session start ## before autoload was initialized php_flag session.auto_start off ############################################ -## Enable resulting html compression +## enable resulting html compression #php_flag zlib.output_compression on ########################################### -## Disable user agent verification to not break multiple image upload +## disable user agent verification to not break multiple image upload php_flag suhosin.session.cryptua off @@ -85,7 +86,7 @@ ########################################### -## Disable POST processing to not break multiple image upload +## disable POST processing to not break multiple image upload SecFilterEngine Off SecFilterScanPOST Off @@ -94,7 +95,7 @@ ############################################ -## Enable apache served files compression +## enable apache served files compression ## http://developer.yahoo.com/performance/rules.html#gzip # Insert filter on all content @@ -122,14 +123,14 @@ ############################################ -## Make HTTPS env vars available for CGI mode +## make HTTPS env vars available for CGI mode SSLOptions StdEnvVars ############################################ -## Workaround for Apache 2.4.6 CentOS build when working via ProxyPassMatch with HHVM (or any other) +## workaround for Apache 2.4.6 CentOS build when working via ProxyPassMatch with HHVM (or any other) ## Please, set it on virtual host configuration level ## SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1 @@ -138,19 +139,19 @@ ############################################ -## Enable rewrites +## enable rewrites Options +FollowSymLinks RewriteEngine on ############################################ -## You can put here your magento root folder +## you can put here your magento root folder ## path relative to web root #RewriteBase /magento/ ############################################ -## Workaround for HTTP authorization +## workaround for HTTP authorization ## in CGI environment RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] @@ -162,21 +163,21 @@ RewriteRule .* - [L,R=405] ############################################ -## Redirect for mobile user agents +## redirect for mobile user agents #RewriteCond %{REQUEST_URI} !^/mobiledirectoryhere/.*$ #RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC] #RewriteRule ^(.*)$ /mobiledirectoryhere/ [L,R=302] ############################################ -## Never rewrite for existing files, directories and links +## never rewrite for existing files, directories and links RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l ############################################ -## Rewrite everything else to index.php +## rewrite everything else to index.php RewriteRule .* index.php [L] @@ -205,7 +206,7 @@ ########################################### ## Deny access to root files to hide sensitive application information - RedirectMatch 404 /\.git + RedirectMatch 403 /\.git order allow,deny @@ -280,6 +281,10 @@ deny from all +# For 404s and 403s that aren't handled by the application, show plain 404 response +ErrorDocument 404 /pub/errors/404.php +ErrorDocument 403 /pub/errors/404.php + ################################ ## If running in cluster environment, uncomment this ## http://developer.yahoo.com/performance/rules.html#etags From 3446a1eb5da518848a152895e947b7357ffbdea6 Mon Sep 17 00:00:00 2001 From: brywaters Date: Tue, 7 Jun 2016 13:50:59 -0500 Subject: [PATCH 230/345] MAGETWO-52923: Switching to Varnish causes category menu to force HTTPS links - Add Whitespace, Syntax --- .../Magento/Framework/HTTP/PhpEnvironment/Request.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php b/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php index 07c767970b71a..08f853595d56f 100644 --- a/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php +++ b/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php @@ -428,7 +428,7 @@ private function getSSLOffloadHeader() { // Lets read from db only one time okay. - if ($this->SSLOffloadHeader === null){ + if ($this->SSLOffloadHeader === null) { /* TODO: Untangle Config dependence on Scope, so that this class can be instantiated even if app is not installed MAGETWO-31756 */ @@ -438,7 +438,8 @@ private function getSSLOffloadHeader() self::XML_PATH_OFFLOADER_HEADER, \Magento\Framework\App\Config\ScopeConfigInterface::SCOPE_TYPE_DEFAULT ) - ); } + ); + } return $this->SSLOffloadHeader; From ef6ad274c7d92faac45e6d6b28d970d0bb4e2896 Mon Sep 17 00:00:00 2001 From: mage2-team Date: Tue, 7 Jun 2016 19:21:34 +0000 Subject: [PATCH 231/345] MAGETWO-53677: Magento 2.1.0-rc2 publication (build 2.1.0-rc2.012) --- .../Magento/AdminNotification/composer.json | 2 +- .../AdvancedPricingImportExport/composer.json | 2 +- app/code/Magento/Authorization/composer.json | 2 +- app/code/Magento/Authorizenet/composer.json | 2 +- app/code/Magento/Backend/composer.json | 2 +- app/code/Magento/Backup/composer.json | 2 +- app/code/Magento/Braintree/composer.json | 2 +- app/code/Magento/Bundle/composer.json | 2 +- .../Magento/BundleImportExport/composer.json | 2 +- .../Magento/CacheInvalidate/composer.json | 2 +- app/code/Magento/Captcha/composer.json | 2 +- app/code/Magento/Catalog/composer.json | 2 +- .../Magento/CatalogImportExport/composer.json | 2 +- .../Magento/CatalogInventory/composer.json | 2 +- app/code/Magento/CatalogRule/composer.json | 2 +- .../CatalogRuleConfigurable/composer.json | 2 +- app/code/Magento/CatalogSearch/composer.json | 2 +- .../Magento/CatalogUrlRewrite/composer.json | 2 +- app/code/Magento/CatalogWidget/composer.json | 2 +- app/code/Magento/Checkout/composer.json | 2 +- .../Magento/CheckoutAgreements/composer.json | 2 +- app/code/Magento/Cms/composer.json | 2 +- app/code/Magento/CmsUrlRewrite/composer.json | 2 +- app/code/Magento/Config/composer.json | 2 +- .../ConfigurableImportExport/composer.json | 2 +- .../Magento/ConfigurableProduct/composer.json | 2 +- app/code/Magento/Contact/composer.json | 2 +- app/code/Magento/Cookie/composer.json | 2 +- app/code/Magento/Cron/composer.json | 2 +- app/code/Magento/CurrencySymbol/composer.json | 2 +- app/code/Magento/Customer/composer.json | 2 +- .../CustomerImportExport/composer.json | 2 +- app/code/Magento/Deploy/composer.json | 2 +- app/code/Magento/Developer/composer.json | 2 +- app/code/Magento/Dhl/composer.json | 2 +- app/code/Magento/Directory/composer.json | 2 +- app/code/Magento/Downloadable/composer.json | 2 +- .../DownloadableImportExport/composer.json | 2 +- app/code/Magento/Eav/composer.json | 2 +- app/code/Magento/Email/composer.json | 2 +- app/code/Magento/EncryptionKey/composer.json | 2 +- app/code/Magento/Fedex/composer.json | 2 +- app/code/Magento/GiftMessage/composer.json | 2 +- app/code/Magento/GoogleAdwords/composer.json | 2 +- .../Magento/GoogleAnalytics/composer.json | 2 +- .../Magento/GoogleOptimizer/composer.json | 2 +- .../Magento/GroupedImportExport/composer.json | 2 +- app/code/Magento/GroupedProduct/composer.json | 2 +- app/code/Magento/ImportExport/composer.json | 2 +- app/code/Magento/Indexer/composer.json | 2 +- app/code/Magento/Integration/composer.json | 2 +- .../Magento/LayeredNavigation/composer.json | 2 +- app/code/Magento/Marketplace/composer.json | 2 +- app/code/Magento/MediaStorage/composer.json | 2 +- app/code/Magento/Msrp/composer.json | 2 +- app/code/Magento/Multishipping/composer.json | 2 +- .../Magento/NewRelicReporting/composer.json | 2 +- app/code/Magento/Newsletter/composer.json | 2 +- .../Magento/OfflinePayments/composer.json | 2 +- .../Magento/OfflineShipping/composer.json | 2 +- app/code/Magento/PageCache/composer.json | 2 +- app/code/Magento/Payment/composer.json | 2 +- app/code/Magento/Paypal/composer.json | 2 +- app/code/Magento/Persistent/composer.json | 2 +- app/code/Magento/ProductAlert/composer.json | 2 +- app/code/Magento/ProductVideo/composer.json | 2 +- app/code/Magento/Quote/composer.json | 2 +- app/code/Magento/Reports/composer.json | 2 +- app/code/Magento/RequireJs/composer.json | 2 +- app/code/Magento/Review/composer.json | 2 +- app/code/Magento/Rss/composer.json | 2 +- app/code/Magento/Rule/composer.json | 2 +- app/code/Magento/Sales/composer.json | 2 +- app/code/Magento/SalesRule/composer.json | 2 +- app/code/Magento/SalesSequence/composer.json | 2 +- app/code/Magento/SampleData/composer.json | 2 +- app/code/Magento/Search/composer.json | 2 +- app/code/Magento/Security/composer.json | 2 +- app/code/Magento/SendFriend/composer.json | 2 +- app/code/Magento/Shipping/composer.json | 2 +- app/code/Magento/Sitemap/composer.json | 2 +- app/code/Magento/Store/composer.json | 2 +- app/code/Magento/Swagger/composer.json | 2 +- app/code/Magento/Swatches/composer.json | 2 +- .../SwatchesLayeredNavigation/composer.json | 2 +- app/code/Magento/Tax/composer.json | 2 +- .../Magento/TaxImportExport/composer.json | 2 +- app/code/Magento/Theme/composer.json | 2 +- app/code/Magento/Translation/composer.json | 2 +- app/code/Magento/Ui/composer.json | 2 +- app/code/Magento/Ups/composer.json | 2 +- app/code/Magento/UrlRewrite/composer.json | 2 +- app/code/Magento/User/composer.json | 2 +- app/code/Magento/Usps/composer.json | 2 +- app/code/Magento/Variable/composer.json | 2 +- app/code/Magento/Vault/composer.json | 2 +- app/code/Magento/Version/composer.json | 2 +- app/code/Magento/Webapi/composer.json | 2 +- app/code/Magento/WebapiSecurity/composer.json | 2 +- app/code/Magento/Weee/composer.json | 2 +- app/code/Magento/Widget/composer.json | 2 +- app/code/Magento/Wishlist/composer.json | 2 +- .../adminhtml/Magento/backend/composer.json | 2 +- .../frontend/Magento/blank/composer.json | 2 +- .../frontend/Magento/luma/composer.json | 2 +- app/i18n/Magento/de_DE/composer.json | 2 +- app/i18n/Magento/en_US/composer.json | 2 +- app/i18n/Magento/es_ES/composer.json | 2 +- app/i18n/Magento/fr_FR/composer.json | 2 +- app/i18n/Magento/nl_NL/composer.json | 2 +- app/i18n/Magento/pt_BR/composer.json | 2 +- app/i18n/Magento/zh_Hans_CN/composer.json | 2 +- composer.json | 228 +++++++++--------- composer.lock | 89 +++---- lib/internal/Magento/Framework/composer.json | 2 +- 115 files changed, 273 insertions(+), 270 deletions(-) diff --git a/app/code/Magento/AdminNotification/composer.json b/app/code/Magento/AdminNotification/composer.json index 2825226ccc0d3..a5ff4626fd3bc 100644 --- a/app/code/Magento/AdminNotification/composer.json +++ b/app/code/Magento/AdminNotification/composer.json @@ -10,7 +10,7 @@ "lib-libxml": "*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/AdvancedPricingImportExport/composer.json b/app/code/Magento/AdvancedPricingImportExport/composer.json index 4044ad6ab652e..19afb241adae4 100644 --- a/app/code/Magento/AdvancedPricingImportExport/composer.json +++ b/app/code/Magento/AdvancedPricingImportExport/composer.json @@ -13,7 +13,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Authorization/composer.json b/app/code/Magento/Authorization/composer.json index 31ca58cdd763b..d65960082a006 100644 --- a/app/code/Magento/Authorization/composer.json +++ b/app/code/Magento/Authorization/composer.json @@ -7,7 +7,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Authorizenet/composer.json b/app/code/Magento/Authorizenet/composer.json index 773bc0796dc81..d3a622d78eaff 100644 --- a/app/code/Magento/Authorizenet/composer.json +++ b/app/code/Magento/Authorizenet/composer.json @@ -13,7 +13,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "proprietary" ], diff --git a/app/code/Magento/Backend/composer.json b/app/code/Magento/Backend/composer.json index 12b93bab154fa..ce7fe2a98f78b 100644 --- a/app/code/Magento/Backend/composer.json +++ b/app/code/Magento/Backend/composer.json @@ -22,7 +22,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Backup/composer.json b/app/code/Magento/Backup/composer.json index e30248991e37f..320d7bab4f762 100644 --- a/app/code/Magento/Backup/composer.json +++ b/app/code/Magento/Backup/composer.json @@ -9,7 +9,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Braintree/composer.json b/app/code/Magento/Braintree/composer.json index 575cb6d9d8617..66c6acb6c0afc 100644 --- a/app/code/Magento/Braintree/composer.json +++ b/app/code/Magento/Braintree/composer.json @@ -23,7 +23,7 @@ "magento/module-checkout-agreements": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "proprietary" ], diff --git a/app/code/Magento/Bundle/composer.json b/app/code/Magento/Bundle/composer.json index ddc3a5862802e..ebfbe05c4731c 100644 --- a/app/code/Magento/Bundle/composer.json +++ b/app/code/Magento/Bundle/composer.json @@ -25,7 +25,7 @@ "magento/module-bundle-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/BundleImportExport/composer.json b/app/code/Magento/BundleImportExport/composer.json index a2d79277cf85d..29653cf2bb615 100644 --- a/app/code/Magento/BundleImportExport/composer.json +++ b/app/code/Magento/BundleImportExport/composer.json @@ -11,7 +11,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CacheInvalidate/composer.json b/app/code/Magento/CacheInvalidate/composer.json index 0652d0f1f969c..8ce9f571b5769 100644 --- a/app/code/Magento/CacheInvalidate/composer.json +++ b/app/code/Magento/CacheInvalidate/composer.json @@ -7,7 +7,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Captcha/composer.json b/app/code/Magento/Captcha/composer.json index 19c6147f8da85..62c7f1c7a2aeb 100644 --- a/app/code/Magento/Captcha/composer.json +++ b/app/code/Magento/Captcha/composer.json @@ -10,7 +10,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Catalog/composer.json b/app/code/Magento/Catalog/composer.json index 437a563c9332c..4217e66296801 100644 --- a/app/code/Magento/Catalog/composer.json +++ b/app/code/Magento/Catalog/composer.json @@ -33,7 +33,7 @@ "magento/module-catalog-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "101.0.0-rc1", + "version": "101.0.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CatalogImportExport/composer.json b/app/code/Magento/CatalogImportExport/composer.json index 4f68ae662bcbf..9d4b2d717b081 100644 --- a/app/code/Magento/CatalogImportExport/composer.json +++ b/app/code/Magento/CatalogImportExport/composer.json @@ -16,7 +16,7 @@ "ext-ctype": "*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CatalogInventory/composer.json b/app/code/Magento/CatalogInventory/composer.json index 218beeecc14a0..d9bd0725683ac 100644 --- a/app/code/Magento/CatalogInventory/composer.json +++ b/app/code/Magento/CatalogInventory/composer.json @@ -13,7 +13,7 @@ "magento/module-ui": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CatalogRule/composer.json b/app/code/Magento/CatalogRule/composer.json index ea966702319e0..1e7eeb9c77e19 100644 --- a/app/code/Magento/CatalogRule/composer.json +++ b/app/code/Magento/CatalogRule/composer.json @@ -17,7 +17,7 @@ "magento/module-catalog-rule-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CatalogRuleConfigurable/composer.json b/app/code/Magento/CatalogRuleConfigurable/composer.json index 1bd2ef50b5463..739f95bec5042 100644 --- a/app/code/Magento/CatalogRuleConfigurable/composer.json +++ b/app/code/Magento/CatalogRuleConfigurable/composer.json @@ -11,7 +11,7 @@ "magento/module-catalog-rule": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CatalogSearch/composer.json b/app/code/Magento/CatalogSearch/composer.json index 8e7d638adda54..4918ac9a94006 100644 --- a/app/code/Magento/CatalogSearch/composer.json +++ b/app/code/Magento/CatalogSearch/composer.json @@ -15,7 +15,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CatalogUrlRewrite/composer.json b/app/code/Magento/CatalogUrlRewrite/composer.json index 7b13780a58e90..4dfab17216d40 100644 --- a/app/code/Magento/CatalogUrlRewrite/composer.json +++ b/app/code/Magento/CatalogUrlRewrite/composer.json @@ -14,7 +14,7 @@ "magento/module-ui": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CatalogWidget/composer.json b/app/code/Magento/CatalogWidget/composer.json index 1992b9ad5dfb4..b832b61f75f63 100644 --- a/app/code/Magento/CatalogWidget/composer.json +++ b/app/code/Magento/CatalogWidget/composer.json @@ -14,7 +14,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Checkout/composer.json b/app/code/Magento/Checkout/composer.json index c43a53baf2642..3717884d70f3f 100644 --- a/app/code/Magento/Checkout/composer.json +++ b/app/code/Magento/Checkout/composer.json @@ -27,7 +27,7 @@ "magento/module-cookie": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CheckoutAgreements/composer.json b/app/code/Magento/CheckoutAgreements/composer.json index 602fce13c1c06..a453a2e34aec0 100644 --- a/app/code/Magento/CheckoutAgreements/composer.json +++ b/app/code/Magento/CheckoutAgreements/composer.json @@ -10,7 +10,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Cms/composer.json b/app/code/Magento/Cms/composer.json index b247e77d0574f..d6c983b04360a 100644 --- a/app/code/Magento/Cms/composer.json +++ b/app/code/Magento/Cms/composer.json @@ -18,7 +18,7 @@ "magento/module-cms-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "101.0.0-rc1", + "version": "101.0.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CmsUrlRewrite/composer.json b/app/code/Magento/CmsUrlRewrite/composer.json index 089eeff346d39..c96eb98ac7384 100644 --- a/app/code/Magento/CmsUrlRewrite/composer.json +++ b/app/code/Magento/CmsUrlRewrite/composer.json @@ -9,7 +9,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Config/composer.json b/app/code/Magento/Config/composer.json index f47df5d5b0d69..9acaa0bbcd738 100644 --- a/app/code/Magento/Config/composer.json +++ b/app/code/Magento/Config/composer.json @@ -12,7 +12,7 @@ "magento/module-media-storage": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/ConfigurableImportExport/composer.json b/app/code/Magento/ConfigurableImportExport/composer.json index f6fb53c5fc26d..aefb8279bf4d4 100644 --- a/app/code/Magento/ConfigurableImportExport/composer.json +++ b/app/code/Magento/ConfigurableImportExport/composer.json @@ -11,7 +11,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/ConfigurableProduct/composer.json b/app/code/Magento/ConfigurableProduct/composer.json index 9a11156eef859..f09a9bf12a43b 100644 --- a/app/code/Magento/ConfigurableProduct/composer.json +++ b/app/code/Magento/ConfigurableProduct/composer.json @@ -23,7 +23,7 @@ "magento/module-product-links-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Contact/composer.json b/app/code/Magento/Contact/composer.json index b7ec207cacddb..6128c2e8514be 100644 --- a/app/code/Magento/Contact/composer.json +++ b/app/code/Magento/Contact/composer.json @@ -10,7 +10,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Cookie/composer.json b/app/code/Magento/Cookie/composer.json index 00f7834591d38..196de2123f48b 100644 --- a/app/code/Magento/Cookie/composer.json +++ b/app/code/Magento/Cookie/composer.json @@ -10,7 +10,7 @@ "magento/module-backend": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Cron/composer.json b/app/code/Magento/Cron/composer.json index 7e79af12464c8..385881c67b2d6 100644 --- a/app/code/Magento/Cron/composer.json +++ b/app/code/Magento/Cron/composer.json @@ -10,7 +10,7 @@ "magento/module-config": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CurrencySymbol/composer.json b/app/code/Magento/CurrencySymbol/composer.json index fcf189dc840ff..e14e1d7081b41 100644 --- a/app/code/Magento/CurrencySymbol/composer.json +++ b/app/code/Magento/CurrencySymbol/composer.json @@ -11,7 +11,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Customer/composer.json b/app/code/Magento/Customer/composer.json index eaa197e0da517..2600a6b4cb22d 100644 --- a/app/code/Magento/Customer/composer.json +++ b/app/code/Magento/Customer/composer.json @@ -29,7 +29,7 @@ "magento/module-customer-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CustomerImportExport/composer.json b/app/code/Magento/CustomerImportExport/composer.json index 929a6d7f5a1da..d12da307c53a2 100644 --- a/app/code/Magento/CustomerImportExport/composer.json +++ b/app/code/Magento/CustomerImportExport/composer.json @@ -12,7 +12,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Deploy/composer.json b/app/code/Magento/Deploy/composer.json index 0c9cad74fb835..4f46572535faf 100644 --- a/app/code/Magento/Deploy/composer.json +++ b/app/code/Magento/Deploy/composer.json @@ -10,7 +10,7 @@ "magento/module-user": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Developer/composer.json b/app/code/Magento/Developer/composer.json index c81de6f060276..81f21d0a80074 100644 --- a/app/code/Magento/Developer/composer.json +++ b/app/code/Magento/Developer/composer.json @@ -7,7 +7,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Dhl/composer.json b/app/code/Magento/Dhl/composer.json index bd1d98aa96190..f62945765d178 100644 --- a/app/code/Magento/Dhl/composer.json +++ b/app/code/Magento/Dhl/composer.json @@ -19,7 +19,7 @@ "magento/module-checkout": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Directory/composer.json b/app/code/Magento/Directory/composer.json index d758eb51b921f..0e702ffa96e80 100644 --- a/app/code/Magento/Directory/composer.json +++ b/app/code/Magento/Directory/composer.json @@ -10,7 +10,7 @@ "lib-libxml": "*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Downloadable/composer.json b/app/code/Magento/Downloadable/composer.json index 99383ab596636..3e607c6733088 100644 --- a/app/code/Magento/Downloadable/composer.json +++ b/app/code/Magento/Downloadable/composer.json @@ -25,7 +25,7 @@ "magento/module-downloadable-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/DownloadableImportExport/composer.json b/app/code/Magento/DownloadableImportExport/composer.json index b0291a15bb8f4..23fc9d637a58d 100644 --- a/app/code/Magento/DownloadableImportExport/composer.json +++ b/app/code/Magento/DownloadableImportExport/composer.json @@ -12,7 +12,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Eav/composer.json b/app/code/Magento/Eav/composer.json index ca12f90d6a16a..e468a13392014 100644 --- a/app/code/Magento/Eav/composer.json +++ b/app/code/Magento/Eav/composer.json @@ -11,7 +11,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Email/composer.json b/app/code/Magento/Email/composer.json index 5ef136daf489b..fd86a296cbf7e 100644 --- a/app/code/Magento/Email/composer.json +++ b/app/code/Magento/Email/composer.json @@ -11,7 +11,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/EncryptionKey/composer.json b/app/code/Magento/EncryptionKey/composer.json index 1276dd110b984..011d4f2ced197 100644 --- a/app/code/Magento/EncryptionKey/composer.json +++ b/app/code/Magento/EncryptionKey/composer.json @@ -8,7 +8,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "proprietary" ], diff --git a/app/code/Magento/Fedex/composer.json b/app/code/Magento/Fedex/composer.json index dd18ec6218a60..934c0969352d8 100644 --- a/app/code/Magento/Fedex/composer.json +++ b/app/code/Magento/Fedex/composer.json @@ -15,7 +15,7 @@ "lib-libxml": "*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GiftMessage/composer.json b/app/code/Magento/GiftMessage/composer.json index 60e982a03111f..02f225a6900d1 100644 --- a/app/code/Magento/GiftMessage/composer.json +++ b/app/code/Magento/GiftMessage/composer.json @@ -18,7 +18,7 @@ "magento/module-multishipping": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GoogleAdwords/composer.json b/app/code/Magento/GoogleAdwords/composer.json index c50478ea22e4e..30d7aa070c6be 100644 --- a/app/code/Magento/GoogleAdwords/composer.json +++ b/app/code/Magento/GoogleAdwords/composer.json @@ -8,7 +8,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GoogleAnalytics/composer.json b/app/code/Magento/GoogleAnalytics/composer.json index adee6f2654149..7798653830ebc 100644 --- a/app/code/Magento/GoogleAnalytics/composer.json +++ b/app/code/Magento/GoogleAnalytics/composer.json @@ -9,7 +9,7 @@ "magento/module-cookie": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GoogleOptimizer/composer.json b/app/code/Magento/GoogleOptimizer/composer.json index d77743763d0e3..8a5a443ee10b3 100644 --- a/app/code/Magento/GoogleOptimizer/composer.json +++ b/app/code/Magento/GoogleOptimizer/composer.json @@ -12,7 +12,7 @@ "magento/module-ui": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GroupedImportExport/composer.json b/app/code/Magento/GroupedImportExport/composer.json index 6d5041af2b230..9268f5fdcff1e 100644 --- a/app/code/Magento/GroupedImportExport/composer.json +++ b/app/code/Magento/GroupedImportExport/composer.json @@ -11,7 +11,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GroupedProduct/composer.json b/app/code/Magento/GroupedProduct/composer.json index eb8ee0aff2315..a0abec4d8eebf 100644 --- a/app/code/Magento/GroupedProduct/composer.json +++ b/app/code/Magento/GroupedProduct/composer.json @@ -21,7 +21,7 @@ "magento/module-grouped-product-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/ImportExport/composer.json b/app/code/Magento/ImportExport/composer.json index 36feefee7538d..943f15028397f 100644 --- a/app/code/Magento/ImportExport/composer.json +++ b/app/code/Magento/ImportExport/composer.json @@ -11,7 +11,7 @@ "ext-ctype": "*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Indexer/composer.json b/app/code/Magento/Indexer/composer.json index 8c43ccc921dd0..a8e1b7953add7 100644 --- a/app/code/Magento/Indexer/composer.json +++ b/app/code/Magento/Indexer/composer.json @@ -7,7 +7,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Integration/composer.json b/app/code/Magento/Integration/composer.json index 7a2193c790c01..2cfc87bd5fd0f 100644 --- a/app/code/Magento/Integration/composer.json +++ b/app/code/Magento/Integration/composer.json @@ -12,7 +12,7 @@ "magento/module-authorization": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/LayeredNavigation/composer.json b/app/code/Magento/LayeredNavigation/composer.json index c9d0b2814be11..525600c000a76 100644 --- a/app/code/Magento/LayeredNavigation/composer.json +++ b/app/code/Magento/LayeredNavigation/composer.json @@ -8,7 +8,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Marketplace/composer.json b/app/code/Magento/Marketplace/composer.json index e77f96f447355..01b2a68c6d58b 100644 --- a/app/code/Magento/Marketplace/composer.json +++ b/app/code/Magento/Marketplace/composer.json @@ -7,7 +7,7 @@ "magento/module-backend": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/MediaStorage/composer.json b/app/code/Magento/MediaStorage/composer.json index 9f91750587f52..138a85c06b77e 100644 --- a/app/code/Magento/MediaStorage/composer.json +++ b/app/code/Magento/MediaStorage/composer.json @@ -9,7 +9,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Msrp/composer.json b/app/code/Magento/Msrp/composer.json index 2415b14f8c5fa..1c8a85b2179cc 100644 --- a/app/code/Magento/Msrp/composer.json +++ b/app/code/Magento/Msrp/composer.json @@ -16,7 +16,7 @@ "magento/module-msrp-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Multishipping/composer.json b/app/code/Magento/Multishipping/composer.json index f5173b046e263..0a8d35e17f866 100644 --- a/app/code/Magento/Multishipping/composer.json +++ b/app/code/Magento/Multishipping/composer.json @@ -14,7 +14,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/NewRelicReporting/composer.json b/app/code/Magento/NewRelicReporting/composer.json index 4648e06598204..997a290be73ce 100644 --- a/app/code/Magento/NewRelicReporting/composer.json +++ b/app/code/Magento/NewRelicReporting/composer.json @@ -13,7 +13,7 @@ "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Newsletter/composer.json b/app/code/Magento/Newsletter/composer.json index 76cb66b01762a..2d54648741ace 100644 --- a/app/code/Magento/Newsletter/composer.json +++ b/app/code/Magento/Newsletter/composer.json @@ -15,7 +15,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/OfflinePayments/composer.json b/app/code/Magento/OfflinePayments/composer.json index 7f4252756a898..0b07572ac9c3b 100644 --- a/app/code/Magento/OfflinePayments/composer.json +++ b/app/code/Magento/OfflinePayments/composer.json @@ -8,7 +8,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/OfflineShipping/composer.json b/app/code/Magento/OfflineShipping/composer.json index 69434fb173c58..543ca58297f75 100644 --- a/app/code/Magento/OfflineShipping/composer.json +++ b/app/code/Magento/OfflineShipping/composer.json @@ -19,7 +19,7 @@ "magento/module-offline-shipping-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/PageCache/composer.json b/app/code/Magento/PageCache/composer.json index 3e6cf171db413..e3d22dfb23932 100644 --- a/app/code/Magento/PageCache/composer.json +++ b/app/code/Magento/PageCache/composer.json @@ -9,7 +9,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Payment/composer.json b/app/code/Magento/Payment/composer.json index 5d3d98be50c48..877c83cf3603f 100644 --- a/app/code/Magento/Payment/composer.json +++ b/app/code/Magento/Payment/composer.json @@ -12,7 +12,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Paypal/composer.json b/app/code/Magento/Paypal/composer.json index 8ebc2e90574d3..7e63e4c053288 100644 --- a/app/code/Magento/Paypal/composer.json +++ b/app/code/Magento/Paypal/composer.json @@ -25,7 +25,7 @@ "magento/module-checkout-agreements": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "proprietary" ], diff --git a/app/code/Magento/Persistent/composer.json b/app/code/Magento/Persistent/composer.json index 9ce21e38c5772..aae2bbf0d0e0b 100644 --- a/app/code/Magento/Persistent/composer.json +++ b/app/code/Magento/Persistent/composer.json @@ -12,7 +12,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/ProductAlert/composer.json b/app/code/Magento/ProductAlert/composer.json index 245a62c57cc67..fdf104976cce2 100644 --- a/app/code/Magento/ProductAlert/composer.json +++ b/app/code/Magento/ProductAlert/composer.json @@ -10,7 +10,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/ProductVideo/composer.json b/app/code/Magento/ProductVideo/composer.json index 437152d714a74..f43aae999e7dc 100644 --- a/app/code/Magento/ProductVideo/composer.json +++ b/app/code/Magento/ProductVideo/composer.json @@ -15,7 +15,7 @@ "magento/module-customer": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "proprietary" ], diff --git a/app/code/Magento/Quote/composer.json b/app/code/Magento/Quote/composer.json index f7654cd8ab85e..9164216cacc19 100644 --- a/app/code/Magento/Quote/composer.json +++ b/app/code/Magento/Quote/composer.json @@ -20,7 +20,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Reports/composer.json b/app/code/Magento/Reports/composer.json index b64109a39ea99..5cc6e4bd584d9 100644 --- a/app/code/Magento/Reports/composer.json +++ b/app/code/Magento/Reports/composer.json @@ -22,7 +22,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/RequireJs/composer.json b/app/code/Magento/RequireJs/composer.json index 55b1453a82c8d..232819ad63896 100644 --- a/app/code/Magento/RequireJs/composer.json +++ b/app/code/Magento/RequireJs/composer.json @@ -6,7 +6,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Review/composer.json b/app/code/Magento/Review/composer.json index f878b6120a9e6..ed965f036e9b3 100644 --- a/app/code/Magento/Review/composer.json +++ b/app/code/Magento/Review/composer.json @@ -18,7 +18,7 @@ "magento/module-review-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Rss/composer.json b/app/code/Magento/Rss/composer.json index f8ffe2537d51f..3d9dbbdaa833d 100644 --- a/app/code/Magento/Rss/composer.json +++ b/app/code/Magento/Rss/composer.json @@ -9,7 +9,7 @@ "magento/module-customer": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Rule/composer.json b/app/code/Magento/Rule/composer.json index a5580336035a6..8ab711a13d49f 100644 --- a/app/code/Magento/Rule/composer.json +++ b/app/code/Magento/Rule/composer.json @@ -11,7 +11,7 @@ "lib-libxml": "*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Sales/composer.json b/app/code/Magento/Sales/composer.json index daaf167b8a8e8..99d89a1eb0493 100644 --- a/app/code/Magento/Sales/composer.json +++ b/app/code/Magento/Sales/composer.json @@ -32,7 +32,7 @@ "magento/module-sales-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/SalesRule/composer.json b/app/code/Magento/SalesRule/composer.json index 8f93b8f1c6102..9754e0bdde128 100644 --- a/app/code/Magento/SalesRule/composer.json +++ b/app/code/Magento/SalesRule/composer.json @@ -25,7 +25,7 @@ "magento/module-sales-rule-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/SalesSequence/composer.json b/app/code/Magento/SalesSequence/composer.json index 3ab3f38b4d5f8..ff77919dd5cea 100644 --- a/app/code/Magento/SalesSequence/composer.json +++ b/app/code/Magento/SalesSequence/composer.json @@ -6,7 +6,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/SampleData/composer.json b/app/code/Magento/SampleData/composer.json index da9fcc34320e3..03638b0a7b198 100644 --- a/app/code/Magento/SampleData/composer.json +++ b/app/code/Magento/SampleData/composer.json @@ -9,7 +9,7 @@ "magento/sample-data-media": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Search/composer.json b/app/code/Magento/Search/composer.json index ca69775a20e58..9968e792a9dc5 100644 --- a/app/code/Magento/Search/composer.json +++ b/app/code/Magento/Search/composer.json @@ -11,7 +11,7 @@ "magento/module-ui": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Security/composer.json b/app/code/Magento/Security/composer.json index 63d4b27c52fbf..8f2adcb92631a 100644 --- a/app/code/Magento/Security/composer.json +++ b/app/code/Magento/Security/composer.json @@ -11,7 +11,7 @@ "magento/module-customer": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/SendFriend/composer.json b/app/code/Magento/SendFriend/composer.json index 2268cddd65de3..b0691c8deee3e 100644 --- a/app/code/Magento/SendFriend/composer.json +++ b/app/code/Magento/SendFriend/composer.json @@ -10,7 +10,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Shipping/composer.json b/app/code/Magento/Shipping/composer.json index 3f192feac7c45..657409ab6b4d3 100644 --- a/app/code/Magento/Shipping/composer.json +++ b/app/code/Magento/Shipping/composer.json @@ -24,7 +24,7 @@ "magento/module-ups": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Sitemap/composer.json b/app/code/Magento/Sitemap/composer.json index 7334b53636d4e..69773c2eaf3bf 100644 --- a/app/code/Magento/Sitemap/composer.json +++ b/app/code/Magento/Sitemap/composer.json @@ -13,7 +13,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Store/composer.json b/app/code/Magento/Store/composer.json index 58f9fba9bf877..15f29f83fc3fa 100644 --- a/app/code/Magento/Store/composer.json +++ b/app/code/Magento/Store/composer.json @@ -11,7 +11,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Swagger/composer.json b/app/code/Magento/Swagger/composer.json index a50fb9b54a7a9..02021c4316598 100644 --- a/app/code/Magento/Swagger/composer.json +++ b/app/code/Magento/Swagger/composer.json @@ -6,7 +6,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Swatches/composer.json b/app/code/Magento/Swatches/composer.json index d926268dda751..a2a5e111d0f40 100644 --- a/app/code/Magento/Swatches/composer.json +++ b/app/code/Magento/Swatches/composer.json @@ -19,7 +19,7 @@ "magento/module-swatches-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "proprietary" ], diff --git a/app/code/Magento/SwatchesLayeredNavigation/composer.json b/app/code/Magento/SwatchesLayeredNavigation/composer.json index df5417c5dc16d..c0062154d47fe 100644 --- a/app/code/Magento/SwatchesLayeredNavigation/composer.json +++ b/app/code/Magento/SwatchesLayeredNavigation/composer.json @@ -7,7 +7,7 @@ "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Tax/composer.json b/app/code/Magento/Tax/composer.json index bc193814ee327..2c8533691ebc4 100644 --- a/app/code/Magento/Tax/composer.json +++ b/app/code/Magento/Tax/composer.json @@ -22,7 +22,7 @@ "magento/module-tax-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/TaxImportExport/composer.json b/app/code/Magento/TaxImportExport/composer.json index a3e16267ed5c1..4df8a694d61cc 100644 --- a/app/code/Magento/TaxImportExport/composer.json +++ b/app/code/Magento/TaxImportExport/composer.json @@ -10,7 +10,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Theme/composer.json b/app/code/Magento/Theme/composer.json index 8ef1248995c6d..1c405fa051fc8 100644 --- a/app/code/Magento/Theme/composer.json +++ b/app/code/Magento/Theme/composer.json @@ -21,7 +21,7 @@ "magento/module-theme-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Translation/composer.json b/app/code/Magento/Translation/composer.json index 4096c3a1fafed..3ea623dcd4a56 100644 --- a/app/code/Magento/Translation/composer.json +++ b/app/code/Magento/Translation/composer.json @@ -10,7 +10,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Ui/composer.json b/app/code/Magento/Ui/composer.json index 132189862cdaf..349619c8972be 100644 --- a/app/code/Magento/Ui/composer.json +++ b/app/code/Magento/Ui/composer.json @@ -10,7 +10,7 @@ "magento/module-user": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Ups/composer.json b/app/code/Magento/Ups/composer.json index 5411b2b1194fc..2b5828e1ccd41 100644 --- a/app/code/Magento/Ups/composer.json +++ b/app/code/Magento/Ups/composer.json @@ -13,7 +13,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/UrlRewrite/composer.json b/app/code/Magento/UrlRewrite/composer.json index 049eda5a48d73..0e2e119f04e34 100644 --- a/app/code/Magento/UrlRewrite/composer.json +++ b/app/code/Magento/UrlRewrite/composer.json @@ -12,7 +12,7 @@ "magento/module-cms-url-rewrite": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/User/composer.json b/app/code/Magento/User/composer.json index 372358b6238cd..07a17b0b76948 100644 --- a/app/code/Magento/User/composer.json +++ b/app/code/Magento/User/composer.json @@ -12,7 +12,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Usps/composer.json b/app/code/Magento/Usps/composer.json index 65ecac7a4d72c..d1ec7238dfa45 100644 --- a/app/code/Magento/Usps/composer.json +++ b/app/code/Magento/Usps/composer.json @@ -15,7 +15,7 @@ "lib-libxml": "*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Variable/composer.json b/app/code/Magento/Variable/composer.json index 493f3b081003a..de285c221d46e 100644 --- a/app/code/Magento/Variable/composer.json +++ b/app/code/Magento/Variable/composer.json @@ -9,7 +9,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Vault/composer.json b/app/code/Magento/Vault/composer.json index 3154832f55a8b..f91c6661216ca 100644 --- a/app/code/Magento/Vault/composer.json +++ b/app/code/Magento/Vault/composer.json @@ -14,7 +14,7 @@ "magento/module-theme": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "proprietary" ], diff --git a/app/code/Magento/Version/composer.json b/app/code/Magento/Version/composer.json index fed3b8bc9a5fb..bf8bb26f41490 100644 --- a/app/code/Magento/Version/composer.json +++ b/app/code/Magento/Version/composer.json @@ -6,7 +6,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Webapi/composer.json b/app/code/Magento/Webapi/composer.json index 520bc6e5b2440..62ea96bf54b6b 100644 --- a/app/code/Magento/Webapi/composer.json +++ b/app/code/Magento/Webapi/composer.json @@ -13,7 +13,7 @@ "magento/module-user": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/WebapiSecurity/composer.json b/app/code/Magento/WebapiSecurity/composer.json index c18b4dc9e2d6e..e1e4cbe2c96e1 100644 --- a/app/code/Magento/WebapiSecurity/composer.json +++ b/app/code/Magento/WebapiSecurity/composer.json @@ -7,7 +7,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Weee/composer.json b/app/code/Magento/Weee/composer.json index cacb8fd50c872..d39cdc61585ea 100644 --- a/app/code/Magento/Weee/composer.json +++ b/app/code/Magento/Weee/composer.json @@ -18,7 +18,7 @@ "magento/module-ui": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Widget/composer.json b/app/code/Magento/Widget/composer.json index 02a1fbe2e112c..8597b485a3f12 100644 --- a/app/code/Magento/Widget/composer.json +++ b/app/code/Magento/Widget/composer.json @@ -16,7 +16,7 @@ "magento/module-widget-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Wishlist/composer.json b/app/code/Magento/Wishlist/composer.json index 610ec9bd5ad0d..5355cb6b8f6f4 100644 --- a/app/code/Magento/Wishlist/composer.json +++ b/app/code/Magento/Wishlist/composer.json @@ -24,7 +24,7 @@ "magento/module-wishlist-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/design/adminhtml/Magento/backend/composer.json b/app/design/adminhtml/Magento/backend/composer.json index 4673b27453cff..208efec244246 100644 --- a/app/design/adminhtml/Magento/backend/composer.json +++ b/app/design/adminhtml/Magento/backend/composer.json @@ -6,7 +6,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-theme", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/design/frontend/Magento/blank/composer.json b/app/design/frontend/Magento/blank/composer.json index 2f87d91f567be..982ca768c2b36 100644 --- a/app/design/frontend/Magento/blank/composer.json +++ b/app/design/frontend/Magento/blank/composer.json @@ -6,7 +6,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-theme", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/design/frontend/Magento/luma/composer.json b/app/design/frontend/Magento/luma/composer.json index 7ffb2fe6e0e49..83b42c6fc3a78 100644 --- a/app/design/frontend/Magento/luma/composer.json +++ b/app/design/frontend/Magento/luma/composer.json @@ -7,7 +7,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-theme", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/i18n/Magento/de_DE/composer.json b/app/i18n/Magento/de_DE/composer.json index 7bbb85020e85c..ee969e5402925 100644 --- a/app/i18n/Magento/de_DE/composer.json +++ b/app/i18n/Magento/de_DE/composer.json @@ -1,7 +1,7 @@ { "name": "magento/language-de_de", "description": "German (Germany) language", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/i18n/Magento/en_US/composer.json b/app/i18n/Magento/en_US/composer.json index e4aba6964b900..8329fc1dc9861 100644 --- a/app/i18n/Magento/en_US/composer.json +++ b/app/i18n/Magento/en_US/composer.json @@ -1,7 +1,7 @@ { "name": "magento/language-en_us", "description": "English (United States) language", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/i18n/Magento/es_ES/composer.json b/app/i18n/Magento/es_ES/composer.json index ce73b37319fbd..3e8b1aa125692 100644 --- a/app/i18n/Magento/es_ES/composer.json +++ b/app/i18n/Magento/es_ES/composer.json @@ -1,7 +1,7 @@ { "name": "magento/language-es_es", "description": "Spanish (Spain) language", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/i18n/Magento/fr_FR/composer.json b/app/i18n/Magento/fr_FR/composer.json index ba12df7968fb7..d2f8c03440f67 100644 --- a/app/i18n/Magento/fr_FR/composer.json +++ b/app/i18n/Magento/fr_FR/composer.json @@ -1,7 +1,7 @@ { "name": "magento/language-fr_fr", "description": "French (France) language", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/i18n/Magento/nl_NL/composer.json b/app/i18n/Magento/nl_NL/composer.json index 6e3d30cfabaea..e322b7fcf23a3 100644 --- a/app/i18n/Magento/nl_NL/composer.json +++ b/app/i18n/Magento/nl_NL/composer.json @@ -1,7 +1,7 @@ { "name": "magento/language-nl_nl", "description": "Dutch (Netherlands) language", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/i18n/Magento/pt_BR/composer.json b/app/i18n/Magento/pt_BR/composer.json index b1cb45a9bfe6b..40d903e957683 100644 --- a/app/i18n/Magento/pt_BR/composer.json +++ b/app/i18n/Magento/pt_BR/composer.json @@ -1,7 +1,7 @@ { "name": "magento/language-pt_br", "description": "Portuguese (Brazil) language", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/i18n/Magento/zh_Hans_CN/composer.json b/app/i18n/Magento/zh_Hans_CN/composer.json index 05e8327709f06..24f1c220c20ff 100644 --- a/app/i18n/Magento/zh_Hans_CN/composer.json +++ b/app/i18n/Magento/zh_Hans_CN/composer.json @@ -1,7 +1,7 @@ { "name": "magento/language-zh_hans_cn", "description": "Chinese (China) language", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/composer.json b/composer.json index 83f10dac027d1..e03d701d3ef48 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "magento/magento2ce", "description": "Magento 2 (Community Edition)", "type": "project", - "version": "2.1.0-rc1", + "version": "2.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" @@ -74,119 +74,119 @@ "sebastian/phpcpd": "2.0.0" }, "replace": { - "magento/module-marketplace": "100.1.0-rc1", - "magento/module-admin-notification": "100.1.0-rc1", - "magento/module-advanced-pricing-import-export": "100.1.0-rc1", - "magento/module-authorization": "100.1.0-rc1", - "magento/module-authorizenet": "100.1.0-rc1", - "magento/module-backend": "100.1.0-rc1", - "magento/module-backup": "100.1.0-rc1", - "magento/module-braintree": "100.1.0-rc1", - "magento/module-bundle": "100.1.0-rc1", - "magento/module-bundle-import-export": "100.1.0-rc1", - "magento/module-cache-invalidate": "100.1.0-rc1", - "magento/module-captcha": "100.1.0-rc1", - "magento/module-catalog": "101.0.0-rc1", - "magento/module-catalog-import-export": "100.1.0-rc1", - "magento/module-catalog-inventory": "100.1.0-rc1", - "magento/module-catalog-rule": "100.1.0-rc1", - "magento/module-catalog-rule-configurable": "100.1.0-rc1", - "magento/module-catalog-search": "100.1.0-rc1", - "magento/module-catalog-url-rewrite": "100.1.0-rc1", - "magento/module-catalog-widget": "100.1.0-rc1", - "magento/module-checkout": "100.1.0-rc1", - "magento/module-checkout-agreements": "100.1.0-rc1", - "magento/module-cms": "101.0.0-rc1", - "magento/module-cms-url-rewrite": "100.1.0-rc1", - "magento/module-config": "100.1.0-rc1", - "magento/module-configurable-import-export": "100.1.0-rc1", - "magento/module-configurable-product": "100.1.0-rc1", - "magento/module-contact": "100.1.0-rc1", - "magento/module-cookie": "100.1.0-rc1", - "magento/module-cron": "100.1.0-rc1", - "magento/module-currency-symbol": "100.1.0-rc1", - "magento/module-customer": "100.1.0-rc1", - "magento/module-customer-import-export": "100.1.0-rc1", - "magento/module-deploy": "100.1.0-rc1", - "magento/module-developer": "100.1.0-rc1", - "magento/module-dhl": "100.1.0-rc1", - "magento/module-directory": "100.1.0-rc1", - "magento/module-downloadable": "100.1.0-rc1", - "magento/module-downloadable-import-export": "100.1.0-rc1", - "magento/module-eav": "100.1.0-rc1", - "magento/module-email": "100.1.0-rc1", - "magento/module-encryption-key": "100.1.0-rc1", - "magento/module-fedex": "100.1.0-rc1", - "magento/module-gift-message": "100.1.0-rc1", - "magento/module-google-adwords": "100.1.0-rc1", - "magento/module-google-analytics": "100.1.0-rc1", - "magento/module-google-optimizer": "100.1.0-rc1", - "magento/module-grouped-import-export": "100.1.0-rc1", - "magento/module-grouped-product": "100.1.0-rc1", - "magento/module-import-export": "100.1.0-rc1", - "magento/module-indexer": "100.1.0-rc1", - "magento/module-integration": "100.1.0-rc1", - "magento/module-layered-navigation": "100.1.0-rc1", - "magento/module-media-storage": "100.1.0-rc1", - "magento/module-msrp": "100.1.0-rc1", - "magento/module-multishipping": "100.1.0-rc1", - "magento/module-new-relic-reporting": "100.1.0-rc1", - "magento/module-newsletter": "100.1.0-rc1", - "magento/module-offline-payments": "100.1.0-rc1", - "magento/module-offline-shipping": "100.1.0-rc1", - "magento/module-page-cache": "100.1.0-rc1", - "magento/module-payment": "100.1.0-rc1", - "magento/module-paypal": "100.1.0-rc1", - "magento/module-persistent": "100.1.0-rc1", - "magento/module-product-alert": "100.1.0-rc1", - "magento/module-product-video": "100.1.0-rc1", - "magento/module-quote": "100.1.0-rc1", - "magento/module-reports": "100.1.0-rc1", - "magento/module-require-js": "100.1.0-rc1", - "magento/module-review": "100.1.0-rc1", - "magento/module-rss": "100.1.0-rc1", - "magento/module-rule": "100.1.0-rc1", - "magento/module-sales": "100.1.0-rc1", - "magento/module-sales-rule": "100.1.0-rc1", - "magento/module-sales-sequence": "100.1.0-rc1", - "magento/module-sample-data": "100.1.0-rc1", - "magento/module-search": "100.1.0-rc1", - "magento/module-security": "100.1.0-rc1", - "magento/module-send-friend": "100.1.0-rc1", - "magento/module-shipping": "100.1.0-rc1", - "magento/module-sitemap": "100.1.0-rc1", - "magento/module-store": "100.1.0-rc1", - "magento/module-swagger": "100.1.0-rc1", - "magento/module-swatches": "100.1.0-rc1", - "magento/module-swatches-layered-navigation": "100.1.0-rc1", - "magento/module-tax": "100.1.0-rc1", - "magento/module-tax-import-export": "100.1.0-rc1", - "magento/module-theme": "100.1.0-rc1", - "magento/module-translation": "100.1.0-rc1", - "magento/module-ui": "100.1.0-rc1", - "magento/module-ups": "100.1.0-rc1", - "magento/module-url-rewrite": "100.1.0-rc1", - "magento/module-user": "100.1.0-rc1", - "magento/module-usps": "100.1.0-rc1", - "magento/module-variable": "100.1.0-rc1", - "magento/module-vault": "100.1.0-rc1", - "magento/module-version": "100.1.0-rc1", - "magento/module-webapi": "100.1.0-rc1", - "magento/module-webapi-security": "100.1.0-rc1", - "magento/module-weee": "100.1.0-rc1", - "magento/module-widget": "100.1.0-rc1", - "magento/module-wishlist": "100.1.0-rc1", - "magento/theme-adminhtml-backend": "100.1.0-rc1", - "magento/theme-frontend-blank": "100.1.0-rc1", - "magento/theme-frontend-luma": "100.1.0-rc1", - "magento/language-de_de": "100.1.0-rc1", - "magento/language-en_us": "100.1.0-rc1", - "magento/language-es_es": "100.1.0-rc1", - "magento/language-fr_fr": "100.1.0-rc1", - "magento/language-nl_nl": "100.1.0-rc1", - "magento/language-pt_br": "100.1.0-rc1", - "magento/language-zh_hans_cn": "100.1.0-rc1", - "magento/framework": "100.1.0-rc1", + "magento/module-marketplace": "100.1.0-rc2", + "magento/module-admin-notification": "100.1.0-rc2", + "magento/module-advanced-pricing-import-export": "100.1.0-rc2", + "magento/module-authorization": "100.1.0-rc2", + "magento/module-authorizenet": "100.1.0-rc2", + "magento/module-backend": "100.1.0-rc2", + "magento/module-backup": "100.1.0-rc2", + "magento/module-braintree": "100.1.0-rc2", + "magento/module-bundle": "100.1.0-rc2", + "magento/module-bundle-import-export": "100.1.0-rc2", + "magento/module-cache-invalidate": "100.1.0-rc2", + "magento/module-captcha": "100.1.0-rc2", + "magento/module-catalog": "101.0.0-rc2", + "magento/module-catalog-import-export": "100.1.0-rc2", + "magento/module-catalog-inventory": "100.1.0-rc2", + "magento/module-catalog-rule": "100.1.0-rc2", + "magento/module-catalog-rule-configurable": "100.1.0-rc2", + "magento/module-catalog-search": "100.1.0-rc2", + "magento/module-catalog-url-rewrite": "100.1.0-rc2", + "magento/module-catalog-widget": "100.1.0-rc2", + "magento/module-checkout": "100.1.0-rc2", + "magento/module-checkout-agreements": "100.1.0-rc2", + "magento/module-cms": "101.0.0-rc2", + "magento/module-cms-url-rewrite": "100.1.0-rc2", + "magento/module-config": "100.1.0-rc2", + "magento/module-configurable-import-export": "100.1.0-rc2", + "magento/module-configurable-product": "100.1.0-rc2", + "magento/module-contact": "100.1.0-rc2", + "magento/module-cookie": "100.1.0-rc2", + "magento/module-cron": "100.1.0-rc2", + "magento/module-currency-symbol": "100.1.0-rc2", + "magento/module-customer": "100.1.0-rc2", + "magento/module-customer-import-export": "100.1.0-rc2", + "magento/module-deploy": "100.1.0-rc2", + "magento/module-developer": "100.1.0-rc2", + "magento/module-dhl": "100.1.0-rc2", + "magento/module-directory": "100.1.0-rc2", + "magento/module-downloadable": "100.1.0-rc2", + "magento/module-downloadable-import-export": "100.1.0-rc2", + "magento/module-eav": "100.1.0-rc2", + "magento/module-email": "100.1.0-rc2", + "magento/module-encryption-key": "100.1.0-rc2", + "magento/module-fedex": "100.1.0-rc2", + "magento/module-gift-message": "100.1.0-rc2", + "magento/module-google-adwords": "100.1.0-rc2", + "magento/module-google-analytics": "100.1.0-rc2", + "magento/module-google-optimizer": "100.1.0-rc2", + "magento/module-grouped-import-export": "100.1.0-rc2", + "magento/module-grouped-product": "100.1.0-rc2", + "magento/module-import-export": "100.1.0-rc2", + "magento/module-indexer": "100.1.0-rc2", + "magento/module-integration": "100.1.0-rc2", + "magento/module-layered-navigation": "100.1.0-rc2", + "magento/module-media-storage": "100.1.0-rc2", + "magento/module-msrp": "100.1.0-rc2", + "magento/module-multishipping": "100.1.0-rc2", + "magento/module-new-relic-reporting": "100.1.0-rc2", + "magento/module-newsletter": "100.1.0-rc2", + "magento/module-offline-payments": "100.1.0-rc2", + "magento/module-offline-shipping": "100.1.0-rc2", + "magento/module-page-cache": "100.1.0-rc2", + "magento/module-payment": "100.1.0-rc2", + "magento/module-paypal": "100.1.0-rc2", + "magento/module-persistent": "100.1.0-rc2", + "magento/module-product-alert": "100.1.0-rc2", + "magento/module-product-video": "100.1.0-rc2", + "magento/module-quote": "100.1.0-rc2", + "magento/module-reports": "100.1.0-rc2", + "magento/module-require-js": "100.1.0-rc2", + "magento/module-review": "100.1.0-rc2", + "magento/module-rss": "100.1.0-rc2", + "magento/module-rule": "100.1.0-rc2", + "magento/module-sales": "100.1.0-rc2", + "magento/module-sales-rule": "100.1.0-rc2", + "magento/module-sales-sequence": "100.1.0-rc2", + "magento/module-sample-data": "100.1.0-rc2", + "magento/module-search": "100.1.0-rc2", + "magento/module-security": "100.1.0-rc2", + "magento/module-send-friend": "100.1.0-rc2", + "magento/module-shipping": "100.1.0-rc2", + "magento/module-sitemap": "100.1.0-rc2", + "magento/module-store": "100.1.0-rc2", + "magento/module-swagger": "100.1.0-rc2", + "magento/module-swatches": "100.1.0-rc2", + "magento/module-swatches-layered-navigation": "100.1.0-rc2", + "magento/module-tax": "100.1.0-rc2", + "magento/module-tax-import-export": "100.1.0-rc2", + "magento/module-theme": "100.1.0-rc2", + "magento/module-translation": "100.1.0-rc2", + "magento/module-ui": "100.1.0-rc2", + "magento/module-ups": "100.1.0-rc2", + "magento/module-url-rewrite": "100.1.0-rc2", + "magento/module-user": "100.1.0-rc2", + "magento/module-usps": "100.1.0-rc2", + "magento/module-variable": "100.1.0-rc2", + "magento/module-vault": "100.1.0-rc2", + "magento/module-version": "100.1.0-rc2", + "magento/module-webapi": "100.1.0-rc2", + "magento/module-webapi-security": "100.1.0-rc2", + "magento/module-weee": "100.1.0-rc2", + "magento/module-widget": "100.1.0-rc2", + "magento/module-wishlist": "100.1.0-rc2", + "magento/theme-adminhtml-backend": "100.1.0-rc2", + "magento/theme-frontend-blank": "100.1.0-rc2", + "magento/theme-frontend-luma": "100.1.0-rc2", + "magento/language-de_de": "100.1.0-rc2", + "magento/language-en_us": "100.1.0-rc2", + "magento/language-es_es": "100.1.0-rc2", + "magento/language-fr_fr": "100.1.0-rc2", + "magento/language-nl_nl": "100.1.0-rc2", + "magento/language-pt_br": "100.1.0-rc2", + "magento/language-zh_hans_cn": "100.1.0-rc2", + "magento/framework": "100.1.0-rc2", "trentrichardson/jquery-timepicker-addon": "1.4.3", "colinmollenhour/cache-backend-redis": "1.8", "components/jquery": "1.11.0", diff --git a/composer.lock b/composer.lock index fdb08888325f9..c34b3a5440be1 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "27d42810e5b6ec8260572205ff668d79", - "content-hash": "0afa9a8d1445d804681f338444acb755", + "hash": "2a5edf483d6b4e8b92814e135f0e4de3", + "content-hash": "9afe891ffda877cd8460a80a081f7c1d", "packages": [ { "name": "braintree/braintree_php", @@ -208,16 +208,16 @@ }, { "name": "composer/semver", - "version": "1.4.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "84c47f3d8901440403217afc120683c7385aecb8" + "reference": "03c9de5aa25e7672c4ad251eeaba0c47a06c8b98" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/84c47f3d8901440403217afc120683c7385aecb8", - "reference": "84c47f3d8901440403217afc120683c7385aecb8", + "url": "https://api.github.com/repos/composer/semver/zipball/03c9de5aa25e7672c4ad251eeaba0c47a06c8b98", + "reference": "03c9de5aa25e7672c4ad251eeaba0c47a06c8b98", "shasum": "" }, "require": { @@ -266,7 +266,7 @@ "validation", "versioning" ], - "time": "2016-03-30 13:16:03" + "time": "2016-06-02 09:04:51" }, { "name": "composer/spdx-licenses", @@ -799,16 +799,16 @@ }, { "name": "phpseclib/phpseclib", - "version": "2.0.1", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "ba6fb78f727cd09f2a649113b95468019e490585" + "reference": "3d265f7c079f5b37d33475f996d7a383c5fc8aeb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/ba6fb78f727cd09f2a649113b95468019e490585", - "reference": "ba6fb78f727cd09f2a649113b95468019e490585", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/3d265f7c079f5b37d33475f996d7a383c5fc8aeb", + "reference": "3d265f7c079f5b37d33475f996d7a383c5fc8aeb", "shasum": "" }, "require": { @@ -828,6 +828,9 @@ }, "type": "library", "autoload": { + "files": [ + "phpseclib/bootstrap.php" + ], "psr-4": { "phpseclib\\": "phpseclib/" } @@ -884,7 +887,7 @@ "x.509", "x509" ], - "time": "2016-01-18 17:07:21" + "time": "2016-05-13 01:15:21" }, { "name": "psr/log", @@ -1175,16 +1178,16 @@ }, { "name": "symfony/event-dispatcher", - "version": "v2.8.6", + "version": "v2.8.7", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "a158f13992a3147d466af7a23b564ac719a4ddd8" + "reference": "2a6b8713f8bdb582058cfda463527f195b066110" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a158f13992a3147d466af7a23b564ac719a4ddd8", - "reference": "a158f13992a3147d466af7a23b564ac719a4ddd8", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/2a6b8713f8bdb582058cfda463527f195b066110", + "reference": "2a6b8713f8bdb582058cfda463527f195b066110", "shasum": "" }, "require": { @@ -1231,11 +1234,11 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2016-05-03 18:59:18" + "time": "2016-06-06 11:11:27" }, { "name": "symfony/filesystem", - "version": "v2.8.6", + "version": "v2.8.7", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", @@ -1333,16 +1336,16 @@ }, { "name": "symfony/process", - "version": "v2.8.6", + "version": "v2.8.7", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "1276bd9be89be039748cf753a2137f4ef149cd74" + "reference": "115347d00c342198cdc52a7bd8bc15b5ab43500c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/1276bd9be89be039748cf753a2137f4ef149cd74", - "reference": "1276bd9be89be039748cf753a2137f4ef149cd74", + "url": "https://api.github.com/repos/symfony/process/zipball/115347d00c342198cdc52a7bd8bc15b5ab43500c", + "reference": "115347d00c342198cdc52a7bd8bc15b5ab43500c", "shasum": "" }, "require": { @@ -1378,7 +1381,7 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2016-04-14 15:22:22" + "time": "2016-06-06 11:11:27" }, { "name": "tedivm/jshrink", @@ -3027,16 +3030,16 @@ }, { "name": "fabpot/php-cs-fixer", - "version": "v1.11.3", + "version": "v1.11.4", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "b0a383d856d884d6b16e15892f507ecf89f8dbd2" + "reference": "eeb280e909834603ffe03524dbe0066e77c83084" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/b0a383d856d884d6b16e15892f507ecf89f8dbd2", - "reference": "b0a383d856d884d6b16e15892f507ecf89f8dbd2", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/eeb280e909834603ffe03524dbe0066e77c83084", + "reference": "eeb280e909834603ffe03524dbe0066e77c83084", "shasum": "" }, "require": { @@ -3078,7 +3081,7 @@ ], "description": "A tool to automatically fix PHP code style", "abandoned": "friendsofphp/php-cs-fixer", - "time": "2016-05-26 23:49:24" + "time": "2016-06-07 07:51:27" }, { "name": "lusitanian/oauth", @@ -4110,16 +4113,16 @@ }, { "name": "symfony/config", - "version": "v2.8.6", + "version": "v2.8.7", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "edbbcf33cffa2a85104fc80de8dc052cc51596bb" + "reference": "a2edd59c2163c65747fc3f35d132b5a39266bd05" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/edbbcf33cffa2a85104fc80de8dc052cc51596bb", - "reference": "edbbcf33cffa2a85104fc80de8dc052cc51596bb", + "url": "https://api.github.com/repos/symfony/config/zipball/a2edd59c2163c65747fc3f35d132b5a39266bd05", + "reference": "a2edd59c2163c65747fc3f35d132b5a39266bd05", "shasum": "" }, "require": { @@ -4159,20 +4162,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2016-04-20 18:52:26" + "time": "2016-06-06 11:11:27" }, { "name": "symfony/dependency-injection", - "version": "v2.8.6", + "version": "v2.8.7", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "bd04588c087651ceffdc45d40dc4de05af9c7c52" + "reference": "2d05009d890cf1139988ff059b5b2e0eb280ed13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/bd04588c087651ceffdc45d40dc4de05af9c7c52", - "reference": "bd04588c087651ceffdc45d40dc4de05af9c7c52", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/2d05009d890cf1139988ff059b5b2e0eb280ed13", + "reference": "2d05009d890cf1139988ff059b5b2e0eb280ed13", "shasum": "" }, "require": { @@ -4222,7 +4225,7 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2016-05-09 18:12:35" + "time": "2016-06-06 11:11:27" }, { "name": "symfony/stopwatch", @@ -4275,16 +4278,16 @@ }, { "name": "symfony/yaml", - "version": "v2.8.6", + "version": "v2.8.7", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "e4fbcc65f90909c999ac3b4dfa699ee6563a9940" + "reference": "815fabf3f48c7d1df345a69d1ad1a88f59757b34" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/e4fbcc65f90909c999ac3b4dfa699ee6563a9940", - "reference": "e4fbcc65f90909c999ac3b4dfa699ee6563a9940", + "url": "https://api.github.com/repos/symfony/yaml/zipball/815fabf3f48c7d1df345a69d1ad1a88f59757b34", + "reference": "815fabf3f48c7d1df345a69d1ad1a88f59757b34", "shasum": "" }, "require": { @@ -4320,7 +4323,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2016-03-29 19:00:15" + "time": "2016-06-06 11:11:27" }, { "name": "theseer/fdomdocument", diff --git a/lib/internal/Magento/Framework/composer.json b/lib/internal/Magento/Framework/composer.json index 84b3ecaa81b1e..b3d9eadf0f1d7 100644 --- a/lib/internal/Magento/Framework/composer.json +++ b/lib/internal/Magento/Framework/composer.json @@ -2,7 +2,7 @@ "name": "magento/framework", "description": "N/A", "type": "magento2-library", - "version": "100.1.0-rc1", + "version": "100.1.0-rc2", "license": [ "OSL-3.0", "AFL-3.0" From 57aada3da0c10c77146acfc7b10bd4042076bba6 Mon Sep 17 00:00:00 2001 From: brywaters Date: Tue, 7 Jun 2016 14:24:28 -0500 Subject: [PATCH 232/345] MAGETWO-52923: Switching to Varnish causes category menu to force HTTPS links - clean up unit test --- .../Framework/App/Test/Unit/Request/HttpTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php index 8bdf3d56fb244..fa28bc4e88b98 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php @@ -79,8 +79,8 @@ public function tearDown() */ private function getModel($uri = null, $mockAppConfig = true) { - $testFrameworkObjectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager ($this); - $model = $testFrameworkObjectManager->getObject( + + $model = $this->objectManager->getObject( 'Magento\Framework\App\Request\Http', [ 'routeConfig' => $this->_routerListMock, @@ -93,7 +93,7 @@ private function getModel($uri = null, $mockAppConfig = true) if($mockAppConfig){ $MockAppConfig = $this->getMock(\Magento\Framework\App\Config::class, [], [], '' , false); - $testFrameworkObjectManager->setBackwardCompatibleProperty($model, 'appConfig', $MockAppConfig ); + $this->objectManager->setBackwardCompatibleProperty($model, 'appConfig', $MockAppConfig ); } return $model; @@ -346,9 +346,9 @@ public function testIsSecure($isSecure, $serverHttps, $headerOffloadKey, $header ->method('getValue') ->with(\Magento\Framework\App\Request\Http::XML_PATH_OFFLOADER_HEADER, ScopeConfigInterface::SCOPE_TYPE_DEFAULT) ->willReturn($configOffloadHeader); - $testFrameworkObjectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager ($this); - $testFrameworkObjectManager->setBackwardCompatibleProperty($this->_model,"appConfig" ,$configMock); - $testFrameworkObjectManager->setBackwardCompatibleProperty($this->_model,"SSLOffloadHeader" ,null ); + + $this->objectManager->setBackwardCompatibleProperty($this->_model,'appConfig' ,$configMock); + $this->objectManager->setBackwardCompatibleProperty($this->_model, 'SSLOffloadHeader' ,null ); $this->_model->getServer()->set($headerOffloadKey, $headerOffloadValue); $this->_model->getServer()->set('HTTPS', $serverHttps); From 9cd9de363941b17486df1dbf58b25abeca2b3d99 Mon Sep 17 00:00:00 2001 From: Dale Sikkema Date: Tue, 7 Jun 2016 14:26:31 -0500 Subject: [PATCH 233/345] MAGETWO-52867: [APPSEC-1446] Sensitive server information disclosure upon specific URL requests --- lib/internal/Magento/Framework/App/Bootstrap.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/App/Bootstrap.php b/lib/internal/Magento/Framework/App/Bootstrap.php index 2f93054b9f7ce..2420e5ac72362 100644 --- a/lib/internal/Magento/Framework/App/Bootstrap.php +++ b/lib/internal/Magento/Framework/App/Bootstrap.php @@ -409,7 +409,8 @@ public function isDeveloperMode() $mode = $this->server[State::PARAM_MODE]; } else { $deploymentConfig = $this->getObjectManager()->get(DeploymentConfig::class); - if (($configMode = $deploymentConfig->get(State::PARAM_MODE)) !== null) { + $configMode = $deploymentConfig->get(State::PARAM_MODE); + if ($configMode) { $mode = $configMode; } } From c0db1c2656adaa9a7fa26357084128a0668c0c8c Mon Sep 17 00:00:00 2001 From: brywaters Date: Tue, 7 Jun 2016 14:51:29 -0500 Subject: [PATCH 234/345] MAGETWO-52923: Switching to Varnish causes category menu to force HTTPS links - add getHttpHost to mock in unit test --- .../Magento/Framework/App/Test/Unit/Config/ScopePoolTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Config/ScopePoolTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Config/ScopePoolTest.php index b6bf2e580d9c1..ef95d05dd9c9d 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Config/ScopePoolTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Config/ScopePoolTest.php @@ -68,7 +68,8 @@ protected function setUp() 'setParams', 'getCookie', 'isSecure', - 'getServer' + 'getServer', + 'getHttpHost' ] )->getMock(); $reflection = new \ReflectionClass(get_class($this->_object)); From 4e526e2c6c532c19074236ef47cfc2b77ea054f1 Mon Sep 17 00:00:00 2001 From: brywaters Date: Tue, 7 Jun 2016 15:06:03 -0500 Subject: [PATCH 235/345] MAGETWO-52923: Switching to Varnish causes category menu to force HTTPS links - Syntax and whitespace --- .../Magento/Framework/App/Config/ScopePool.php | 2 +- .../Framework/App/Test/Unit/Request/HttpTest.php | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/internal/Magento/Framework/App/Config/ScopePool.php b/lib/internal/Magento/Framework/App/Config/ScopePool.php index e33e6817d37cc..d366349722f0f 100644 --- a/lib/internal/Magento/Framework/App/Config/ScopePool.php +++ b/lib/internal/Magento/Framework/App/Config/ScopePool.php @@ -92,7 +92,7 @@ public function getScope($scopeType, $scopeCode = null) { $scopeCode = $this->_getScopeCode($scopeType, $scopeCode); - //Key by url to support dynamic {{base_url}} and port assignments + // Key by url to support dynamic {{base_url}} and port assignments $host = $this->getRequest()->getHttpHost(); $port = $this->getRequest()->getServer('SERVER_PORT'); $path = $this->getRequest()->getBasePath(); diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php index fa28bc4e88b98..be63dff864f0b 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php @@ -91,9 +91,9 @@ private function getModel($uri = null, $mockAppConfig = true) ] ); - if($mockAppConfig){ - $MockAppConfig = $this->getMock(\Magento\Framework\App\Config::class, [], [], '' , false); - $this->objectManager->setBackwardCompatibleProperty($model, 'appConfig', $MockAppConfig ); + if ($mockAppConfig) { + $mockConfig = $this->getMock(\Magento\Framework\App\Config::class, [], [], '' , false); + $this->objectManager->setBackwardCompatibleProperty($model, 'appConfig', $mockConfig ); } return $model; @@ -347,8 +347,8 @@ public function testIsSecure($isSecure, $serverHttps, $headerOffloadKey, $header ->with(\Magento\Framework\App\Request\Http::XML_PATH_OFFLOADER_HEADER, ScopeConfigInterface::SCOPE_TYPE_DEFAULT) ->willReturn($configOffloadHeader); - $this->objectManager->setBackwardCompatibleProperty($this->_model,'appConfig' ,$configMock); - $this->objectManager->setBackwardCompatibleProperty($this->_model, 'SSLOffloadHeader' ,null ); + $this->objectManager->setBackwardCompatibleProperty($this->_model, 'appConfig', $configMock); + $this->objectManager->setBackwardCompatibleProperty($this->_model, 'SSLOffloadHeader', null ); $this->_model->getServer()->set($headerOffloadKey, $headerOffloadValue); $this->_model->getServer()->set('HTTPS', $serverHttps); From bf8e73782118b3508c2a1ebba833ce645edf55c7 Mon Sep 17 00:00:00 2001 From: Cari Spruiell Date: Tue, 7 Jun 2016 15:06:16 -0500 Subject: [PATCH 236/345] MAGETWO-52993: [Github] Media Uploader Issues #2958 - clear error message every time a new file is chosen for upload. --- .../Cms/view/adminhtml/templates/browser/content/uploader.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Cms/view/adminhtml/templates/browser/content/uploader.phtml b/app/code/Magento/Cms/view/adminhtml/templates/browser/content/uploader.phtml index 120dc057b30e9..24482f1fb4209 100644 --- a/app/code/Magento/Cms/view/adminhtml/templates/browser/content/uploader.phtml +++ b/app/code/Magento/Cms/view/adminhtml/templates/browser/content/uploader.phtml @@ -71,8 +71,8 @@ require([ var progressSelector = '#' + data.fileId + ' .progressbar-container .progressbar'; var tempErrorMessage = document.createElement("div"); $(progressSelector).css('width', '100%'); + $('[data-action="show-error"]').children(".message").remove(); if (data.result && !data.result.hasOwnProperty('errorcode')) { - $('[data-action="show-error"]').children(".message").remove(); $(progressSelector).removeClass('upload-progress').addClass('upload-success'); } else { tempErrorMessage.className = "message message-warning warning"; From 8d103567942d00cf6a832ee09e817a47a49f97e9 Mon Sep 17 00:00:00 2001 From: "Partica, Cristian" Date: Tue, 7 Jun 2016 15:13:24 -0500 Subject: [PATCH 237/345] MAGETWO-53366: Tax Report does not display any records - adding extension attribute instead of modifying data interface on api - fixing tests --- .../OrderTaxDetailsAppliedTaxInterface.php | 13 -- .../Magento/Tax/Model/Plugin/OrderSave.php | 11 +- .../Tax/Model/Quote/ToOrderConverter.php | 9 +- .../Test/Unit/Model/Plugin/OrderSaveTest.php | 174 +++++++++++------- .../Unit/Model/Quote/ToOrderConverterTest.php | 63 ++++++- .../Magento/Tax/etc/extension_attributes.xml | 3 + 6 files changed, 183 insertions(+), 90 deletions(-) diff --git a/app/code/Magento/Tax/Api/Data/OrderTaxDetailsAppliedTaxInterface.php b/app/code/Magento/Tax/Api/Data/OrderTaxDetailsAppliedTaxInterface.php index d98360e2cb38c..bd1b9c464b285 100644 --- a/app/code/Magento/Tax/Api/Data/OrderTaxDetailsAppliedTaxInterface.php +++ b/app/code/Magento/Tax/Api/Data/OrderTaxDetailsAppliedTaxInterface.php @@ -88,19 +88,6 @@ public function getBaseAmount(); */ public function setBaseAmount($baseAmount); - /** - * - * @return \Magento\Tax\Api\Data\AppliedTaxRateInterface[] - */ - public function getRates(); - - /** - * - * @param \Magento\Tax\Api\Data\AppliedTaxRateInterface[] $rates - * @return $this - */ - public function setRates($rates); - /** * Retrieve existing extension attributes object or create a new one. * diff --git a/app/code/Magento/Tax/Model/Plugin/OrderSave.php b/app/code/Magento/Tax/Model/Plugin/OrderSave.php index 4cb243433895a..679d660437d4d 100644 --- a/app/code/Magento/Tax/Model/Plugin/OrderSave.php +++ b/app/code/Magento/Tax/Model/Plugin/OrderSave.php @@ -78,11 +78,13 @@ protected function saveOrderTax(\Magento\Sales\Api\Data\OrderInterface $order) $ratesIdQuoteItemId = []; foreach ($taxesForItems as $taxesArray) { foreach ($taxesArray['applied_taxes'] as $rates) { - if (count($rates['rates']) == 1) { + /** @var \Magento\Tax\Api\Data\AppliedTaxRateInterface $rates */ + $taxRates = $rates['extension_attributes']->getRates(); + if (count($taxRates) == 1) { $ratesIdQuoteItemId[$rates['id']][] = [ 'id' => $taxesArray['item_id'], 'percent' => $rates['percent'], - 'code' => $rates['rates'][0]['code'], + 'code' => $taxRates[0]['code'], 'associated_item_id' => $taxesArray['associated_item_id'], 'item_type' => $taxesArray['type'], 'amount' => $rates['amount'], @@ -92,7 +94,7 @@ protected function saveOrderTax(\Magento\Sales\Api\Data\OrderInterface $order) ]; } else { $percentSum = 0; - foreach ($rates['rates'] as $rate) { + foreach ($taxRates as $rate) { $realAmount = $rates['amount'] * $rate['percent'] / $rates['percent']; $realBaseAmount = $rates['base_amount'] * $rate['percent'] / $rates['percent']; $ratesIdQuoteItemId[$rates['id']][] = [ @@ -114,7 +116,8 @@ protected function saveOrderTax(\Magento\Sales\Api\Data\OrderInterface $order) foreach ($taxes as $row) { $id = $row['id']; - foreach ($row['rates'] as $tax) { + $taxRates = $row['extension_attributes']->getRates(); + foreach ($taxRates as $tax) { if ($row['percent'] == null) { $baseRealAmount = $row['base_amount']; } else { diff --git a/app/code/Magento/Tax/Model/Quote/ToOrderConverter.php b/app/code/Magento/Tax/Model/Quote/ToOrderConverter.php index 2a16fabf5a653..858838b84c89d 100644 --- a/app/code/Magento/Tax/Model/Quote/ToOrderConverter.php +++ b/app/code/Magento/Tax/Model/Quote/ToOrderConverter.php @@ -58,6 +58,11 @@ public function afterConvert(QuoteAddressToOrder $subject, OrderInterface $order $extensionAttributes = $this->orderExtensionFactory->create(); } if (!empty($taxes)) { + foreach ($taxes as $key => $tax) { + $tax['extension_attributes']['rates'] = $tax['rates']; + unset($tax['rates']); + $taxes[$key] = $tax; + } $extensionAttributes->setAppliedTaxes($taxes); $extensionAttributes->setConvertingFromQuote(true); } @@ -71,10 +76,10 @@ public function afterConvert(QuoteAddressToOrder $subject, OrderInterface $order $itemAppliedTaxesModified[$key]['type'] = $itemAppliedTax['item_type']; $itemAppliedTaxesModified[$key]['item_id'] = $itemAppliedTax['item_id']; $itemAppliedTaxesModified[$key]['associated_item_id'] = $itemAppliedTax['associated_item_id']; + $itemAppliedTax['extension_attributes']['rates'] = $itemAppliedTax['rates']; + unset($itemAppliedTax['rates']); $itemAppliedTaxesModified[$key]['applied_taxes'][] = $itemAppliedTax; } - } elseif (is_array($itemAppliedTaxItem) && empty($itemAppliedTaxItem)) { - $itemAppliedTaxesModified[$key] = []; } } $extensionAttributes->setItemAppliedTaxes($itemAppliedTaxesModified); diff --git a/app/code/Magento/Tax/Test/Unit/Model/Plugin/OrderSaveTest.php b/app/code/Magento/Tax/Test/Unit/Model/Plugin/OrderSaveTest.php index 87878ef040851..d1332e6ec9381 100644 --- a/app/code/Magento/Tax/Test/Unit/Model/Plugin/OrderSaveTest.php +++ b/app/code/Magento/Tax/Test/Unit/Model/Plugin/OrderSaveTest.php @@ -214,6 +214,101 @@ public function testAfterSave( */ public function afterSaveDataProvider() { + $orderTaxDetailsApplied = $this->getMockBuilder('\Magento\Tax\Api\Data\OrderTaxDetailsAppliedTaxInterface') + ->disableOriginalConstructor() + ->setMethods(['getRates']) + ->getMockForAbstractClass(); + + $orderTaxDetailsApplied->expects($this->at(0)) + ->method('getRates') + ->willReturn( + [ + [ + 'percent' => 6, + 'code' => 'IL', + 'title' => 'IL', + ], + [ + 'percent' => 5, + 'code' => 'US', + 'title' => 'US', + ] + ] + ); + + $orderTaxDetailsApplied->expects($this->at(1)) + ->method('getRates') + ->willReturn( + [ + [ + 'percent' => 3, + 'code' => 'CityTax', + 'title' => 'CityTax', + ], + ] + ); + + + $orderTaxDetailsApplied->expects($this->at(2)) + ->method('getRates') + ->willReturn( + [ + [ + 'percent' => 6, + 'code' => 'IL', + 'title' => 'IL', + ], + [ + 'percent' => 5, + 'code' => 'US', + 'title' => 'US', + ], + ] + ); + + $orderTaxDetailsApplied->expects($this->at(3)) + ->method('getRates') + ->willReturn( + [ + [ + 'percent' => 3, + 'code' => 'CityTax', + 'title' => 'CityTax', + ], + ] + ); + + $orderTaxDetailsApplied->expects($this->at(4)) + ->method('getRates') + ->willReturn( + [ + [ + 'percent' => 6, + 'code' => 'IL', + 'title' => 'IL', + ], + [ + 'percent' => 5, + 'code' => 'US', + 'title' => 'US', + ], + ] + ); + + + + $orderTaxDetailsApplied->expects($this->at(5)) + ->method('getRates') + ->willReturn( + [ + [ + 'percent' => 3, + 'code' => 'CityTax', + 'title' => 'CityTax', + ], + ] + ); + return [ //one item with shipping //three tax rates: state and national tax rates of 6 and 5 percent with priority 0 @@ -225,31 +320,14 @@ public function afterSaveDataProvider() 'base_amount' => 0.66, 'percent' => 11, 'id' => 'ILUS', - 'rates' => [ - [ - 'percent' => 6, - 'code' => 'IL', - 'title' => 'IL', - ], - [ - 'percent' => 5, - 'code' => 'US', - 'title' => 'US', - ], - ], + 'extension_attributes' => $orderTaxDetailsApplied, ], [ 'amount' => 0.2, 'base_amount' => 0.2, 'percent' => 3.33, 'id' => 'CityTax', - 'rates' => [ - [ - 'percent' => 3, - 'code' => 'CityTax', - 'title' => 'CityTax', - ], - ], + 'extension_attributes' => $orderTaxDetailsApplied, ], ], 'item_applied_taxes' => [ @@ -261,22 +339,11 @@ public function afterSaveDataProvider() 'associated_item_id' => null, 'applied_taxes' => [ [ - 'amount' => 0.11, - 'base_amount' => 0.11, - 'percent' => 11, - 'id' => 'ILUS', - 'rates' => [ - [ - 'percent' => 6, - 'code' => 'IL', - 'title' => 'IL', - ], - [ - 'percent' => 5, - 'code' => 'US', - 'title' => 'US', - ], - ], + 'amount' => 0.11, + 'base_amount' => 0.11, + 'percent' => 11, + 'id' => 'ILUS', + 'extension_attributes' => $orderTaxDetailsApplied, ], //city tax [ @@ -284,13 +351,7 @@ public function afterSaveDataProvider() 'base_amount' => 0.03, 'percent' => 3.33, 'id' => 'CityTax', - 'rates' => [ - [ - 'percent' => 3, - 'code' => 'CityTax', - 'title' => 'CityTax', - ], - ] + 'extension_attributes' => $orderTaxDetailsApplied, ], ], ], @@ -302,22 +363,11 @@ public function afterSaveDataProvider() 'associated_item_id' => null, 'applied_taxes' => [ [ - 'amount' => 0.55, - 'base_amount' => 0.55, - 'percent' => 11, - 'id' => 'ILUS', - 'rates' => [ - [ - 'percent' => 6, - 'code' => 'IL', - 'title' => 'IL', - ], - [ - 'percent' => 5, - 'code' => 'US', - 'title' => 'US', - ], - ], + 'amount' => 0.55, + 'base_amount' => 0.55, + 'percent' => 11, + 'id' => 'ILUS', + 'extension_attributes' => $orderTaxDetailsApplied, ], //city tax [ @@ -325,13 +375,7 @@ public function afterSaveDataProvider() 'base_amount' => 0.17, 'percent' => 3.33, 'id' => 'CityTax', - 'rates' => [ - [ - 'percent' => 3, - 'code' => 'CityTax', - 'title' => 'CityTax', - ], - ], + 'extension_attributes' => $orderTaxDetailsApplied, ], ], ], diff --git a/app/code/Magento/Tax/Test/Unit/Model/Quote/ToOrderConverterTest.php b/app/code/Magento/Tax/Test/Unit/Model/Quote/ToOrderConverterTest.php index 327c5cfdd903b..f1ad9dc90a8a2 100644 --- a/app/code/Magento/Tax/Test/Unit/Model/Quote/ToOrderConverterTest.php +++ b/app/code/Magento/Tax/Test/Unit/Model/Quote/ToOrderConverterTest.php @@ -76,12 +76,14 @@ protected function setupOrderExtensionAttributeMock() /** * @param array $appliedTaxes + * @param array $expectedAppliedTaxes * @param array $itemsAppliedTaxes * @param array $itemAppliedTaxesExpected * @dataProvider afterConvertDataProvider */ public function testAfterConvert( $appliedTaxes, + $expectedAppliedTaxes, $itemsAppliedTaxes, $itemAppliedTaxesExpected ) { @@ -106,7 +108,7 @@ public function testAfterConvert( $orderExtensionAttributeMock->expects($this->once()) ->method('setAppliedTaxes') - ->with($appliedTaxes); + ->with($expectedAppliedTaxes); $orderExtensionAttributeMock->expects($this->once()) ->method('setConvertingFromQuote') ->with(true); @@ -122,12 +124,14 @@ public function testAfterConvert( /** * @param array $appliedTaxes + * @param array $expectedAppliedTaxes * @param array $itemsAppliedTaxes * @param array $itemAppliedTaxesExpected * @dataProvider afterConvertDataProvider */ public function testAfterConvertNullExtensionAttribute( $appliedTaxes, + $expectedAppliedTaxes, $itemsAppliedTaxes, $itemAppliedTaxesExpected ) { @@ -156,7 +160,7 @@ public function testAfterConvertNullExtensionAttribute( $orderExtensionAttributeMock->expects($this->once()) ->method('setAppliedTaxes') - ->with($appliedTaxes); + ->with($expectedAppliedTaxes); $orderExtensionAttributeMock->expects($this->once()) ->method('setConvertingFromQuote') ->with(true); @@ -189,8 +193,23 @@ public function afterConvertDataProvider() 'code' => 'IL', 'title' => 'IL', ] - ] - ] + ], + ], + ], + 'expected_applied_taxes' => [ + 'IL' => [ + 'amount' => 0.36, + 'percent' => 6, + 'extension_attributes' => [ + 'rates' => [ + [ + 'percent' => 6, + 'code' => 'IL', + 'title' => 'IL', + ] + ], + ], + ], ], 'item_applied_taxes' => [ 'sequence-1' => [ @@ -198,7 +217,14 @@ public function afterConvertDataProvider() 'amount' => 0.06, 'item_id' => 146, 'item_type' => 'product', - 'associated_item_id' => null + 'associated_item_id' => null, + 'rates' => [ + [ + 'percent' => 6, + 'code' => 'IL', + 'title' => 'IL', + ], + ], ], ], 'shipping' => [ @@ -206,7 +232,14 @@ public function afterConvertDataProvider() 'amount' => 0.30, 'item_id' => 146, 'item_type' => 'shipping', - 'associated_item_id' => null + 'associated_item_id' => null, + 'rates' => [ + [ + 'percent' => 6, + 'code' => 'IL', + 'title' => 'IL', + ], + ], ] ], ], @@ -221,6 +254,15 @@ public function afterConvertDataProvider() 'item_id' => 146, 'item_type' => 'product', 'associated_item_id' => null, + 'extension_attributes' => [ + 'rates' => [ + [ + 'percent' => 6, + 'code' => 'IL', + 'title' => 'IL', + ] + ], + ], ] ], @@ -235,6 +277,15 @@ public function afterConvertDataProvider() 'item_id' => 146, 'item_type' => 'shipping', 'associated_item_id' => null, + 'extension_attributes' => [ + 'rates' => [ + [ + 'percent' => 6, + 'code' => 'IL', + 'title' => 'IL', + ] + ], + ], ] ], ], diff --git a/app/code/Magento/Tax/etc/extension_attributes.xml b/app/code/Magento/Tax/etc/extension_attributes.xml index 48b897095f5a5..488da4b2efc48 100644 --- a/app/code/Magento/Tax/etc/extension_attributes.xml +++ b/app/code/Magento/Tax/etc/extension_attributes.xml @@ -14,4 +14,7 @@ + + + From d26a7b62becf1aa12e64329a435b1a556a03872d Mon Sep 17 00:00:00 2001 From: brywaters Date: Tue, 7 Jun 2016 15:40:57 -0500 Subject: [PATCH 238/345] MAGETWO-52923: Switching to Varnish causes category menu to force HTTPS links - Revert unit test to using real object manager --- .../Framework/App/Test/Unit/Request/HttpTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php index be63dff864f0b..b14f2424183a7 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php @@ -79,8 +79,8 @@ public function tearDown() */ private function getModel($uri = null, $mockAppConfig = true) { - - $model = $this->objectManager->getObject( + $testFrameworkObjectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager ($this); + $model = $testFrameworkObjectManager->getObject( 'Magento\Framework\App\Request\Http', [ 'routeConfig' => $this->_routerListMock, @@ -93,7 +93,7 @@ private function getModel($uri = null, $mockAppConfig = true) if ($mockAppConfig) { $mockConfig = $this->getMock(\Magento\Framework\App\Config::class, [], [], '' , false); - $this->objectManager->setBackwardCompatibleProperty($model, 'appConfig', $mockConfig ); + $testFrameworkObjectManager->setBackwardCompatibleProperty($model, 'appConfig', $mockConfig ); } return $model; @@ -346,9 +346,9 @@ public function testIsSecure($isSecure, $serverHttps, $headerOffloadKey, $header ->method('getValue') ->with(\Magento\Framework\App\Request\Http::XML_PATH_OFFLOADER_HEADER, ScopeConfigInterface::SCOPE_TYPE_DEFAULT) ->willReturn($configOffloadHeader); - - $this->objectManager->setBackwardCompatibleProperty($this->_model, 'appConfig', $configMock); - $this->objectManager->setBackwardCompatibleProperty($this->_model, 'SSLOffloadHeader', null ); + $testFrameworkObjectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager ($this); + $testFrameworkObjectManager->setBackwardCompatibleProperty($this->_model, 'appConfig', $configMock); + $testFrameworkObjectManager->setBackwardCompatibleProperty($this->_model, 'SSLOffloadHeader', null ); $this->_model->getServer()->set($headerOffloadKey, $headerOffloadValue); $this->_model->getServer()->set('HTTPS', $serverHttps); From 18c719e118ce4eb5c003142c5ead636368c60f46 Mon Sep 17 00:00:00 2001 From: Igor Melnikov Date: Tue, 7 Jun 2016 15:45:14 -0500 Subject: [PATCH 239/345] MAGETWO-52923: MAGETWO-52923: [Github] Switching to Varnish causes category menu to force HTTPS links #4540 Unit tests, code style --- .../Observer/ProcessLayoutRenderElement.php | 4 +-- .../App/Test/Unit/Request/HttpTest.php | 27 ++++++++++++------- .../Framework/HTTP/PhpEnvironment/Request.php | 22 +++++++-------- 3 files changed, 28 insertions(+), 25 deletions(-) diff --git a/app/code/Magento/PageCache/Observer/ProcessLayoutRenderElement.php b/app/code/Magento/PageCache/Observer/ProcessLayoutRenderElement.php index ab066a9e28b82..aa96c1060207e 100644 --- a/app/code/Magento/PageCache/Observer/ProcessLayoutRenderElement.php +++ b/app/code/Magento/PageCache/Observer/ProcessLayoutRenderElement.php @@ -59,8 +59,8 @@ protected function _wrapEsi( 'handles' => json_encode($layout->getUpdate()->getHandles()) ] ); - // Varnish does not support esi over https must change to http - $url = (substr($url, 0, 5) === 'https') ? 'http' . substr($url, 5) : $url; + // Varnish does not support ESI over HTTPS must change to HTTP + $url = substr($url, 0, 5) === 'https' ? 'http' . substr($url, 5) : $url; return sprintf('', $url); } diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php index be63dff864f0b..fcb2046a14d65 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php @@ -32,15 +32,20 @@ class HttpTest extends \PHPUnit_Framework_TestCase protected $_infoProcessorMock; /** - * @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager | \PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager | \PHPUnit_Framework_MockObject_MockObject */ - protected $objectManager; + protected $objectManagerMock; /** - * @var \Magento\Framework\Stdlib\StringUtils | \PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\Stdlib\StringUtils | \PHPUnit_Framework_MockObject_MockObject */ protected $converterMock; + /** + * @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager + */ + private $objectManager; + /** * @var array */ @@ -58,7 +63,7 @@ protected function setUp() ); $this->_infoProcessorMock = $this->getMock('Magento\Framework\App\Request\PathInfoProcessorInterface'); $this->_infoProcessorMock->expects($this->any())->method('process')->will($this->returnArgument(1)); - $this->objectManager = $this->getMock('Magento\Framework\ObjectManagerInterface'); + $this->objectManagerMock = $this->getMock('Magento\Framework\ObjectManagerInterface'); $this->converterMock = $this->getMockBuilder('Magento\Framework\Stdlib\StringUtils') ->disableOriginalConstructor() ->setMethods(['cleanString']) @@ -67,6 +72,8 @@ protected function setUp() // Stash the $_SERVER array to protect it from modification in test $this->serverArray = $_SERVER; + + $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); } public function tearDown() @@ -77,7 +84,7 @@ public function tearDown() /** * @return \Magento\Framework\App\Request\Http */ - private function getModel($uri = null, $mockAppConfig = true) + private function getModel($uri = null, $appConfigMock = true) { $model = $this->objectManager->getObject( @@ -85,15 +92,15 @@ private function getModel($uri = null, $mockAppConfig = true) [ 'routeConfig' => $this->_routerListMock, 'pathInfoProcessor' => $this->_infoProcessorMock, - 'objectManager' => $this->objectManager, + 'objectManager' => $this->objectManagerMock, 'converter' => $this->converterMock, 'uri' => $uri, ] ); - if ($mockAppConfig) { - $mockConfig = $this->getMock(\Magento\Framework\App\Config::class, [], [], '' , false); - $this->objectManager->setBackwardCompatibleProperty($model, 'appConfig', $mockConfig ); + if ($appConfigMock) { + $configMock = $this->getMock(\Magento\Framework\App\Config::class, [], [], '' , false); + $this->objectManager->setBackwardCompatibleProperty($model, 'appConfig', $configMock); } return $model; @@ -348,7 +355,7 @@ public function testIsSecure($isSecure, $serverHttps, $headerOffloadKey, $header ->willReturn($configOffloadHeader); $this->objectManager->setBackwardCompatibleProperty($this->_model, 'appConfig', $configMock); - $this->objectManager->setBackwardCompatibleProperty($this->_model, 'SSLOffloadHeader', null ); + $this->objectManager->setBackwardCompatibleProperty($this->_model, 'sslOffloadHeader', null); $this->_model->getServer()->set($headerOffloadKey, $headerOffloadValue); $this->_model->getServer()->set('HTTPS', $serverHttps); diff --git a/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php b/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php index 08f853595d56f..64f8dd4564e65 100644 --- a/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php +++ b/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php @@ -98,7 +98,7 @@ class Request extends \Zend\Http\PhpEnvironment\Request * * @var string */ - protected $SSLOffloadHeader; + protected $sslOffloadHeader; /** * @param CookieReaderInterface $cookieReader @@ -415,25 +415,23 @@ public function isSecure() return true; } - return $this->initialRequestSecure($this->getSSLOffloadHeader()); + return $this->initialRequestSecure($this->SslOffloadHeader()); } /*** - * - * Get value of SSL offload http header from configuration -- defaults to X-Forwarded-Proto + * Get value of SSL offload http header from configuration - defaults to X-Forwarded-Proto * * @return string */ - private function getSSLOffloadHeader() + private function SslOffloadHeader() { - // Lets read from db only one time okay. - if ($this->SSLOffloadHeader === null) { + if ($this->sslOffloadHeader === null) { - /* TODO: Untangle Config dependence on Scope, so that this class can be instantiated even if app is not - installed MAGETWO-31756 */ + // @todo: Untangle Config dependence on Scope, so that this class can be instantiated even if app is not + // installed MAGETWO-31756 // Check if a proxy sent a header indicating an initial secure request - $this->SSLOffloadHeader = trim( + $this->sslOffloadHeader = trim( (string)$this->getAppConfig()->getValue( self::XML_PATH_OFFLOADER_HEADER, \Magento\Framework\App\Config\ScopeConfigInterface::SCOPE_TYPE_DEFAULT @@ -441,15 +439,13 @@ private function getSSLOffloadHeader() ); } - return $this->SSLOffloadHeader; - + return $this->sslOffloadHeader; } /** * Create an instance of Magento\Framework\App\Config * * @return \Magento\Framework\App\Config - * * @deprecated */ private function getAppConfig() From 1ef56d8be3ec975ec0ad13156d764851d03b61df Mon Sep 17 00:00:00 2001 From: Alexander Paliarush Date: Tue, 7 Jun 2016 10:58:02 -0500 Subject: [PATCH 240/345] MAGETWO-53947: Automated Tests GAP - Setup Application --- .../app/Magento/Upgrade/Test/Block/SelectVersion.php | 11 +++++++++++ .../Upgrade/Test/TestCase/UpgradeSystemTest.php | 3 +++ .../Upgrade/Test/TestCase/UpgradeSystemTest.xml | 1 + 3 files changed, 15 insertions(+) diff --git a/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/SelectVersion.php b/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/SelectVersion.php index 7699547ce126c..d1979716e1f2c 100644 --- a/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/SelectVersion.php +++ b/dev/tests/functional/tests/app/Magento/Upgrade/Test/Block/SelectVersion.php @@ -52,4 +52,15 @@ public function fill(FixtureInterface $fixture, SimpleElement $element = null) $this->waitForElementVisible($this->firstField); return parent::fill($fixture, $element); } + + /** + * Choose 'yes' for upgrade option called 'Other components' + * + * @return void + */ + public function chooseUpgradeOtherComponents() + { + $this->_rootElement->find("[for=yesUpdateComponents]", Locator::SELECTOR_CSS)->click(); + $this->waitForElementVisible("[ng-show='componentsProcessed']"); + } } diff --git a/dev/tests/functional/tests/app/Magento/Upgrade/Test/TestCase/UpgradeSystemTest.php b/dev/tests/functional/tests/app/Magento/Upgrade/Test/TestCase/UpgradeSystemTest.php index 50afbd48e4151..2aab8f47724ff 100644 --- a/dev/tests/functional/tests/app/Magento/Upgrade/Test/TestCase/UpgradeSystemTest.php +++ b/dev/tests/functional/tests/app/Magento/Upgrade/Test/TestCase/UpgradeSystemTest.php @@ -94,6 +94,9 @@ public function test( // Select upgrade to version $this->setupWizard->getSystemUpgradeHome()->clickSystemUpgrade(); $this->setupWizard->getSelectVersion()->fill($upgradeFixture); + if ($upgrade['otherComponents'] === 'Yes') { + $this->setupWizard->getSelectVersion()->chooseUpgradeOtherComponents(); + } $this->setupWizard->getSelectVersion()->clickNext(); // Readiness Check diff --git a/dev/tests/functional/tests/app/Magento/Upgrade/Test/TestCase/UpgradeSystemTest.xml b/dev/tests/functional/tests/app/Magento/Upgrade/Test/TestCase/UpgradeSystemTest.xml index c05e68c3425a5..3b88f360ec156 100644 --- a/dev/tests/functional/tests/app/Magento/Upgrade/Test/TestCase/UpgradeSystemTest.xml +++ b/dev/tests/functional/tests/app/Magento/Upgrade/Test/TestCase/UpgradeSystemTest.xml @@ -17,6 +17,7 @@ No No No + {otherComponents} From 46d43edc145bb2880bd0156ab770fee08ba6bde1 Mon Sep 17 00:00:00 2001 From: "Partica, Cristian" Date: Tue, 7 Jun 2016 17:30:23 -0500 Subject: [PATCH 241/345] MAGETWO-53366: Tax Report does not display any records - adding indentation and code cleanup based on code review comments --- .../Magento/Tax/Model/Plugin/OrderSave.php | 167 +++++++++--------- .../Test/Unit/Model/Plugin/OrderSaveTest.php | 42 ++--- .../Unit/Model/Quote/ToOrderConverterTest.php | 15 +- 3 files changed, 110 insertions(+), 114 deletions(-) diff --git a/app/code/Magento/Tax/Model/Plugin/OrderSave.php b/app/code/Magento/Tax/Model/Plugin/OrderSave.php index 679d660437d4d..b1edbd48ce607 100644 --- a/app/code/Magento/Tax/Model/Plugin/OrderSave.php +++ b/app/code/Magento/Tax/Model/Plugin/OrderSave.php @@ -78,37 +78,39 @@ protected function saveOrderTax(\Magento\Sales\Api\Data\OrderInterface $order) $ratesIdQuoteItemId = []; foreach ($taxesForItems as $taxesArray) { foreach ($taxesArray['applied_taxes'] as $rates) { - /** @var \Magento\Tax\Api\Data\AppliedTaxRateInterface $rates */ - $taxRates = $rates['extension_attributes']->getRates(); - if (count($taxRates) == 1) { - $ratesIdQuoteItemId[$rates['id']][] = [ - 'id' => $taxesArray['item_id'], - 'percent' => $rates['percent'], - 'code' => $taxRates[0]['code'], - 'associated_item_id' => $taxesArray['associated_item_id'], - 'item_type' => $taxesArray['type'], - 'amount' => $rates['amount'], - 'base_amount' => $rates['base_amount'], - 'real_amount' => $rates['amount'], - 'real_base_amount' => $rates['base_amount'], - ]; - } else { - $percentSum = 0; - foreach ($taxRates as $rate) { - $realAmount = $rates['amount'] * $rate['percent'] / $rates['percent']; - $realBaseAmount = $rates['base_amount'] * $rate['percent'] / $rates['percent']; + if ($rates['extension_attributes']) { + $taxRates = $rates['extension_attributes']->getRates(); + /** @var \Magento\Tax\Api\Data\AppliedTaxRateInterface[] $taxRates */ + if (count($taxRates) == 1) { $ratesIdQuoteItemId[$rates['id']][] = [ 'id' => $taxesArray['item_id'], - 'percent' => $rate['percent'], - 'code' => $rate['code'], + 'percent' => $rates['percent'], + 'code' => $taxRates[0]['code'], 'associated_item_id' => $taxesArray['associated_item_id'], 'item_type' => $taxesArray['type'], 'amount' => $rates['amount'], 'base_amount' => $rates['base_amount'], - 'real_amount' => $realAmount, - 'real_base_amount' => $realBaseAmount, + 'real_amount' => $rates['amount'], + 'real_base_amount' => $rates['base_amount'], ]; - $percentSum += $rate['percent']; + } else { + $percentSum = 0; + foreach ($taxRates as $rate) { + $realAmount = $rates['amount'] * $rate['percent'] / $rates['percent']; + $realBaseAmount = $rates['base_amount'] * $rate['percent'] / $rates['percent']; + $ratesIdQuoteItemId[$rates['id']][] = [ + 'id' => $taxesArray['item_id'], + 'percent' => $rate['percent'], + 'code' => $rate['code'], + 'associated_item_id' => $taxesArray['associated_item_id'], + 'item_type' => $taxesArray['type'], + 'amount' => $rates['amount'], + 'base_amount' => $rates['base_amount'], + 'real_amount' => $realAmount, + 'real_base_amount' => $realBaseAmount, + ]; + $percentSum += $rate['percent']; + } } } } @@ -116,67 +118,70 @@ protected function saveOrderTax(\Magento\Sales\Api\Data\OrderInterface $order) foreach ($taxes as $row) { $id = $row['id']; - $taxRates = $row['extension_attributes']->getRates(); - foreach ($taxRates as $tax) { - if ($row['percent'] == null) { - $baseRealAmount = $row['base_amount']; - } else { - if ($row['percent'] == 0 || $tax['percent'] == 0) { - continue; + if ($row['extension_attributes']) { + /** @var \Magento\Tax\Api\Data\AppliedTaxRateInterface[] $taxRates */ + $taxRates = $row['extension_attributes']->getRates(); + foreach ($taxRates as $tax) { + if ($row['percent'] == null) { + $baseRealAmount = $row['base_amount']; + } else { + if ($row['percent'] == 0 || $tax['percent'] == 0) { + continue; + } + $baseRealAmount = $row['base_amount'] / $row['percent'] * $tax['percent']; } - $baseRealAmount = $row['base_amount'] / $row['percent'] * $tax['percent']; - } - $hidden = isset($row['hidden']) ? $row['hidden'] : 0; - $priority = isset($tax['priority']) ? $tax['priority'] : 0; - $position = isset($tax['position']) ? $tax['position'] : 0; - $process = isset($row['process']) ? $row['process'] : 0; - $data = [ - 'order_id' => $order->getEntityId(), - 'code' => $tax['code'], - 'title' => $tax['title'], - 'hidden' => $hidden, - 'percent' => $tax['percent'], - 'priority' => $priority, - 'position' => $position, - 'amount' => $row['amount'], - 'base_amount' => $row['base_amount'], - 'process' => $process, - 'base_real_amount' => $baseRealAmount, - ]; + $hidden = isset($row['hidden']) ? $row['hidden'] : 0; + $priority = isset($tax['priority']) ? $tax['priority'] : 0; + $position = isset($tax['position']) ? $tax['position'] : 0; + $process = isset($row['process']) ? $row['process'] : 0; + $data = [ + 'order_id' => $order->getEntityId(), + 'code' => $tax['code'], + 'title' => $tax['title'], + 'hidden' => $hidden, + 'percent' => $tax['percent'], + 'priority' => $priority, + 'position' => $position, + 'amount' => $row['amount'], + 'base_amount' => $row['base_amount'], + 'process' => $process, + 'base_real_amount' => $baseRealAmount, + ]; - /** @var $orderTax \Magento\Tax\Model\Sales\Order\Tax */ - $orderTax = $this->orderTaxFactory->create(); - $result = $orderTax->setData($data)->save(); + /** @var $orderTax \Magento\Tax\Model\Sales\Order\Tax */ + $orderTax = $this->orderTaxFactory->create(); + $result = $orderTax->setData($data)->save(); - if (isset($ratesIdQuoteItemId[$id])) { - foreach ($ratesIdQuoteItemId[$id] as $quoteItemId) { - if ($quoteItemId['code'] == $tax['code']) { - $itemId = null; - $associatedItemId = null; - if (isset($quoteItemId['id'])) { - //This is a product item - $item = $order->getItemByQuoteItemId($quoteItemId['id']); - $itemId = $item->getId(); - } elseif (isset($quoteItemId['associated_item_id'])) { - //This item is associated with a product item - $item = $order->getItemByQuoteItemId($quoteItemId['associated_item_id']); - $associatedItemId = $item->getId(); - } + if (isset($ratesIdQuoteItemId[$id])) { + foreach ($ratesIdQuoteItemId[$id] as $quoteItemId) { + if ($quoteItemId['code'] == $tax['code']) { + $itemId = null; + $associatedItemId = null; + if (isset($quoteItemId['id'])) { + //This is a product item + $item = $order->getItemByQuoteItemId($quoteItemId['id']); + $itemId = $item->getId(); + } elseif (isset($quoteItemId['associated_item_id'])) { + //This item is associated with a product item + $item = $order->getItemByQuoteItemId($quoteItemId['associated_item_id']); + $associatedItemId = $item->getId(); + } - $data = [ - 'item_id' => $itemId, - 'tax_id' => $result->getTaxId(), - 'tax_percent' => $quoteItemId['percent'], - 'associated_item_id' => $associatedItemId, - 'amount' => $quoteItemId['amount'], - 'base_amount' => $quoteItemId['base_amount'], - 'real_amount' => $quoteItemId['real_amount'], - 'real_base_amount' => $quoteItemId['real_base_amount'], - 'taxable_item_type' => $quoteItemId['item_type'], - ]; - /** @var $taxItem \Magento\Sales\Model\Order\Tax\Item */ - $taxItem = $this->taxItemFactory->create(); - $taxItem->setData($data)->save(); + $data = [ + 'item_id' => $itemId, + 'tax_id' => $result->getTaxId(), + 'tax_percent' => $quoteItemId['percent'], + 'associated_item_id' => $associatedItemId, + 'amount' => $quoteItemId['amount'], + 'base_amount' => $quoteItemId['base_amount'], + 'real_amount' => $quoteItemId['real_amount'], + 'real_base_amount' => $quoteItemId['real_base_amount'], + 'taxable_item_type' => $quoteItemId['item_type'], + ]; + /** @var $taxItem \Magento\Sales\Model\Order\Tax\Item */ + $taxItem = $this->taxItemFactory->create(); + $taxItem->setData($data)->save(); + } } } } diff --git a/app/code/Magento/Tax/Test/Unit/Model/Plugin/OrderSaveTest.php b/app/code/Magento/Tax/Test/Unit/Model/Plugin/OrderSaveTest.php index d1332e6ec9381..19e2dd88d1bbd 100644 --- a/app/code/Magento/Tax/Test/Unit/Model/Plugin/OrderSaveTest.php +++ b/app/code/Magento/Tax/Test/Unit/Model/Plugin/OrderSaveTest.php @@ -132,7 +132,7 @@ public function verifyItemTaxes($expectedItemTaxes) $index = 0; $itemTaxes = []; foreach ($expectedItemTaxes as $itemTax) { - $itemTaxMock = $this->getMockBuilder('\Magento\Sales\Model\Order\Tax\Item') + $itemTaxMock = $this->getMockBuilder(\Magento\Sales\Model\Order\Tax\Item::class) ->disableOriginalConstructor() ->setMethods( [ @@ -179,7 +179,7 @@ public function testAfterSave( $orderItemMock = $this->getMockBuilder('\Magento\Sales\Model\Order\Item') ->disableOriginalConstructor() - ->setMethods(['getId', ]) + ->setMethods(['getId']) ->getMock(); $orderItemMock->expects($this->atLeastOnce()) ->method('getId') @@ -235,7 +235,6 @@ public function afterSaveDataProvider() ] ] ); - $orderTaxDetailsApplied->expects($this->at(1)) ->method('getRates') ->willReturn( @@ -247,8 +246,6 @@ public function afterSaveDataProvider() ], ] ); - - $orderTaxDetailsApplied->expects($this->at(2)) ->method('getRates') ->willReturn( @@ -265,7 +262,6 @@ public function afterSaveDataProvider() ], ] ); - $orderTaxDetailsApplied->expects($this->at(3)) ->method('getRates') ->willReturn( @@ -277,7 +273,6 @@ public function afterSaveDataProvider() ], ] ); - $orderTaxDetailsApplied->expects($this->at(4)) ->method('getRates') ->willReturn( @@ -294,9 +289,6 @@ public function afterSaveDataProvider() ], ] ); - - - $orderTaxDetailsApplied->expects($this->at(5)) ->method('getRates') ->willReturn( @@ -338,22 +330,22 @@ public function afterSaveDataProvider() 'type' => 'product', 'associated_item_id' => null, 'applied_taxes' => [ - [ - 'amount' => 0.11, - 'base_amount' => 0.11, - 'percent' => 11, - 'id' => 'ILUS', - 'extension_attributes' => $orderTaxDetailsApplied, - ], - //city tax - [ - 'amount' => 0.03, - 'base_amount' => 0.03, - 'percent' => 3.33, - 'id' => 'CityTax', - 'extension_attributes' => $orderTaxDetailsApplied, - ], + [ + 'amount' => 0.11, + 'base_amount' => 0.11, + 'percent' => 11, + 'id' => 'ILUS', + 'extension_attributes' => $orderTaxDetailsApplied, ], + //city tax + [ + 'amount' => 0.03, + 'base_amount' => 0.03, + 'percent' => 3.33, + 'id' => 'CityTax', + 'extension_attributes' => $orderTaxDetailsApplied, + ], + ], ], //shipping tax [ diff --git a/app/code/Magento/Tax/Test/Unit/Model/Quote/ToOrderConverterTest.php b/app/code/Magento/Tax/Test/Unit/Model/Quote/ToOrderConverterTest.php index f1ad9dc90a8a2..0281894281283 100644 --- a/app/code/Magento/Tax/Test/Unit/Model/Quote/ToOrderConverterTest.php +++ b/app/code/Magento/Tax/Test/Unit/Model/Quote/ToOrderConverterTest.php @@ -265,14 +265,13 @@ public function afterConvertDataProvider() ], ] ], - ], 'shipping' => [ - 'item_id' => 146, - 'type' => 'shipping', - 'associated_item_id' => null, - 'applied_taxes' => [ - [ + 'item_id' => 146, + 'type' => 'shipping', + 'associated_item_id' => null, + 'applied_taxes' => [ + [ 'amount' => 0.30, 'item_id' => 146, 'item_type' => 'shipping', @@ -286,8 +285,8 @@ public function afterConvertDataProvider() ] ], ], - ] - ], + ] + ], ], ], ], From ee9e183535b5a4dc2a82f688569da0041b8e4b2e Mon Sep 17 00:00:00 2001 From: "Partica, Cristian" Date: Tue, 7 Jun 2016 17:47:43 -0500 Subject: [PATCH 242/345] MAGETWO-53366: Tax Report does not display any records - adding code improvements checking --- .../Magento/Tax/Model/Plugin/OrderSave.php | 166 +++++++++--------- 1 file changed, 85 insertions(+), 81 deletions(-) diff --git a/app/code/Magento/Tax/Model/Plugin/OrderSave.php b/app/code/Magento/Tax/Model/Plugin/OrderSave.php index b1edbd48ce607..0aafb69723aab 100644 --- a/app/code/Magento/Tax/Model/Plugin/OrderSave.php +++ b/app/code/Magento/Tax/Model/Plugin/OrderSave.php @@ -78,38 +78,40 @@ protected function saveOrderTax(\Magento\Sales\Api\Data\OrderInterface $order) $ratesIdQuoteItemId = []; foreach ($taxesForItems as $taxesArray) { foreach ($taxesArray['applied_taxes'] as $rates) { - if ($rates['extension_attributes']) { - $taxRates = $rates['extension_attributes']->getRates(); + if (isset($rates['extension_attributes'])) { /** @var \Magento\Tax\Api\Data\AppliedTaxRateInterface[] $taxRates */ - if (count($taxRates) == 1) { - $ratesIdQuoteItemId[$rates['id']][] = [ - 'id' => $taxesArray['item_id'], - 'percent' => $rates['percent'], - 'code' => $taxRates[0]['code'], - 'associated_item_id' => $taxesArray['associated_item_id'], - 'item_type' => $taxesArray['type'], - 'amount' => $rates['amount'], - 'base_amount' => $rates['base_amount'], - 'real_amount' => $rates['amount'], - 'real_base_amount' => $rates['base_amount'], - ]; - } else { - $percentSum = 0; - foreach ($taxRates as $rate) { - $realAmount = $rates['amount'] * $rate['percent'] / $rates['percent']; - $realBaseAmount = $rates['base_amount'] * $rate['percent'] / $rates['percent']; + $taxRates = $rates['extension_attributes']->getRates(); + if (is_array($taxRates)) { + if (count($taxRates) == 1) { $ratesIdQuoteItemId[$rates['id']][] = [ 'id' => $taxesArray['item_id'], - 'percent' => $rate['percent'], - 'code' => $rate['code'], + 'percent' => $rates['percent'], + 'code' => $taxRates[0]['code'], 'associated_item_id' => $taxesArray['associated_item_id'], 'item_type' => $taxesArray['type'], 'amount' => $rates['amount'], 'base_amount' => $rates['base_amount'], - 'real_amount' => $realAmount, - 'real_base_amount' => $realBaseAmount, + 'real_amount' => $rates['amount'], + 'real_base_amount' => $rates['base_amount'], ]; - $percentSum += $rate['percent']; + } else { + $percentSum = 0; + foreach ($taxRates as $rate) { + $realAmount = $rates['amount'] * $rate['percent'] / $rates['percent']; + $realBaseAmount = $rates['base_amount'] * $rate['percent'] / $rates['percent']; + $ratesIdQuoteItemId[$rates['id']][] = [ + 'id' => $taxesArray['item_id'], + 'percent' => $rate['percent'], + 'code' => $rate['code'], + 'associated_item_id' => $taxesArray['associated_item_id'], + 'item_type' => $taxesArray['type'], + 'amount' => $rates['amount'], + 'base_amount' => $rates['base_amount'], + 'real_amount' => $realAmount, + 'real_base_amount' => $realBaseAmount, + ]; + $percentSum += $rate['percent']; + } } } } @@ -118,69 +120,71 @@ protected function saveOrderTax(\Magento\Sales\Api\Data\OrderInterface $order) foreach ($taxes as $row) { $id = $row['id']; - if ($row['extension_attributes']) { + if (isset($row['extension_attributes'])) { /** @var \Magento\Tax\Api\Data\AppliedTaxRateInterface[] $taxRates */ $taxRates = $row['extension_attributes']->getRates(); - foreach ($taxRates as $tax) { - if ($row['percent'] == null) { - $baseRealAmount = $row['base_amount']; - } else { - if ($row['percent'] == 0 || $tax['percent'] == 0) { - continue; + if (is_array($taxRates)) { + foreach ($taxRates as $tax) { + if ($row['percent'] == null) { + $baseRealAmount = $row['base_amount']; + } else { + if ($row['percent'] == 0 || $tax['percent'] == 0) { + continue; + } + $baseRealAmount = $row['base_amount'] / $row['percent'] * $tax['percent']; } - $baseRealAmount = $row['base_amount'] / $row['percent'] * $tax['percent']; - } - $hidden = isset($row['hidden']) ? $row['hidden'] : 0; - $priority = isset($tax['priority']) ? $tax['priority'] : 0; - $position = isset($tax['position']) ? $tax['position'] : 0; - $process = isset($row['process']) ? $row['process'] : 0; - $data = [ - 'order_id' => $order->getEntityId(), - 'code' => $tax['code'], - 'title' => $tax['title'], - 'hidden' => $hidden, - 'percent' => $tax['percent'], - 'priority' => $priority, - 'position' => $position, - 'amount' => $row['amount'], - 'base_amount' => $row['base_amount'], - 'process' => $process, - 'base_real_amount' => $baseRealAmount, - ]; + $hidden = isset($row['hidden']) ? $row['hidden'] : 0; + $priority = isset($tax['priority']) ? $tax['priority'] : 0; + $position = isset($tax['position']) ? $tax['position'] : 0; + $process = isset($row['process']) ? $row['process'] : 0; + $data = [ + 'order_id' => $order->getEntityId(), + 'code' => $tax['code'], + 'title' => $tax['title'], + 'hidden' => $hidden, + 'percent' => $tax['percent'], + 'priority' => $priority, + 'position' => $position, + 'amount' => $row['amount'], + 'base_amount' => $row['base_amount'], + 'process' => $process, + 'base_real_amount' => $baseRealAmount, + ]; - /** @var $orderTax \Magento\Tax\Model\Sales\Order\Tax */ - $orderTax = $this->orderTaxFactory->create(); - $result = $orderTax->setData($data)->save(); + /** @var $orderTax \Magento\Tax\Model\Sales\Order\Tax */ + $orderTax = $this->orderTaxFactory->create(); + $result = $orderTax->setData($data)->save(); - if (isset($ratesIdQuoteItemId[$id])) { - foreach ($ratesIdQuoteItemId[$id] as $quoteItemId) { - if ($quoteItemId['code'] == $tax['code']) { - $itemId = null; - $associatedItemId = null; - if (isset($quoteItemId['id'])) { - //This is a product item - $item = $order->getItemByQuoteItemId($quoteItemId['id']); - $itemId = $item->getId(); - } elseif (isset($quoteItemId['associated_item_id'])) { - //This item is associated with a product item - $item = $order->getItemByQuoteItemId($quoteItemId['associated_item_id']); - $associatedItemId = $item->getId(); - } + if (isset($ratesIdQuoteItemId[$id])) { + foreach ($ratesIdQuoteItemId[$id] as $quoteItemId) { + if ($quoteItemId['code'] == $tax['code']) { + $itemId = null; + $associatedItemId = null; + if (isset($quoteItemId['id'])) { + //This is a product item + $item = $order->getItemByQuoteItemId($quoteItemId['id']); + $itemId = $item->getId(); + } elseif (isset($quoteItemId['associated_item_id'])) { + //This item is associated with a product item + $item = $order->getItemByQuoteItemId($quoteItemId['associated_item_id']); + $associatedItemId = $item->getId(); + } - $data = [ - 'item_id' => $itemId, - 'tax_id' => $result->getTaxId(), - 'tax_percent' => $quoteItemId['percent'], - 'associated_item_id' => $associatedItemId, - 'amount' => $quoteItemId['amount'], - 'base_amount' => $quoteItemId['base_amount'], - 'real_amount' => $quoteItemId['real_amount'], - 'real_base_amount' => $quoteItemId['real_base_amount'], - 'taxable_item_type' => $quoteItemId['item_type'], - ]; - /** @var $taxItem \Magento\Sales\Model\Order\Tax\Item */ - $taxItem = $this->taxItemFactory->create(); - $taxItem->setData($data)->save(); + $data = [ + 'item_id' => $itemId, + 'tax_id' => $result->getTaxId(), + 'tax_percent' => $quoteItemId['percent'], + 'associated_item_id' => $associatedItemId, + 'amount' => $quoteItemId['amount'], + 'base_amount' => $quoteItemId['base_amount'], + 'real_amount' => $quoteItemId['real_amount'], + 'real_base_amount' => $quoteItemId['real_base_amount'], + 'taxable_item_type' => $quoteItemId['item_type'], + ]; + /** @var $taxItem \Magento\Sales\Model\Order\Tax\Item */ + $taxItem = $this->taxItemFactory->create(); + $taxItem->setData($data)->save(); + } } } } From 78c666030e4d6cd6bbbe88ffb92a06a34375aa41 Mon Sep 17 00:00:00 2001 From: Valeriy Nayda Date: Thu, 2 Jun 2016 15:51:11 +0300 Subject: [PATCH 243/345] =?UTF-8?q?MAGETWO-50468:=20Products=20Grid=20Filt?= =?UTF-8?q?ering=20by=20Category=20ID=20doesn=E2=80=99t=20work?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Model/Product/Attribute/Source/Status.php | 31 +++-------------- .../Catalog/Model/Product/Visibility.php | 31 +++-------------- .../Attribute/Edit/Tab/AdvancedTest.php | 12 ++++++- .../Product/Attribute/Source/StatusTest.php | 18 ++++++++++ .../Model/Entity/Attribute/Source/Boolean.php | 34 +++---------------- .../Entity/Attribute/Source/BooleanTest.php | 10 +++++- 6 files changed, 50 insertions(+), 86 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Product/Attribute/Source/Status.php b/app/code/Magento/Catalog/Model/Product/Attribute/Source/Status.php index fb761bf116e37..9912e561b2d86 100644 --- a/app/code/Magento/Catalog/Model/Product/Attribute/Source/Status.php +++ b/app/code/Magento/Catalog/Model/Product/Attribute/Source/Status.php @@ -5,12 +5,9 @@ */ namespace Magento\Catalog\Model\Product\Attribute\Source; -use Magento\Catalog\Api\Data\ProductInterface; use Magento\Eav\Model\Entity\Attribute\Source\AbstractSource; use Magento\Eav\Model\Entity\Attribute\Source\SourceInterface; -use Magento\Framework\App\ObjectManager; use Magento\Framework\Data\OptionSourceInterface; -use Magento\Framework\Model\Entity\MetadataPool; /** * Product status functionality model @@ -26,13 +23,6 @@ class Status extends AbstractSource implements SourceInterface, OptionSourceInte /**#@-*/ - /** - * Metadata Pool - * - * @var MetadataPool - */ - protected $metadataPool; - /** * Retrieve Visible Status Ids * @@ -105,14 +95,14 @@ public function addValueSortToCollection($collection, $dir = 'asc') $attributeCode = $this->getAttribute()->getAttributeCode(); $attributeId = $this->getAttribute()->getId(); $attributeTable = $this->getAttribute()->getBackend()->getTable(); - $linkField = $this->getMetadataPool()->getMetadata(ProductInterface::class)->getLinkField(); + $linkField = $this->getAttribute()->getEntity()->getLinkField(); if ($this->getAttribute()->isScopeGlobal()) { $tableName = $attributeCode . '_t'; $collection->getSelect()->joinLeft( [$tableName => $attributeTable], - "e.entity_id={$tableName}.{$linkField}" . + "e.{$linkField}={$tableName}.{$linkField}" . " AND {$tableName}.attribute_id='{$attributeId}'" . " AND {$tableName}.store_id='0'", [] @@ -125,13 +115,13 @@ public function addValueSortToCollection($collection, $dir = 'asc') $collection->getSelect()->joinLeft( [$valueTable1 => $attributeTable], - "e.entity_id={$valueTable1}.{$linkField}" . + "e.{$linkField}={$valueTable1}.{$linkField}" . " AND {$valueTable1}.attribute_id='{$attributeId}'" . " AND {$valueTable1}.store_id='0'", [] )->joinLeft( [$valueTable2 => $attributeTable], - "e.entity_id={$valueTable2}.{$linkField}" . + "e.{$linkField}={$valueTable2}.{$linkField}" . " AND {$valueTable2}.attribute_id='{$attributeId}'" . " AND {$valueTable2}.store_id='{$collection->getStoreId()}'", [] @@ -148,17 +138,4 @@ public function addValueSortToCollection($collection, $dir = 'asc') return $this; } - - /** - * Get product metadata pool - * - * @return MetadataPool - */ - private function getMetadataPool() - { - if (null === $this->metadataPool) { - $this->metadataPool = ObjectManager::getInstance()->get(MetadataPool::class); - } - return $this->metadataPool; - } } diff --git a/app/code/Magento/Catalog/Model/Product/Visibility.php b/app/code/Magento/Catalog/Model/Product/Visibility.php index 4e2a6d94f58cb..f1c6c854081de 100644 --- a/app/code/Magento/Catalog/Model/Product/Visibility.php +++ b/app/code/Magento/Catalog/Model/Product/Visibility.php @@ -11,11 +11,8 @@ */ namespace Magento\Catalog\Model\Product; -use Magento\Catalog\Api\Data\ProductInterface; -use Magento\Framework\App\ObjectManager; use Magento\Framework\Data\OptionSourceInterface; use Magento\Framework\DB\Ddl\Table; -use Magento\Framework\Model\Entity\MetadataPool; class Visibility extends \Magento\Framework\DataObject implements OptionSourceInterface { @@ -41,13 +38,6 @@ class Visibility extends \Magento\Framework\DataObject implements OptionSourceIn */ protected $_eavEntityAttribute; - /** - * Metadata Pool - * - * @var MetadataPool - */ - protected $metadataPool; - /** * Construct * @@ -221,13 +211,13 @@ public function addValueSortToCollection($collection, $dir = 'asc') $attributeCode = $this->getAttribute()->getAttributeCode(); $attributeId = $this->getAttribute()->getId(); $attributeTable = $this->getAttribute()->getBackend()->getTable(); - $linkField = $this->getMetadataPool()->getMetadata(ProductInterface::class)->getLinkField(); + $linkField = $this->getAttribute()->getEntity()->getLinkField(); if ($this->getAttribute()->isScopeGlobal()) { $tableName = $attributeCode . '_t'; $collection->getSelect()->joinLeft( [$tableName => $attributeTable], - "e.entity_id={$tableName}.{$linkField}" . + "e.{$linkField}={$tableName}.{$linkField}" . " AND {$tableName}.attribute_id='{$attributeId}'" . " AND {$tableName}.store_id='0'", [] @@ -238,13 +228,13 @@ public function addValueSortToCollection($collection, $dir = 'asc') $valueTable2 = $attributeCode . '_t2'; $collection->getSelect()->joinLeft( [$valueTable1 => $attributeTable], - "e.entity_id={$valueTable1}.{$linkField}" . + "e.{$linkField}={$valueTable1}.{$linkField}" . " AND {$valueTable1}.attribute_id='{$attributeId}'" . " AND {$valueTable1}.store_id='0'", [] )->joinLeft( [$valueTable2 => $attributeTable], - "e.entity_id={$valueTable2}.{$linkField}" . + "e.{$linkField}={$valueTable2}.{$linkField}" . " AND {$valueTable2}.attribute_id='{$attributeId}'" . " AND {$valueTable2}.store_id='{$collection->getStoreId()}'", [] @@ -267,17 +257,4 @@ public function toOptionArray() { return $this->getAllOptions(); } - - /** - * Get product metadata pool - * - * @return MetadataPool - */ - private function getMetadataPool() - { - if (null === $this->metadataPool) { - $this->metadataPool = ObjectManager::getInstance()->get(MetadataPool::class); - } - return $this->metadataPool; - } } diff --git a/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Attribute/Edit/Tab/AdvancedTest.php b/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Attribute/Edit/Tab/AdvancedTest.php index 2fc12ad86502a..66e873c2085f6 100644 --- a/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Attribute/Edit/Tab/AdvancedTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Attribute/Edit/Tab/AdvancedTest.php @@ -5,6 +5,8 @@ */ namespace Magento\Catalog\Test\Unit\Block\Adminhtml\Product\Attribute\Edit\Tab; +use Magento\Eav\Block\Adminhtml\Attribute\PropertyLocker; + class AdvancedTest extends \PHPUnit_Framework_TestCase { /** @@ -42,6 +44,11 @@ class AdvancedTest extends \PHPUnit_Framework_TestCase */ protected $filesystem; + /** + * @var PropertyLocker|\PHPUnit_Framework_MockObject_MockObject + */ + protected $propertyLocker; + protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); @@ -51,6 +58,7 @@ protected function setUp() $this->localeDate = $this->getMock('Magento\Framework\Stdlib\DateTime\TimezoneInterface'); $this->eavData = $this->getMock('Magento\Eav\Helper\Data', [], [], '', false); $this->filesystem = $this->getMock('Magento\Framework\Filesystem', [], [], '', false); + $this->propertyLocker = $this->getMock(PropertyLocker::class, [], [], '', false); $this->block = $objectManager->getObject( 'Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab\Advanced', @@ -60,7 +68,8 @@ protected function setUp() 'localeDate' => $this->localeDate, 'yesNo' => $this->yesNo, 'eavData' => $this->eavData, - 'filesystem' => $this->filesystem + 'filesystem' => $this->filesystem, + 'propertyLocker' => $this->propertyLocker, ] ); } @@ -93,6 +102,7 @@ public function testToHtml() $this->yesNo->expects($this->any())->method('toOptionArray')->willReturn(['yes', 'no']); $this->filesystem->expects($this->any())->method('getDirectoryRead')->willReturn($directoryReadInterface); $directoryReadInterface->expects($this->any())->method('getRelativePath')->willReturn('relative_path'); + $this->propertyLocker->expects($this->once())->method('lock')->with($form); $this->block->setData(['action' => 'save']); $this->block->toHtml(); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/Source/StatusTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/Source/StatusTest.php index 541f05b2a498e..4a9bb61e2b01a 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/Source/StatusTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/Source/StatusTest.php @@ -8,6 +8,7 @@ namespace Magento\Catalog\Test\Unit\Model\Product\Attribute\Source; +use Magento\Eav\Model\Entity\AbstractEntity; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; class StatusTest extends \PHPUnit_Framework_TestCase @@ -27,6 +28,11 @@ class StatusTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend|\PHPUnit_Framework_MockObject_MockObject */ protected $backendAttributeModel; + /** + * @var AbstractEntity|\PHPUnit_Framework_MockObject_MockObject + */ + protected $entity; + protected function setUp() { $this->objectManagerHelper = new ObjectManagerHelper($this); @@ -53,6 +59,7 @@ protected function setUp() 'getBackend', 'getId', 'isScopeGlobal', + 'getEntity', ], [], '', @@ -78,6 +85,11 @@ protected function setUp() ->will($this->returnSelf()); $this->backendAttributeModel->expects($this->any())->method('getTable') ->will($this->returnValue('table_name')); + + $this->entity = $this->getMockBuilder(AbstractEntity::class) + ->disableOriginalConstructor() + ->setMethods(['getLinkField']) + ->getMockForAbstractClass(); } public function testAddValueSortToCollectionGlobal() @@ -87,6 +99,9 @@ public function testAddValueSortToCollectionGlobal() $this->collection->expects($this->once())->method('order')->with('attribute_code_t.value asc') ->will($this->returnSelf()); + $this->attributeModel->expects($this->once())->method('getEntity')->willReturn($this->entity); + $this->entity->expects($this->once())->method('getLinkField')->willReturn('entity_id'); + $this->status->setAttribute($this->attributeModel); $this->status->addValueSortToCollection($this->collection); } @@ -105,6 +120,9 @@ public function testAddValueSortToCollectionNotGlobal() $this->collection->expects($this->any())->method('getCheckSql') ->will($this->returnValue('check_sql')); + $this->attributeModel->expects($this->any())->method('getEntity')->willReturn($this->entity); + $this->entity->expects($this->once())->method('getLinkField')->willReturn('entity_id'); + $this->status->setAttribute($this->attributeModel); $this->status->addValueSortToCollection($this->collection); } diff --git a/app/code/Magento/Eav/Model/Entity/Attribute/Source/Boolean.php b/app/code/Magento/Eav/Model/Entity/Attribute/Source/Boolean.php index 7fbb3e0110be8..09195f4f52d9a 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute/Source/Boolean.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute/Source/Boolean.php @@ -5,9 +5,6 @@ */ namespace Magento\Eav\Model\Entity\Attribute\Source; -use Magento\Framework\App\ObjectManager; -use Magento\Framework\Model\Entity\MetadataPool; - class Boolean extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource { /** @@ -22,13 +19,6 @@ class Boolean extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource */ protected $_eavAttrEntity; - /** - * Metadata Pool - * - * @var MetadataPool - */ - protected $metadataPool; - /** * @param \Magento\Eav\Model\ResourceModel\Entity\AttributeFactory $eavAttrEntity * @codeCoverageIgnore @@ -165,17 +155,14 @@ public function addValueSortToCollection($collection, $dir = \Magento\Framework\ $attributeCode = $this->getAttribute()->getAttributeCode(); $attributeId = $this->getAttribute()->getId(); $attributeTable = $this->getAttribute()->getBackend()->getTable(); - - // FIXME: we can not use \Magento\Catalog\Api\Data\ProductInterface::class - $linkField = $this->getMetadataPool()->getMetadata(\Magento\Catalog\Api\Data\ProductInterface::class) - ->getLinkField(); + $linkField = $this->getAttribute()->getEntity()->getLinkField(); if ($this->getAttribute()->isScopeGlobal()) { $tableName = $attributeCode . '_t'; $collection->getSelect() ->joinLeft( [$tableName => $attributeTable], - "e.entity_id={$tableName}.{$linkField}" + "e.{$linkField}={$tableName}.{$linkField}" . " AND {$tableName}.attribute_id='{$attributeId}'" . " AND {$tableName}.store_id='0'", [] @@ -187,14 +174,14 @@ public function addValueSortToCollection($collection, $dir = \Magento\Framework\ $collection->getSelect() ->joinLeft( [$valueTable1 => $attributeTable], - "e.entity_id={$valueTable1}.{$linkField}" + "e.{$linkField}={$valueTable1}.{$linkField}" . " AND {$valueTable1}.attribute_id='{$attributeId}'" . " AND {$valueTable1}.store_id='0'", [] ) ->joinLeft( [$valueTable2 => $attributeTable], - "e.entity_id={$valueTable2}.{$linkField}" + "e.{$linkField}={$valueTable2}.{$linkField}" . " AND {$valueTable2}.attribute_id='{$attributeId}'" . " AND {$valueTable2}.store_id='{$collection->getStoreId()}'", [] @@ -209,17 +196,4 @@ public function addValueSortToCollection($collection, $dir = \Magento\Framework\ $collection->getSelect()->order($valueExpr . ' ' . $dir); return $this; } - - /** - * Get product metadata pool - * - * @return MetadataPool - */ - private function getMetadataPool() - { - if (null === $this->metadataPool) { - $this->metadataPool = ObjectManager::getInstance()->get(MetadataPool::class); - } - return $this->metadataPool; - } } diff --git a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Source/BooleanTest.php b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Source/BooleanTest.php index 0aa867295542e..9ec8212b7cc42 100644 --- a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Source/BooleanTest.php +++ b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Source/BooleanTest.php @@ -8,6 +8,7 @@ namespace Magento\Eav\Test\Unit\Model\Entity\Attribute\Source; +use Magento\Eav\Model\Entity\AbstractEntity; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; class BooleanTest extends \PHPUnit_Framework_TestCase @@ -67,6 +68,13 @@ public function testAddValueSortToCollection( $attributeMock = $this->getAttributeMock(); $attributeMock->expects($this->any())->method('isScopeGlobal')->will($this->returnValue($isScopeGlobal)); + $entity = $this->getMockBuilder(AbstractEntity::class) + ->disableOriginalConstructor() + ->setMethods(['getLinkField']) + ->getMockForAbstractClass(); + $entity->expects($this->once())->method('getLinkField')->willReturn('entity_id'); + $attributeMock->expects($this->once())->method('getEntity')->willReturn($entity); + $selectMock = $this->getMock('\Magento\Framework\DB\Select', [], [], '', false); $collectionMock = $this->getCollectionMock(); @@ -173,7 +181,7 @@ protected function getCollectionMock() */ protected function getAttributeMock() { - $attributeMockMethods = ['getAttributeCode', 'getId', 'getBackend', 'isScopeGlobal', '__wakeup']; + $attributeMockMethods = ['getAttributeCode', 'getId', 'getBackend', 'isScopeGlobal', '__wakeup' , 'getEntity']; $attributeMock = $this->getMock( '\Magento\Eav\Model\Entity\Attribute\AbstractAttribute', $attributeMockMethods, [], '', false ); From aeaac1d437261540c068a910ac1b867424b75335 Mon Sep 17 00:00:00 2001 From: Oleksandr Miroshnichenko Date: Wed, 8 Jun 2016 12:25:39 +0300 Subject: [PATCH 244/345] MAGETWO-53034: DnD in Dynamic Rows is not work --- .../Ui/view/base/web/js/dynamic-rows/dnd.js | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Ui/view/base/web/js/dynamic-rows/dnd.js b/app/code/Magento/Ui/view/base/web/js/dynamic-rows/dnd.js index e52177f74e461..d76fb433106ef 100644 --- a/app/code/Magento/Ui/view/base/web/js/dynamic-rows/dnd.js +++ b/app/code/Magento/Ui/view/base/web/js/dynamic-rows/dnd.js @@ -58,8 +58,12 @@ define([ recordsCache: [], draggableElement: {}, draggableElementClass: '_dragged', + elemPositions: [], listens: { '${ $.recordsProvider }:elems': 'setCacheRecords' + }, + modules: { + parentComponent: '${ $.recordsProvider }' } }, @@ -189,7 +193,9 @@ define([ pageY = isTouchDevice ? event.originalEvent.touches[0].pageY : event.pageY, positionY = pageY - drEl.eventMousedownY; - drEl.depElement = this.getDepElement(drEl.instance, positionY); + drEl.depElement = this.getDepElement(drEl.instance, positionY, this.draggableElement.originRow); + + drEl.instance.remove(); if (drEl.depElement) { depElementCtx = this.getRecord(drEl.depElement.elem[0]); @@ -210,7 +216,6 @@ define([ this.body.unbind('mouseup', this.mouseupHandler); } - drEl.instance.remove(); this.draggableElement = {}; }, @@ -224,11 +229,34 @@ define([ setPosition: function (depElem, depElementCtx, dragData) { var depElemPosition = ~~depElementCtx.position; + this.cacheElementsPosition(); + if (dragData.depElement.insert === 'after') { dragData.instanceCtx.position = depElemPosition + 1; } else if (dragData.depElement.insert === 'before') { dragData.instanceCtx.position = depElemPosition; } + + this.normalizePositions(); + }, + + /** + * Saves elements position from current elements + */ + cacheElementsPosition: function () { + this.elemPositions = []; + this.parentComponent().elems.each(function (elem) { + this.elemPositions.push(elem.position); + }, this); + }, + + /** + * Normalize position, uses start elements position + */ + normalizePositions: function () { + this.parentComponent().elems.each(function (item, index) { + item.position = this.elemPositions[index]; + }, this); }, /** From 20e32165183a7d4813757a475ed4c21139d3e878 Mon Sep 17 00:00:00 2001 From: Oleh Posyniak Date: Wed, 8 Jun 2016 12:45:34 +0300 Subject: [PATCH 245/345] MAGETWO-53223: [Github] Magento performance decreases significantly if Merge CSS Files = Yes #4710 --- .../Framework/View/Asset/MergeService.php | 6 +- .../Magento/Framework/View/Asset/Merged.php | 31 +--------- .../View/Test/Unit/Asset/MergeServiceTest.php | 4 +- .../View/Test/Unit/Asset/MergedTest.php | 56 ++----------------- 4 files changed, 11 insertions(+), 86 deletions(-) diff --git a/lib/internal/Magento/Framework/View/Asset/MergeService.php b/lib/internal/Magento/Framework/View/Asset/MergeService.php index 612e0312eead8..4b288f365d514 100644 --- a/lib/internal/Magento/Framework/View/Asset/MergeService.php +++ b/lib/internal/Magento/Framework/View/Asset/MergeService.php @@ -79,10 +79,10 @@ public function getMergedAssets(array $assets, $contentType) $isCssMergeEnabled = $this->config->isMergeCssFiles(); $isJsMergeEnabled = $this->config->isMergeJsFiles(); if (($isCss && $isCssMergeEnabled) || ($isJs && $isJsMergeEnabled)) { - if ($this->state->getMode() == \Magento\Framework\App\State::MODE_PRODUCTION) { - $mergeStrategyClass = 'Magento\Framework\View\Asset\MergeStrategy\FileExists'; - } else { + if ($this->state->getMode() === \Magento\Framework\App\State::MODE_DEVELOPER) { $mergeStrategyClass = 'Magento\Framework\View\Asset\MergeStrategy\Checksum'; + } else { + $mergeStrategyClass = 'Magento\Framework\View\Asset\MergeStrategy\FileExists'; } $mergeStrategy = $this->objectManager->get($mergeStrategyClass); diff --git a/lib/internal/Magento/Framework/View/Asset/Merged.php b/lib/internal/Magento/Framework/View/Asset/Merged.php index e3530157b8eb1..5017b8b7f1d49 100644 --- a/lib/internal/Magento/Framework/View/Asset/Merged.php +++ b/lib/internal/Magento/Framework/View/Asset/Merged.php @@ -5,10 +5,6 @@ */ namespace Magento\Framework\View\Asset; -use Magento\Framework\App\Filesystem\DirectoryList; -use Magento\Framework\App\ObjectManager; -use Magento\Framework\Filesystem; - /** * \Iterator that aggregates one or more assets and provides a single public file with equivalent behavior */ @@ -34,11 +30,6 @@ class Merged implements \Iterator */ private $assetRepo; - /** - * @var Filesystem - */ - private $filesystem; - /** * @var MergeableInterface[] */ @@ -103,14 +94,7 @@ protected function initialize() $this->isInitialized = true; try { $mergedAsset = $this->createMergedAsset($this->assets); - $isExists = $this->getFilesystem() - ->getDirectoryRead(DirectoryList::STATIC_VIEW) - ->isExist($mergedAsset->getRelativeSourceFilePath()); - - if (!$isExists) { - $this->mergeStrategy->merge($this->assets, $mergedAsset); - } - + $this->mergeStrategy->merge($this->assets, $mergedAsset); $this->assets = [$mergedAsset]; } catch (\Exception $e) { $this->logger->critical($e); @@ -192,17 +176,4 @@ public static function getRelativeDir() { return self::CACHE_VIEW_REL . '/merged'; } - - /** - * @return Filesystem - * @deprecated - */ - private function getFilesystem() - { - if (null === $this->filesystem) { - $this->filesystem = ObjectManager::getInstance()->get(Filesystem::class); - } - - return $this->filesystem; - } } diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Asset/MergeServiceTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Asset/MergeServiceTest.php index f7ebf899fe950..e1997d92ede8a 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Asset/MergeServiceTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Asset/MergeServiceTest.php @@ -141,13 +141,13 @@ public static function getMergedAssetsDataProvider() $jsAssets, 'js', \Magento\Framework\App\State::MODE_DEFAULT, - 'Magento\Framework\View\Asset\MergeStrategy\Checksum', + 'Magento\Framework\View\Asset\MergeStrategy\FileExists', ], 'css default mode' => [ $cssAssets, 'js', \Magento\Framework\App\State::MODE_DEFAULT, - 'Magento\Framework\View\Asset\MergeStrategy\Checksum', + 'Magento\Framework\View\Asset\MergeStrategy\FileExists', ], 'js developer mode' => [ $jsAssets, diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Asset/MergedTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Asset/MergedTest.php index 140d39e31889e..2730bd72d3092 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Asset/MergedTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Asset/MergedTest.php @@ -5,7 +5,6 @@ */ namespace Magento\Framework\View\Test\Unit\Asset; -use Magento\Framework\Filesystem; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\Framework\View\Asset\File; use Magento\Framework\View\Asset\Merged; @@ -22,37 +21,27 @@ class MergedTest extends \PHPUnit_Framework_TestCase /** * @var LoggerInterface|\PHPUnit_Framework_MockObject_MockObject */ - protected $logger; + private $logger; /** * @var MergeStrategyInterface|\PHPUnit_Framework_MockObject_MockObject */ - protected $mergeStrategy; + private $mergeStrategy; /** * @var MergeableInterface|\PHPUnit_Framework_MockObject_MockObject */ - protected $assetJsOne; + private $assetJsOne; /** * @var MergeableInterface|\PHPUnit_Framework_MockObject_MockObject */ - protected $assetJsTwo; + private $assetJsTwo; /** * @var AssetRepository|\PHPUnit_Framework_MockObject_MockObject */ - protected $assetRepo; - - /** - * @var Filesystem|\PHPUnit_Framework_MockObject_MockObject - */ - protected $filesystemMock; - - /** - * @var Filesystem\Directory\ReadInterface|\PHPUnit_Framework_MockObject_MockObject - */ - protected $directoryReadMock; + private $assetRepo; protected function setUp() { @@ -77,15 +66,6 @@ protected function setUp() $this->assetRepo = $this->getMockBuilder(AssetRepository::class) ->disableOriginalConstructor() ->getMock(); - $this->filesystemMock = $this->getMockBuilder(Filesystem::class) - ->disableOriginalConstructor() - ->getMock(); - $this->directoryReadMock = $this->getMockBuilder(Filesystem\Directory\ReadInterface::class) - ->getMockForAbstractClass(); - - $this->filesystemMock->expects($this->any()) - ->method('getDirectoryRead') - ->willReturn($this->directoryReadMock); } /** @@ -144,7 +124,6 @@ public function testIteratorInterfaceMerge() 'mergeStrategy' => $this->mergeStrategy, 'assetRepo' => $this->assetRepo, 'assets' => $assets, - 'filesystem' => $this->filesystemMock, ]); $mergedAsset = $this->getMock('Magento\Framework\View\Asset\File', [], [], '', false); @@ -179,7 +158,6 @@ public function testIteratorInterfaceMergeFailure() 'mergeStrategy' => $this->mergeStrategy, 'assetRepo' => $this->assetRepo, 'assets' => [$this->assetJsOne, $this->assetJsTwo, $assetBroken], - 'filesystem' => $this->filesystemMock, ]); $this->logger->expects($this->once())->method('critical')->with($this->identicalTo($mergeError)); @@ -189,30 +167,6 @@ public function testIteratorInterfaceMergeFailure() $this->assertIteratorEquals($expectedResult, $merged); // ensure merging attempt happens only once } - public function testMergedFileCheckbefore() - { - /** @var Merged $merged */ - $merged = (new ObjectManager($this))->getObject(Merged::class, [ - 'logger' => $this->logger, - 'mergeStrategy' => $this->mergeStrategy, - 'assetRepo' => $this->assetRepo, - 'assets' => [$this->assetJsOne, $this->assetJsTwo], - 'filesystem' => $this->filesystemMock, - ]); - - $mergedAsset = $this->getMockBuilder(File::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->directoryReadMock->expects($this->once()) - ->method('isExist') - ->willReturn(true); - $this->assetRepo->expects($this->once()) - ->method('createArbitrary')->willReturn($mergedAsset); - - $this->assertIteratorEquals([$mergedAsset], $merged); - } - /** * Assert that iterator items equal to expected ones * From 8bf55bcb0050c67e9f0037dc54f45dcb3088a07e Mon Sep 17 00:00:00 2001 From: Ievgen Sentiabov Date: Wed, 8 Jun 2016 12:52:19 +0300 Subject: [PATCH 246/345] MAGETWO-53238: Vault Provider field contains Payflow Pro option in countries which don't have such solution - Updated integration test --- .../Magento/Sales/Model/AdminOrder/CreateTest.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Sales/Model/AdminOrder/CreateTest.php b/dev/tests/integration/testsuite/Magento/Sales/Model/AdminOrder/CreateTest.php index 53339b6177e28..540d1de77a177 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Model/AdminOrder/CreateTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Model/AdminOrder/CreateTest.php @@ -123,7 +123,7 @@ public function testInitFromOrderCcInformationDeleted() } /** - * @magentoDataFixture Magento/Sales/_files/order_paid_with_payflowpro.php + * @magentoDataFixture Magento/Sales/_files/order.php */ public function testInitFromOrderWithEmptyPaymentDetails() { @@ -136,13 +136,16 @@ public function testInitFromOrderWithEmptyPaymentDetails() $objectManager->get(Registry::class) ->unregister('rule_data'); - $payment = $this->_model->initFromOrder($order) - ->getQuote() - ->getPayment(); + $initOrder = $this->_model->initFromOrder($order); + $payment = $initOrder->getQuote()->getPayment(); + + static::assertEquals($initOrder->getQuote()->getId(), $payment->getData('quote_id')); + $payment->unsetData('quote_id'); static::assertEmpty($payment->getMethod()); static::assertEmpty($payment->getAdditionalInformation()); static::assertEmpty($payment->getAdditionalData()); + static::assertEmpty($payment->getData()); } /** From 1f986a533fc4a08db0ef18acad3d0b38e0de31a4 Mon Sep 17 00:00:00 2001 From: Andrii Kasian Date: Fri, 3 Jun 2016 15:14:35 +0300 Subject: [PATCH 247/345] MAGETWO-53530: Performance of category pages significantly degrade when having around 3000 products or more in category --- .../Magento/Framework/Api/Search/Document.php | 65 +++++++------------ .../Magento/Framework/App/Request/Http.php | 14 +++- .../Search/Adapter/Mysql/DocumentFactory.php | 27 +++++--- .../Search/Response/QueryResponse.php | 2 +- .../Framework/Search/ResponseInterface.php | 2 +- .../Search/SearchResponseBuilder.php | 18 +---- 6 files changed, 56 insertions(+), 72 deletions(-) diff --git a/lib/internal/Magento/Framework/Api/Search/Document.php b/lib/internal/Magento/Framework/Api/Search/Document.php index cfeba5aaa0818..3076b909e31d0 100644 --- a/lib/internal/Magento/Framework/Api/Search/Document.php +++ b/lib/internal/Magento/Framework/Api/Search/Document.php @@ -6,26 +6,9 @@ namespace Magento\Framework\Api\Search; use Magento\Framework\Api\AbstractSimpleObject; -use Magento\Framework\Api\AttributeValueFactory; -class Document extends AbstractSimpleObject implements DocumentInterface +class Document extends AbstractSimpleObject implements DocumentInterface, \IteratorAggregate { - /** - * @var AttributeValueFactory - */ - private $attributeValueFactory; - - /** - * @param AttributeValueFactory $attributeValueFactory - * @param array $data - */ - public function __construct(AttributeValueFactory $attributeValueFactory, array $data = []) - { - parent::__construct($data); - $this->attributeValueFactory = $attributeValueFactory; - } - - /** * {@inheritdoc} */ @@ -47,17 +30,7 @@ public function setId($id) */ public function getCustomAttribute($attributeCode) { - $resultAttribute = null; - /** @var \Magento\Framework\Api\AttributeInterface[] $attributes */ - $attributes = is_array($this->_get(self::CUSTOM_ATTRIBUTES)) ? $this->_get(self::CUSTOM_ATTRIBUTES) : []; - foreach ($attributes as $attribute) { - if ($attribute->getAttributeCode() === $attributeCode) { - $resultAttribute = $attribute; - break; - } - } - - return $resultAttribute; + return isset($this->_data[self::CUSTOM_ATTRIBUTES][$attributeCode]) ? $this->_data[self::CUSTOM_ATTRIBUTES][$attributeCode] : null; } /** @@ -65,22 +38,17 @@ public function getCustomAttribute($attributeCode) */ public function setCustomAttribute($attributeCode, $attributeValue) { - $isAlreadyAdded = false; /** @var \Magento\Framework\Api\AttributeInterface[] $attributes */ + $attributes = $this->getCustomAttributes(); + $attributes[$attributeCode] = $attributeValue; + return $this->setCustomAttributes($attributes); +/* $attributes = is_array($this->getCustomAttributes()) ? $this->getCustomAttributes() : []; - foreach ($attributes as $attribute) { - if ($attribute->getAttributeCode() === $attributeCode) { - $attribute->setValue($attributeValue); - $isAlreadyAdded = true; - break; - } - } - if (!$isAlreadyAdded) { - $attributes[] = $this->attributeValueFactory->create() - ->setAttributeCode($attributeCode) - ->setValue($attributeValue); - } - return $this->setData(self::CUSTOM_ATTRIBUTES, $attributes); + $attribute = (array_key_exists($attributeCode, $attributes)) ? + $attributes[$attributeCode] : $this->attributeValueFactory->create()->setAttributeCode($attributeCode); + $attribute->setValue($attributeValue); + $attributes[$attributeCode] = $attribute; + return $this->setCustomAttributes($attributes);*/ } /** @@ -98,4 +66,15 @@ public function setCustomAttributes(array $attributes) { return $this->setData(self::CUSTOM_ATTRIBUTES, $attributes); } + + /** + * Implementation of \IteratorAggregate::getIterator() + * + * @return \ArrayIterator + */ + public function getIterator() + { + $attributes = is_array($this->getCustomAttributes()) ? $this->getCustomAttributes() : []; + return new \ArrayIterator($attributes); + } } diff --git a/lib/internal/Magento/Framework/App/Request/Http.php b/lib/internal/Magento/Framework/App/Request/Http.php index 434a2e3ebae16..ff37c66e92f58 100644 --- a/lib/internal/Magento/Framework/App/Request/Http.php +++ b/lib/internal/Magento/Framework/App/Request/Http.php @@ -313,8 +313,11 @@ public function isAjax() * * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ - public function getDistroBaseUrl() - { + public function getDistroBaseUrl() + { + if ($this->distroBaseUrl) { + return $this->distroBaseUrl; + } $headerHttpHost = $this->getServer('HTTP_HOST'); $headerHttpHost = $this->converter->cleanString($headerHttpHost); $headerScriptName = $this->getServer('SCRIPT_NAME'); @@ -332,11 +335,16 @@ public function getDistroBaseUrl() && (!$secure && $hostArr[1] != 80 || $secure && $hostArr[1] != 443) ? ':' . $hostArr[1] : ''; $path = $this->getBasePath(); - return $scheme . $host . $port . rtrim($path, '/') . '/'; + return $this->distroBaseUrl = $scheme . $host . $port . rtrim($path, '/') . '/'; } return 'http://localhost/'; } + /** + * @var string + */ + private $distroBaseUrl; + /** * Determines a base URL path from environment * diff --git a/lib/internal/Magento/Framework/Search/Adapter/Mysql/DocumentFactory.php b/lib/internal/Magento/Framework/Search/Adapter/Mysql/DocumentFactory.php index cebcc973ce8fa..e5255486e8df3 100644 --- a/lib/internal/Magento/Framework/Search/Adapter/Mysql/DocumentFactory.php +++ b/lib/internal/Magento/Framework/Search/Adapter/Mysql/DocumentFactory.php @@ -14,6 +14,7 @@ class DocumentFactory * Object Manager instance * * @var \Magento\Framework\ObjectManagerInterface + * @deprecated */ protected $objectManager; @@ -22,6 +23,11 @@ class DocumentFactory */ private $entityMetadata; + /** + * @var \Magento\Framework\Api\AttributeValueFactory + */ + private $attributeValueFactory; + /** * @param \Magento\Framework\ObjectManagerInterface $objectManager * @param \Magento\Framework\Search\EntityMetadata $entityMetadata @@ -29,9 +35,11 @@ class DocumentFactory public function __construct( \Magento\Framework\ObjectManagerInterface $objectManager, \Magento\Framework\Search\EntityMetadata $entityMetadata +// \Magento\Framework\Api\AttributeValueFactory $attributeValueFactory ) { $this->objectManager = $objectManager; $this->entityMetadata = $entityMetadata; +// $this->attributeValueFactory = $attributeValueFactory; } /** @@ -42,21 +50,24 @@ public function __construct( */ public function create($rawDocument) { - /** @var \Magento\Framework\Search\DocumentField[] $fields */ - $fields = []; $documentId = null; - $entityId = $this->entityMetadata->getEntityId(); + $entityId = $this->entityMetadata->getEntityId(); + $attributes = []; foreach ($rawDocument as $rawField) { $fieldName = $rawField['name']; if ($fieldName === $entityId) { $documentId = $rawField['value']; } else { - $fields[$fieldName] = $this->objectManager->create('Magento\Framework\Search\DocumentField', $rawField); + $attributes[$fieldName] = new \Magento\Framework\Api\AttributeValue([ + \Magento\Framework\Api\AttributeInterface::ATTRIBUTE_CODE => $fieldName, + \Magento\Framework\Api\AttributeInterface::VALUE => $rawField['value'] + ]); + //$this->attributeValueFactory->create() } } - return $this->objectManager->create( - 'Magento\Framework\Search\Document', - ['documentFields' => $fields, 'documentId' => $documentId] - ); + return new \Magento\Framework\Api\Search\Document([ + \Magento\Framework\Api\Search\DocumentInterface::ID => $documentId, + \Magento\Framework\Api\CustomAttributesDataInterface::CUSTOM_ATTRIBUTES => $attributes + ]); } } diff --git a/lib/internal/Magento/Framework/Search/Response/QueryResponse.php b/lib/internal/Magento/Framework/Search/Response/QueryResponse.php index a81cd655bdb0f..a205c2b37ed03 100644 --- a/lib/internal/Magento/Framework/Search/Response/QueryResponse.php +++ b/lib/internal/Magento/Framework/Search/Response/QueryResponse.php @@ -12,7 +12,7 @@ /** * Search Response */ -class QueryResponse implements ResponseInterface, \IteratorAggregate, \Countable +class QueryResponse implements ResponseInterface, \Countable { /** * Document Collection diff --git a/lib/internal/Magento/Framework/Search/ResponseInterface.php b/lib/internal/Magento/Framework/Search/ResponseInterface.php index 5cb9d7794ba96..3c4b70b73d6ff 100644 --- a/lib/internal/Magento/Framework/Search/ResponseInterface.php +++ b/lib/internal/Magento/Framework/Search/ResponseInterface.php @@ -8,7 +8,7 @@ /** * Search Request */ -interface ResponseInterface +interface ResponseInterface extends \IteratorAggregate { /** * Return Aggregation Collection diff --git a/lib/internal/Magento/Framework/Search/SearchResponseBuilder.php b/lib/internal/Magento/Framework/Search/SearchResponseBuilder.php index 6d29414b0668c..91f8d363c0e1b 100644 --- a/lib/internal/Magento/Framework/Search/SearchResponseBuilder.php +++ b/lib/internal/Magento/Framework/Search/SearchResponseBuilder.php @@ -13,6 +13,7 @@ class SearchResponseBuilder { /** * @var DocumentFactory + * @deprecated */ private $documentFactory; @@ -42,22 +43,7 @@ public function build(ResponseInterface $response) /** @var \Magento\Framework\Api\Search\SearchResult $searchResult */ $searchResult = $this->searchResultFactory->create(); - /** @var \Magento\Framework\Api\Search\DocumentInterface[] $documents */ - $documents = []; - - /** @var \Magento\Framework\Search\Document $responseDocument */ - foreach ($response as $responseDocument) { - $document = $this->documentFactory->create(); - - /** @var \Magento\Framework\Search\DocumentField $field */ - foreach ($responseDocument as $field) { - $document->setCustomAttribute($field->getName(), $field->getValue()); - } - - $document->setId($responseDocument->getId()); - - $documents[] = $document; - } + $documents = iterator_to_array($response); $searchResult->setItems($documents); $searchResult->setAggregations($response->getAggregations()); $searchResult->setTotalCount(count($documents)); From f86851f826afa8efd067e3bc1e5c6af6cfd3578d Mon Sep 17 00:00:00 2001 From: Andrii Kasian Date: Fri, 3 Jun 2016 17:33:34 +0300 Subject: [PATCH 248/345] MAGETWO-53530: Performance of category pages significantly degrade when having around 3000 products or more in category --- .../Magento/Framework/Api/Search/Document.php | 13 ++----- .../Magento/Framework/App/Request/Http.php | 14 +++---- .../Search/Adapter/Mysql/DocumentFactory.php | 38 +++++++++++-------- .../Test/Unit/SearchResponseBuilderTest.php | 36 +----------------- 4 files changed, 35 insertions(+), 66 deletions(-) diff --git a/lib/internal/Magento/Framework/Api/Search/Document.php b/lib/internal/Magento/Framework/Api/Search/Document.php index 3076b909e31d0..db8456622f531 100644 --- a/lib/internal/Magento/Framework/Api/Search/Document.php +++ b/lib/internal/Magento/Framework/Api/Search/Document.php @@ -30,7 +30,9 @@ public function setId($id) */ public function getCustomAttribute($attributeCode) { - return isset($this->_data[self::CUSTOM_ATTRIBUTES][$attributeCode]) ? $this->_data[self::CUSTOM_ATTRIBUTES][$attributeCode] : null; + return isset($this->_data[self::CUSTOM_ATTRIBUTES][$attributeCode]) + ? $this->_data[self::CUSTOM_ATTRIBUTES][$attributeCode] + : null; } /** @@ -42,13 +44,6 @@ public function setCustomAttribute($attributeCode, $attributeValue) $attributes = $this->getCustomAttributes(); $attributes[$attributeCode] = $attributeValue; return $this->setCustomAttributes($attributes); -/* - $attributes = is_array($this->getCustomAttributes()) ? $this->getCustomAttributes() : []; - $attribute = (array_key_exists($attributeCode, $attributes)) ? - $attributes[$attributeCode] : $this->attributeValueFactory->create()->setAttributeCode($attributeCode); - $attribute->setValue($attributeValue); - $attributes[$attributeCode] = $attribute; - return $this->setCustomAttributes($attributes);*/ } /** @@ -74,7 +69,7 @@ public function setCustomAttributes(array $attributes) */ public function getIterator() { - $attributes = is_array($this->getCustomAttributes()) ? $this->getCustomAttributes() : []; + $attributes = (array)$this->getCustomAttributes(); return new \ArrayIterator($attributes); } } diff --git a/lib/internal/Magento/Framework/App/Request/Http.php b/lib/internal/Magento/Framework/App/Request/Http.php index ff37c66e92f58..5d64ff84796a7 100644 --- a/lib/internal/Magento/Framework/App/Request/Http.php +++ b/lib/internal/Magento/Framework/App/Request/Http.php @@ -89,6 +89,11 @@ class Http extends Request implements RequestInterface, RequestSafetyInterface */ protected $safeRequestTypes = ['GET', 'HEAD', 'TRACE', 'OPTIONS']; + /** + * @var string + */ + private $distroBaseUrl; + /** * @param CookieReaderInterface $cookieReader * @param StringUtils $converter @@ -313,8 +318,8 @@ public function isAjax() * * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ - public function getDistroBaseUrl() - { + public function getDistroBaseUrl() + { if ($this->distroBaseUrl) { return $this->distroBaseUrl; } @@ -340,11 +345,6 @@ public function getDistroBaseUrl() return 'http://localhost/'; } - /** - * @var string - */ - private $distroBaseUrl; - /** * Determines a base URL path from environment * diff --git a/lib/internal/Magento/Framework/Search/Adapter/Mysql/DocumentFactory.php b/lib/internal/Magento/Framework/Search/Adapter/Mysql/DocumentFactory.php index e5255486e8df3..80e1ab8c9d99a 100644 --- a/lib/internal/Magento/Framework/Search/Adapter/Mysql/DocumentFactory.php +++ b/lib/internal/Magento/Framework/Search/Adapter/Mysql/DocumentFactory.php @@ -5,6 +5,12 @@ */ namespace Magento\Framework\Search\Adapter\Mysql; +use Magento\Framework\Api\AttributeInterface; +use Magento\Framework\Api\AttributeValue; +use Magento\Framework\Api\CustomAttributesDataInterface; +use Magento\Framework\Api\Search\Document; +use Magento\Framework\Api\Search\DocumentInterface; + /** * Document Factory */ @@ -25,6 +31,7 @@ class DocumentFactory /** * @var \Magento\Framework\Api\AttributeValueFactory + * @deprecated */ private $attributeValueFactory; @@ -34,12 +41,10 @@ class DocumentFactory */ public function __construct( \Magento\Framework\ObjectManagerInterface $objectManager, - \Magento\Framework\Search\EntityMetadata $entityMetadata -// \Magento\Framework\Api\AttributeValueFactory $attributeValueFactory + \Magento\Framework\Search\EntityMetadata $entityMetadata, + \Magento\Framework\Api\AttributeValueFactory $attributeValueFactory ) { - $this->objectManager = $objectManager; $this->entityMetadata = $entityMetadata; -// $this->attributeValueFactory = $attributeValueFactory; } /** @@ -51,23 +56,26 @@ public function __construct( public function create($rawDocument) { $documentId = null; - $entityId = $this->entityMetadata->getEntityId(); - $attributes = []; + $entityId = $this->entityMetadata->getEntityId(); + $attributes = []; foreach ($rawDocument as $rawField) { $fieldName = $rawField['name']; if ($fieldName === $entityId) { $documentId = $rawField['value']; } else { - $attributes[$fieldName] = new \Magento\Framework\Api\AttributeValue([ - \Magento\Framework\Api\AttributeInterface::ATTRIBUTE_CODE => $fieldName, - \Magento\Framework\Api\AttributeInterface::VALUE => $rawField['value'] - ]); - //$this->attributeValueFactory->create() + $attributes[$fieldName] = new AttributeValue( + [ + AttributeInterface::ATTRIBUTE_CODE => $fieldName, + AttributeInterface::VALUE => $rawField['value'], + ] + ); } } - return new \Magento\Framework\Api\Search\Document([ - \Magento\Framework\Api\Search\DocumentInterface::ID => $documentId, - \Magento\Framework\Api\CustomAttributesDataInterface::CUSTOM_ATTRIBUTES => $attributes - ]); + return new Document( + [ + DocumentInterface::ID => $documentId, + CustomAttributesDataInterface::CUSTOM_ATTRIBUTES => $attributes, + ] + ); } } diff --git a/lib/internal/Magento/Framework/Search/Test/Unit/SearchResponseBuilderTest.php b/lib/internal/Magento/Framework/Search/Test/Unit/SearchResponseBuilderTest.php index 6cd5962052af6..01315fd98ec36 100644 --- a/lib/internal/Magento/Framework/Search/Test/Unit/SearchResponseBuilderTest.php +++ b/lib/internal/Magento/Framework/Search/Test/Unit/SearchResponseBuilderTest.php @@ -37,31 +37,17 @@ protected function setUp() ->getMock(); $this->model = (new ObjectManager($this))->getObject('Magento\Framework\Search\SearchResponseBuilder', [ - 'documentFactory' => $this->documentFactory, 'searchResultFactory' => $this->searchResultFactory, ]); } public function testBuild() { - $documentId = 333; - $fieldName = 'fieldName'; - $fieldValue = 'fieldValue'; $aggregations = ['aggregations']; $document = $this->getMockBuilder('Magento\Framework\Api\Search\DocumentInterface') ->disableOriginalConstructor() ->getMockForAbstractClass(); - $document->expects($this->once()) - ->method('setCustomAttribute') - ->with($fieldName, $fieldValue); - $document->expects($this->once()) - ->method('setId') - ->with($documentId); - - $this->documentFactory->expects($this->once()) - ->method('create') - ->willReturn($document); /** @var SearchResultInterface|\PHPUnit_Framework_MockObject_MockObject $searchResult */ $searchResult = $this->getMockBuilder('Magento\Framework\Api\Search\SearchResultInterface') @@ -78,26 +64,6 @@ public function testBuild() ->method('create') ->willReturn($searchResult); - $field = $this->getMockBuilder('Magento\Framework\Search\DocumentField') - ->disableOriginalConstructor() - ->getMock(); - $field->expects($this->once()) - ->method('getName') - ->willReturn($fieldName); - $field->expects($this->once()) - ->method('getValue') - ->willReturn($fieldValue); - - $responseDocument = $this->getMockBuilder('Magento\Framework\Search\Document') - ->disableOriginalConstructor() - ->getMock(); - $responseDocument->expects($this->any()) - ->method('getIterator') - ->willReturn(new \ArrayIterator([$field])); - $responseDocument->expects($this->once()) - ->method('getId') - ->willReturn($documentId); - /** @var QueryResponse|\PHPUnit_Framework_MockObject_MockObject $response */ $response = $this->getMockBuilder('Magento\Framework\Search\Response\QueryResponse') ->setMethods(['getIterator', 'getAggregations']) @@ -105,7 +71,7 @@ public function testBuild() ->getMockForAbstractClass(); $response->expects($this->any()) ->method('getIterator') - ->willReturn(new \ArrayIterator([$responseDocument])); + ->willReturn(new \ArrayIterator([$document])); $response->expects($this->once()) ->method('getAggregations') ->willReturn($aggregations); From 9417c88bb4c4dfe534c913f37348a22c799a5336 Mon Sep 17 00:00:00 2001 From: Maksym Aposov Date: Sat, 4 Jun 2016 13:25:43 +0300 Subject: [PATCH 249/345] MAGETWO-53530: Performance of category pages significantly degrade when having around 3000 products or more in category --- .../Layer/Filter/Price/AlgorithmBaseTest.php | 2 +- .../Search/Adapter/Mysql/AdapterTest.php | 2 +- .../Test/Legacy/_files/obsolete_classes.php | 2 + .../Search/Adapter/Mysql/DocumentFactory.php | 20 ++--- .../Search/Adapter/Mysql/ResponseFactory.php | 50 +----------- .../Search/Adapter/Mysql/TemporaryStorage.php | 13 +-- .../Magento/Framework/Search/Document.php | 80 ------------------- .../Framework/Search/DocumentField.php | 13 --- .../Search/Response/QueryResponse.php | 2 +- .../Adapter/Mysql/TemporaryStorageTest.php | 10 +-- .../Search/Test/Unit/DocumentTest.php | 64 --------------- .../Test/Unit/Response/QueryResponseTest.php | 4 +- 12 files changed, 23 insertions(+), 239 deletions(-) delete mode 100644 lib/internal/Magento/Framework/Search/Document.php delete mode 100644 lib/internal/Magento/Framework/Search/DocumentField.php delete mode 100644 lib/internal/Magento/Framework/Search/Test/Unit/DocumentTest.php diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/Price/AlgorithmBaseTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/Price/AlgorithmBaseTest.php index 19f37e2a6233a..3509e213179a4 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/Price/AlgorithmBaseTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/Price/AlgorithmBaseTest.php @@ -67,7 +67,7 @@ public function testPricesSegmentation($categoryId, array $entityIds, array $int ['entityMetadata' => $entityMetadata] ); - /** @var \Magento\Framework\Search\Document[] $documents */ + /** @var \Magento\Framework\Api\Search\Document[] $documents */ $documents = []; foreach ($entityIds as $entityId) { $rawDocument = [ diff --git a/dev/tests/integration/testsuite/Magento/Framework/Search/Adapter/Mysql/AdapterTest.php b/dev/tests/integration/testsuite/Magento/Framework/Search/Adapter/Mysql/AdapterTest.php index fda3851989ea8..a28ccfe7c0387 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Search/Adapter/Mysql/AdapterTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Search/Adapter/Mysql/AdapterTest.php @@ -110,7 +110,7 @@ private function assertProductIds($queryResponse, $expectedIds) { $actualIds = []; foreach ($queryResponse as $document) { - /** @var \Magento\Framework\Search\Document $document */ + /** @var \Magento\Framework\Api\Search\Document $document */ $actualIds[] = $document->getId(); } sort($actualIds); diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php index d6456a44a8d18..6184dd7ee4355 100755 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php @@ -4223,4 +4223,6 @@ ['Magento\Braintree\Test\Unit\Observer\ProcessBraintreePaymentTest'], ['Magento\Catalog\Model\Webapi\Product\Option\Type\File\Validator'], ['Magento\Catalog\Test\Unit\Webapi\Product\Option\Type\File\ValidatorTest'], + ['Magento\Framework\Search\Document', 'Magento\Framework\Api\Search\Document'], + ['Magento\Framework\Search\DocumentField'], ]; diff --git a/lib/internal/Magento/Framework/Search/Adapter/Mysql/DocumentFactory.php b/lib/internal/Magento/Framework/Search/Adapter/Mysql/DocumentFactory.php index 80e1ab8c9d99a..df42980ae1761 100644 --- a/lib/internal/Magento/Framework/Search/Adapter/Mysql/DocumentFactory.php +++ b/lib/internal/Magento/Framework/Search/Adapter/Mysql/DocumentFactory.php @@ -29,20 +29,14 @@ class DocumentFactory */ private $entityMetadata; - /** - * @var \Magento\Framework\Api\AttributeValueFactory - * @deprecated - */ - private $attributeValueFactory; - /** * @param \Magento\Framework\ObjectManagerInterface $objectManager * @param \Magento\Framework\Search\EntityMetadata $entityMetadata + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function __construct( \Magento\Framework\ObjectManagerInterface $objectManager, - \Magento\Framework\Search\EntityMetadata $entityMetadata, - \Magento\Framework\Api\AttributeValueFactory $attributeValueFactory + \Magento\Framework\Search\EntityMetadata $entityMetadata ) { $this->entityMetadata = $entityMetadata; } @@ -51,26 +45,26 @@ public function __construct( * Create Search Document instance * * @param mixed $rawDocument - * @return \Magento\Framework\Search\Document + * @return \Magento\Framework\Api\Search\Document */ public function create($rawDocument) { $documentId = null; $entityId = $this->entityMetadata->getEntityId(); $attributes = []; - foreach ($rawDocument as $rawField) { - $fieldName = $rawField['name']; + foreach ($rawDocument as $fieldName => $value) { if ($fieldName === $entityId) { - $documentId = $rawField['value']; + $documentId = $value; } else { $attributes[$fieldName] = new AttributeValue( [ AttributeInterface::ATTRIBUTE_CODE => $fieldName, - AttributeInterface::VALUE => $rawField['value'], + AttributeInterface::VALUE => $value, ] ); } } + return new Document( [ DocumentInterface::ID => $documentId, diff --git a/lib/internal/Magento/Framework/Search/Adapter/Mysql/ResponseFactory.php b/lib/internal/Magento/Framework/Search/Adapter/Mysql/ResponseFactory.php index 369e79fd2da2c..c8901b8c3f181 100644 --- a/lib/internal/Magento/Framework/Search/Adapter/Mysql/ResponseFactory.php +++ b/lib/internal/Magento/Framework/Search/Adapter/Mysql/ResponseFactory.php @@ -54,10 +54,9 @@ public function __construct( */ public function create($rawResponse) { - $rawResponse = $this->prepareData($rawResponse); $documents = []; foreach ($rawResponse['documents'] as $rawDocument) { - /** @var \Magento\Framework\Search\Document[] $documents */ + /** @var \Magento\Framework\Api\Search\Document[] $documents */ $documents[] = $this->documentFactory->create($rawDocument); } /** @var \Magento\Framework\Search\Response\Aggregation $aggregations */ @@ -70,51 +69,4 @@ public function create($rawResponse) ] ); } - - /** - * Preparing - * - * @param array $rawResponse - * @return array - */ - private function prepareData(array $rawResponse) - { - $preparedResponse = []; - $preparedResponse['documents'] = $this->prepareDocuments($rawResponse['documents']); - $preparedResponse['aggregations'] = $this->prepareAggregations($rawResponse['aggregations']); - return $preparedResponse; - } - - /** - * Prepare Documents - * - * @param array $rawDocumentList - * @return array - */ - private function prepareDocuments(array $rawDocumentList) - { - $documentList = []; - foreach ($rawDocumentList as $document) { - $documentFieldList = []; - foreach ($document as $name => $values) { - $documentFieldList[] = [ - 'name' => $name, - 'value' => $values, - ]; - } - $documentList[] = $documentFieldList; - } - return $documentList; - } - - /** - * Prepare Aggregations - * - * @param array $rawAggregations - * @return array - */ - private function prepareAggregations(array $rawAggregations) - { - return $rawAggregations; // Prepare aggregations here - } } diff --git a/lib/internal/Magento/Framework/Search/Adapter/Mysql/TemporaryStorage.php b/lib/internal/Magento/Framework/Search/Adapter/Mysql/TemporaryStorage.php index ff3d40b29debb..10e2557357c12 100644 --- a/lib/internal/Magento/Framework/Search/Adapter/Mysql/TemporaryStorage.php +++ b/lib/internal/Magento/Framework/Search/Adapter/Mysql/TemporaryStorage.php @@ -33,20 +33,13 @@ public function __construct(\Magento\Framework\App\ResourceConnection $resource) /** * Stores Documents * - * @param \ArrayIterator|\Magento\Framework\Search\Document[] $documents + * @param \Magento\Framework\Api\Search\DocumentInterface[] $documents * @return Table + * @deprecated */ public function storeDocuments($documents) { - $data = []; - foreach ($documents as $document) { - $data[] = [ - $document->getId(), - $document->getField('score')->getValue(), - ]; - } - - return $this->populateTemporaryTable($this->createTemporaryTable(), $data); + return $this->storeApiDocuments($documents); } /** diff --git a/lib/internal/Magento/Framework/Search/Document.php b/lib/internal/Magento/Framework/Search/Document.php deleted file mode 100644 index 8a4a2dddaefae..0000000000000 --- a/lib/internal/Magento/Framework/Search/Document.php +++ /dev/null @@ -1,80 +0,0 @@ -documentId = $documentId; - $this->documentFields = $documentFields; - } - - /** - * Implementation of \IteratorAggregate::getIterator() - * - * @return \ArrayIterator - */ - public function getIterator() - { - return new \ArrayIterator($this->documentFields); - } - - /** - * Get Document field - * - * @param string $fieldName - * @return DocumentField - */ - public function getField($fieldName) - { - return array_key_exists($fieldName, $this->documentFields) ? $this->documentFields[$fieldName] : $fieldName; - } - - /** - * Get Document field names - * - * @return array - */ - public function getFieldNames() - { - return array_keys($this->documentFields); - } - - /** - * Get Document Id - * - * @return int - * @codeCoverageIgnore - */ - public function getId() - { - return $this->documentId; - } -} diff --git a/lib/internal/Magento/Framework/Search/DocumentField.php b/lib/internal/Magento/Framework/Search/DocumentField.php deleted file mode 100644 index 796a39968c9c8..0000000000000 --- a/lib/internal/Magento/Framework/Search/DocumentField.php +++ /dev/null @@ -1,13 +0,0 @@ -getMockBuilder('Magento\Framework\Search\DocumentField') + $attributeValue = $this->getMockBuilder('Magento\Framework\Api\AttributeValue') ->disableOriginalConstructor() ->getMock(); - $documentField->expects($this->once()) + $attributeValue->expects($this->once()) ->method('getValue') ->willReturn($documentValue); - $document = $this->getMockBuilder('Magento\Framework\Search\Document') + $document = $this->getMockBuilder('Magento\Framework\Api\Search\Document') ->disableOriginalConstructor() ->getMock(); $document->expects($this->once()) ->method('getId') ->willReturn($documentId); $document->expects($this->once()) - ->method('getField') + ->method('getCustomAttribute') ->with('score') - ->willReturn($documentField); + ->willReturn($attributeValue); $table = $this->createTemporaryTable(); diff --git a/lib/internal/Magento/Framework/Search/Test/Unit/DocumentTest.php b/lib/internal/Magento/Framework/Search/Test/Unit/DocumentTest.php deleted file mode 100644 index b195b33998636..0000000000000 --- a/lib/internal/Magento/Framework/Search/Test/Unit/DocumentTest.php +++ /dev/null @@ -1,64 +0,0 @@ -getMockBuilder('Magento\Framework\Search\DocumentField') - ->disableOriginalConstructor() - ->getMock(); - - $field->expects($this->any())->method('getName')->will($this->returnValue("$count")); - $field->expects($this->any())->method('getValue')->will($this->returnValue($count)); - $documentFields[] = $field; - } - - $this->document = $helper->getObject( - 'Magento\Framework\Search\Document', - [ - 'documentId' => 42, - 'documentFields' => $documentFields, - ] - ); - } - - public function testGetIterator() - { - $count = 0; - foreach ($this->document as $field) { - $this->assertEquals($field->getName(), "$count"); - $this->assertEquals($field->getValue(), $count); - $count++; - } - } - - public function testGetFieldNames() - { - $this->assertEquals( - $this->document->getFieldNames(), - ['0', '1', '2', '3', '4'] - ); - } - - public function testGetField() - { - $field = $this->document->getField('3'); - $this->assertEquals($field->getValue(), 3); - } -} diff --git a/lib/internal/Magento/Framework/Search/Test/Unit/Response/QueryResponseTest.php b/lib/internal/Magento/Framework/Search/Test/Unit/Response/QueryResponseTest.php index 6c623d3888b93..725dc53f33cdd 100644 --- a/lib/internal/Magento/Framework/Search/Test/Unit/Response/QueryResponseTest.php +++ b/lib/internal/Magento/Framework/Search/Test/Unit/Response/QueryResponseTest.php @@ -10,7 +10,7 @@ class QueryResponseTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Framework\Search\Document[] + * @var \Magento\Framework\Api\Search\Document[] */ private $documents = []; @@ -29,7 +29,7 @@ protected function setUp() $helper = new ObjectManager($this); for ($count = 0; $count < 5; $count++) { - $document = $this->getMockBuilder('Magento\Framework\Search\Document') + $document = $this->getMockBuilder('Magento\Framework\Api\Search\Document') ->disableOriginalConstructor() ->getMock(); From 39cf38e0a9ed231c5da242ea8f20b3225c3ef0af Mon Sep 17 00:00:00 2001 From: Maksym Aposov Date: Sat, 4 Jun 2016 13:41:19 +0300 Subject: [PATCH 250/345] MAGETWO-53530: Performance of category pages significantly degrade when having around 3000 products or more in category --- .../Unit/Adapter/Mysql/ResponseFactoryTest.php | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/lib/internal/Magento/Framework/Search/Test/Unit/Adapter/Mysql/ResponseFactoryTest.php b/lib/internal/Magento/Framework/Search/Test/Unit/Adapter/Mysql/ResponseFactoryTest.php index a4abd04db8eb2..8961927652c2f 100644 --- a/lib/internal/Magento/Framework/Search/Test/Unit/Adapter/Mysql/ResponseFactoryTest.php +++ b/lib/internal/Magento/Framework/Search/Test/Unit/Adapter/Mysql/ResponseFactoryTest.php @@ -50,25 +50,12 @@ public function testCreate() ], 'aggregations' => [], ]; - $exceptedResponse = [ - 'documents' => [ - [ - ['name' => 'title', 'value' => 'oneTitle'], - ['name' => 'description', 'value' => 'oneDescription'], - ], - [ - ['name' => 'title', 'value' => 'twoTitle'], - ['name' => 'description', 'value' => 'twoDescription'], - ], - ], - 'aggregations' => [], - ]; $this->documentFactory->expects($this->at(0))->method('create') - ->with($this->equalTo($exceptedResponse['documents'][0])) + ->with($this->equalTo($rawResponse['documents'][0])) ->will($this->returnValue('document1')); $this->documentFactory->expects($this->at(1))->method('create') - ->with($exceptedResponse['documents'][1]) + ->with($rawResponse['documents'][1]) ->will($this->returnValue('document2')); $this->objectManager->expects($this->once())->method('create') From 2d13b1162f85947eced984b15edfec116d556f00 Mon Sep 17 00:00:00 2001 From: Maksym Aposov Date: Mon, 6 Jun 2016 11:04:00 +0300 Subject: [PATCH 251/345] MAGETWO-53530: Performance of category pages significantly degrade when having around 3000 products or more in category --- .../Magento/Framework/Search/Response/QueryResponse.php | 2 +- lib/internal/Magento/Framework/Search/ResponseInterface.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/Search/Response/QueryResponse.php b/lib/internal/Magento/Framework/Search/Response/QueryResponse.php index c25a2740069a6..4056e4bf17cee 100644 --- a/lib/internal/Magento/Framework/Search/Response/QueryResponse.php +++ b/lib/internal/Magento/Framework/Search/Response/QueryResponse.php @@ -12,7 +12,7 @@ /** * Search Response */ -class QueryResponse implements ResponseInterface, \Countable +class QueryResponse implements ResponseInterface { /** * Document Collection diff --git a/lib/internal/Magento/Framework/Search/ResponseInterface.php b/lib/internal/Magento/Framework/Search/ResponseInterface.php index 3c4b70b73d6ff..666354d767563 100644 --- a/lib/internal/Magento/Framework/Search/ResponseInterface.php +++ b/lib/internal/Magento/Framework/Search/ResponseInterface.php @@ -8,7 +8,7 @@ /** * Search Request */ -interface ResponseInterface extends \IteratorAggregate +interface ResponseInterface extends \IteratorAggregate, \Countable { /** * Return Aggregation Collection From 0446d91248224d7ea91b5b813a49859c97373e8a Mon Sep 17 00:00:00 2001 From: Maksym Aposov Date: Mon, 6 Jun 2016 13:48:03 +0300 Subject: [PATCH 252/345] MAGETWO-53530: Performance of category pages significantly degrade when having around 3000 products or more in category --- .../Model/Layer/Filter/Price/AlgorithmBaseTest.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/Price/AlgorithmBaseTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/Price/AlgorithmBaseTest.php index 3509e213179a4..89fae8a178351 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/Price/AlgorithmBaseTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/Price/AlgorithmBaseTest.php @@ -71,14 +71,8 @@ public function testPricesSegmentation($categoryId, array $entityIds, array $int $documents = []; foreach ($entityIds as $entityId) { $rawDocument = [ - [ - 'name' => $idKey, - 'value' => $entityId, - ], - [ - 'name' => 'score', - 'value' => 1, - ], + $idKey => $entityId, + 'score' => 1, ]; $documents[] = $documentFactory->create($rawDocument); } From f0ade7cee4fcb4038b7457b721e18116cded4d1a Mon Sep 17 00:00:00 2001 From: Roman Liukshyn Date: Wed, 8 Jun 2016 14:47:41 +0300 Subject: [PATCH 253/345] MAGETWO-53238: Vault Provider field contains Payflow Pro option in countries which don't have such solution - Fix functional tests for Vault --- .../Braintree/Test/Repository/ConfigData.xml | 12 ++++++------ .../Magento/Paypal/Test/Repository/ConfigData.xml | 12 ++++++------ .../Vault/Test/TestStep/UseSavedCreditCardStep.php | 2 +- .../Test/TestStep/UseVaultPaymentTokenStep.php | 14 +++++++++++--- 4 files changed, 24 insertions(+), 16 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/Repository/ConfigData.xml index 479bf2f7e3580..cc1e9b714fbe3 100644 --- a/dev/tests/functional/tests/app/Magento/Braintree/Test/Repository/ConfigData.xml +++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/Repository/ConfigData.xml @@ -191,19 +191,19 @@ - + payment 1 - Braintree - braintree + Yes + 1 - + payment 1 - Select vault provider - null + No + 0 diff --git a/dev/tests/functional/tests/app/Magento/Paypal/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Magento/Paypal/Test/Repository/ConfigData.xml index 790ab9cad5ae1..0706f45beeb4b 100644 --- a/dev/tests/functional/tests/app/Magento/Paypal/Test/Repository/ConfigData.xml +++ b/dev/tests/functional/tests/app/Magento/Paypal/Test/Repository/ConfigData.xml @@ -278,19 +278,19 @@ - + payment 1 - PayflowPro - payflowpro + Yes + 1 - + payment 1 - Select vault provider - null + No + 0 diff --git a/dev/tests/functional/tests/app/Magento/Vault/Test/TestStep/UseSavedCreditCardStep.php b/dev/tests/functional/tests/app/Magento/Vault/Test/TestStep/UseSavedCreditCardStep.php index 1139913f3ef26..c3b4ac238610b 100644 --- a/dev/tests/functional/tests/app/Magento/Vault/Test/TestStep/UseSavedCreditCardStep.php +++ b/dev/tests/functional/tests/app/Magento/Vault/Test/TestStep/UseSavedCreditCardStep.php @@ -46,7 +46,7 @@ public function __construct (CheckoutOnepage $checkoutOnepage, array $payment) */ public function run() { - $this->payment['method'] = 'vault_item_'; + $this->payment['method'] .= '_item_'; $this->checkoutOnepage->getPaymentBlock()->selectPaymentMethod($this->payment); } } diff --git a/dev/tests/functional/tests/app/Magento/Vault/Test/TestStep/UseVaultPaymentTokenStep.php b/dev/tests/functional/tests/app/Magento/Vault/Test/TestStep/UseVaultPaymentTokenStep.php index 56f94252c8f23..ad693923955d4 100644 --- a/dev/tests/functional/tests/app/Magento/Vault/Test/TestStep/UseVaultPaymentTokenStep.php +++ b/dev/tests/functional/tests/app/Magento/Vault/Test/TestStep/UseVaultPaymentTokenStep.php @@ -17,13 +17,20 @@ class UseVaultPaymentTokenStep implements TestStepInterface * @var OrderCreateIndex */ private $orderCreatePage; + + /** + * @var array + */ + private $payment; /** * @param OrderCreateIndex $orderCreateIndex + * @param array $payment */ - public function __construct(OrderCreateIndex $orderCreateIndex) + public function __construct(OrderCreateIndex $orderCreateIndex, array $payment) { $this->orderCreatePage = $orderCreateIndex; + $this->payment = $payment; } /** @@ -32,7 +39,8 @@ public function __construct(OrderCreateIndex $orderCreateIndex) public function run() { $block = $this->orderCreatePage->getCreateBlock(); - $block->selectPaymentMethod(['method' => 'vault']); - $block->selectVaultToken('token_switcher_'); + $this->payment['method'] .= '_cc_vault'; + $block->selectPaymentMethod($this->payment); + $block->selectVaultToken('token_switcher_' . $this->payment['method']); } } From 20b36dfa0cdba2ea413ae80c56ab659305a1a1d4 Mon Sep 17 00:00:00 2001 From: Ievgen Shakhsuvarov Date: Wed, 8 Jun 2016 15:58:02 +0300 Subject: [PATCH 254/345] MAGETWO-53293: Remove PHP 5.5 from supported versions --- composer.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.lock b/composer.lock index 6ca328e7f36cf..a3c12c6721b11 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "03aa0fd88ec1218fac917ab6ddebe520", - "content-hash": "4289e5ed7fb777b66c153e0187458241", + "hash": "4b506e9d5ccb146e8bc9ccd3faeaf326", + "content-hash": "55b9016c4626d466c655c75be44479d4", "packages": [ { "name": "braintree/braintree_php", @@ -4446,7 +4446,7 @@ "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": "~5.5.22|~5.6.0|~7.0.0", + "php": "~5.6.0|7.0.2|~7.0.6", "lib-libxml": "*", "ext-ctype": "*", "ext-gd": "*", From 1d6e9d87c06c32108202d97723aed891fcccf8aa Mon Sep 17 00:00:00 2001 From: Andrii Kasian Date: Wed, 8 Jun 2016 16:14:08 +0300 Subject: [PATCH 255/345] MAGETWO-54043: [GitHub] Dropdown attribute required even when selected #4899 --- .../Magento/Swatches/view/frontend/web/js/swatch-renderer.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js b/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js index 5135493c06494..dfd4b2bb2da0f 100644 --- a/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js +++ b/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js @@ -542,7 +542,10 @@ define([ */ _OnChange: function ($this, $widget) { var $parent = $this.parents('.' + $widget.options.classes.attributeClass), - $input = $parent.find('.' + $widget.options.classes.attributeInput); + attributeId = $parent.attr('attribute-id'), + $input = $widget.productForm.find( + '.' + $widget.options.classes.attributeInput + '[name="super_attribute[' + attributeId + ']"]' + ); if ($this.val() > 0) { $parent.attr('option-selected', $this.val()); From 64d7dfef8718ecb9be64807071360ac97f570862 Mon Sep 17 00:00:00 2001 From: Oleh Posyniak Date: Wed, 8 Jun 2016 16:34:18 +0300 Subject: [PATCH 256/345] MAGETWO-53223: [Github] Magento performance decreases significantly if Merge CSS Files = Yes #4710 --- .../Framework/View/Asset/MergeService.php | 7 +- .../View/Test/Unit/Asset/MergeServiceTest.php | 160 +++++++++--------- 2 files changed, 87 insertions(+), 80 deletions(-) diff --git a/lib/internal/Magento/Framework/View/Asset/MergeService.php b/lib/internal/Magento/Framework/View/Asset/MergeService.php index 4b288f365d514..1d4c41f699f88 100644 --- a/lib/internal/Magento/Framework/View/Asset/MergeService.php +++ b/lib/internal/Magento/Framework/View/Asset/MergeService.php @@ -79,11 +79,12 @@ public function getMergedAssets(array $assets, $contentType) $isCssMergeEnabled = $this->config->isMergeCssFiles(); $isJsMergeEnabled = $this->config->isMergeJsFiles(); if (($isCss && $isCssMergeEnabled) || ($isJs && $isJsMergeEnabled)) { + $mergeStrategyClass = \Magento\Framework\View\Asset\MergeStrategy\FileExists::class; + if ($this->state->getMode() === \Magento\Framework\App\State::MODE_DEVELOPER) { - $mergeStrategyClass = 'Magento\Framework\View\Asset\MergeStrategy\Checksum'; - } else { - $mergeStrategyClass = 'Magento\Framework\View\Asset\MergeStrategy\FileExists'; + $mergeStrategyClass = \Magento\Framework\View\Asset\MergeStrategy\Checksum::class; } + $mergeStrategy = $this->objectManager->get($mergeStrategyClass); $assets = $this->objectManager->create( diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Asset/MergeServiceTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Asset/MergeServiceTest.php index e1997d92ede8a..ebdb69bd67117 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Asset/MergeServiceTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Asset/MergeServiceTest.php @@ -5,65 +5,77 @@ */ namespace Magento\Framework\View\Test\Unit\Asset; +use Magento\Framework\App\State; +use Magento\Framework\Filesystem; +use Magento\Framework\ObjectManagerInterface; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Framework\View\Asset\AssetInterface; +use Magento\Framework\View\Asset\Merged; +use Magento\Framework\View\Asset\MergeService; +use Magento\Framework\View\Asset\ConfigInterface; +use Magento\Framework\View\Asset\MergeStrategy\Checksum; +use Magento\Framework\View\Asset\MergeStrategy\FileExists; + +/** + * Class MergeServiceTest + */ class MergeServiceTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Framework\View\Asset\MergeService + * @var MergeService */ - protected $_object; + private $object; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var ObjectManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ - protected $_objectManager; + private $objectManagerMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var ConfigInterface|\PHPUnit_Framework_MockObject_MockObject */ - protected $_config; + private $configMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var Filesystem|\PHPUnit_Framework_MockObject_MockObject */ - protected $_filesystem; + private $filesystemMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var Filesystem\Directory\Write|\PHPUnit_Framework_MockObject_MockObject */ - protected $_directory; + protected $directoryMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var State|\PHPUnit_Framework_MockObject_MockObject */ - protected $_state; + protected $stateMock; protected function setUp() { - $this->_objectManager = $this->getMock('Magento\Framework\ObjectManagerInterface'); - $this->_config = $this->getMock('Magento\Framework\View\Asset\ConfigInterface', [], [], '', false); - $this->_filesystem = $this->getMock('Magento\Framework\Filesystem', [], [], '', false); - $this->_directory = $this->getMock( - '\Magento\Framework\Filesystem\Directory\Write', - [], - [], - '', - false - ); - $this->_state = $this->getMock('Magento\Framework\App\State', [], [], '', false); - $this->_filesystem->expects( - $this->any() - )->method( - 'getDirectoryWrite' - )->will( - $this->returnValue($this->_directory) - ); - - $this->_object = new \Magento\Framework\View\Asset\MergeService( - $this->_objectManager, - $this->_config, - $this->_filesystem, - $this->_state - ); + $this->objectManagerMock = $this->getMockBuilder(ObjectManagerInterface::class) + ->getMockForAbstractClass(); + $this->configMock = $this->getMockBuilder(ConfigInterface::class) + ->getMockForAbstractClass(); + $this->filesystemMock = $this->getMockBuilder(Filesystem::class) + ->disableOriginalConstructor() + ->getMock(); + $this->directoryMock = $this->getMockBuilder(Filesystem\Directory\Write::class) + ->disableOriginalConstructor() + ->getMock(); + $this->stateMock = $this->getMockBuilder(State::class) + ->disableOriginalConstructor() + ->getMock(); + $this->filesystemMock->expects($this->any()) + ->method('getDirectoryWrite') + ->willReturn($this->directoryMock); + + $this->object = (new ObjectManager($this))->getObject(MergeService::class, [ + 'objectManager' => $this->objectManagerMock, + 'config' => $this->configMock, + 'filesystem' => $this->filesystemMock, + 'state' => $this->stateMock, + ]); } /** @@ -72,7 +84,7 @@ protected function setUp() */ public function testGetMergedAssetsWrongContentType() { - $this->_object->getMergedAssets([], 'unknown'); + $this->object->getMergedAssets([], 'unknown'); } /** @@ -84,34 +96,25 @@ public function testGetMergedAssetsWrongContentType() */ public function testGetMergedAssets(array $assets, $contentType, $appMode, $mergeStrategy) { - $mergedAsset = $this->getMock('Magento\Framework\View\Asset\AssetInterface'); - $this->_config->expects($this->once())->method('isMergeCssFiles')->will($this->returnValue(true)); - $this->_config->expects($this->once())->method('isMergeJsFiles')->will($this->returnValue(true)); - + $mergedAsset = $this->getMock(AssetInterface::class); $mergeStrategyMock = $this->getMock($mergeStrategy, [], [], '', false); - $this->_objectManager->expects( - $this->once() - )->method( - 'create' - )->with( - 'Magento\Framework\View\Asset\Merged', - ['assets' => $assets, 'mergeStrategy' => $mergeStrategyMock] - )->will( - $this->returnValue($mergedAsset) - ); - - $this->_objectManager->expects( - $this->once() - )->method( - 'get' - )->with( - $mergeStrategy - )->will( - $this->returnValue($mergeStrategyMock) - ); - $this->_state->expects($this->once())->method('getMode')->will($this->returnValue($appMode)); - $this->assertSame($mergedAsset, $this->_object->getMergedAssets($assets, $contentType)); + $this->configMock->expects($this->once())->method('isMergeCssFiles')->willReturn(true); + $this->configMock->expects($this->once())->method('isMergeJsFiles')->willReturn(true); + + $this->objectManagerMock->expects($this->once()) + ->method('create') + ->with(Merged::class, ['assets' => $assets, 'mergeStrategy' => $mergeStrategyMock]) + ->willReturn($mergedAsset); + $this->objectManagerMock->expects($this->once()) + ->method('get') + ->with($mergeStrategy) + ->willReturn($mergeStrategyMock); + $this->stateMock->expects($this->once()) + ->method('getMode') + ->willReturn($appMode); + + $this->assertSame($mergedAsset, $this->object->getMergedAssets($assets, $contentType)); } public static function getMergedAssetsDataProvider() @@ -128,38 +131,38 @@ public static function getMergedAssetsDataProvider() 'js production mode' => [ $jsAssets, 'js', - \Magento\Framework\App\State::MODE_PRODUCTION, - 'Magento\Framework\View\Asset\MergeStrategy\FileExists', + State::MODE_PRODUCTION, + FileExists::class, ], 'css production mode' => [ $cssAssets, 'css', - \Magento\Framework\App\State::MODE_PRODUCTION, - 'Magento\Framework\View\Asset\MergeStrategy\FileExists', + State::MODE_PRODUCTION, + FileExists::class, ], 'js default mode' => [ $jsAssets, 'js', - \Magento\Framework\App\State::MODE_DEFAULT, - 'Magento\Framework\View\Asset\MergeStrategy\FileExists', + State::MODE_DEFAULT, + FileExists::class, ], 'css default mode' => [ $cssAssets, 'js', - \Magento\Framework\App\State::MODE_DEFAULT, - 'Magento\Framework\View\Asset\MergeStrategy\FileExists', + State::MODE_DEFAULT, + FileExists::class, ], 'js developer mode' => [ $jsAssets, 'js', - \Magento\Framework\App\State::MODE_DEVELOPER, - 'Magento\Framework\View\Asset\MergeStrategy\Checksum', + State::MODE_DEVELOPER, + Checksum::class, ], 'css developer mode' => [ $cssAssets, 'css', \Magento\Framework\App\State::MODE_DEVELOPER, - 'Magento\Framework\View\Asset\MergeStrategy\Checksum', + Checksum::class, ] ]; } @@ -167,8 +170,11 @@ public static function getMergedAssetsDataProvider() public function testCleanMergedJsCss() { $mergedDir = \Magento\Framework\View\Asset\Merged::getRelativeDir(); - $this->_directory->expects($this->once())->method('delete')->with($mergedDir); - $this->_object->cleanMergedJsCss(); + $this->directoryMock->expects($this->once()) + ->method('delete') + ->with($mergedDir); + + $this->object->cleanMergedJsCss(); } } From 2f9ccf08f7a1b50762a089c905644ead9f97f10f Mon Sep 17 00:00:00 2001 From: Ankur Kaneria Date: Wed, 8 Jun 2016 13:39:32 -0500 Subject: [PATCH 257/345] MAGETWO-51929: [Github] [Deferred for 2.1 GA] Web Setup Wizard does not work when Magento is installed in pub #4159 - Updates based on review comments - Moved MenuBuilder plugin to adminhtml/di.xml - Updated DocRootLocator logic to look for "/pub" at the end of the base path --- app/code/Magento/Backend/etc/adminhtml/di.xml | 3 +++ app/code/Magento/Backend/etc/di.xml | 3 --- lib/internal/Magento/Framework/App/DocRootLocator.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Backend/etc/adminhtml/di.xml b/app/code/Magento/Backend/etc/adminhtml/di.xml index fa327f645eb81..fcf2cc02e9fb9 100644 --- a/app/code/Magento/Backend/etc/adminhtml/di.xml +++ b/app/code/Magento/Backend/etc/adminhtml/di.xml @@ -138,4 +138,7 @@ false + + + diff --git a/app/code/Magento/Backend/etc/di.xml b/app/code/Magento/Backend/etc/di.xml index 9b282a65a479d..7307bbe09f1b4 100644 --- a/app/code/Magento/Backend/etc/di.xml +++ b/app/code/Magento/Backend/etc/di.xml @@ -214,7 +214,4 @@ - - - diff --git a/lib/internal/Magento/Framework/App/DocRootLocator.php b/lib/internal/Magento/Framework/App/DocRootLocator.php index 39d40a6f1a00e..23be6997202b0 100644 --- a/lib/internal/Magento/Framework/App/DocRootLocator.php +++ b/lib/internal/Magento/Framework/App/DocRootLocator.php @@ -43,6 +43,6 @@ public function isPub() { $rootBasePath = $this->request->getServer('DOCUMENT_ROOT'); $readDirectory = $this->readFactory->create(DirectoryList::ROOT); - return strpos($rootBasePath, 'pub') && !$readDirectory->isExist($rootBasePath . 'setup'); + return (substr($rootBasePath, -strlen('/pub')) === '/pub') && !$readDirectory->isExist($rootBasePath . 'setup'); } } From 4c9841e743f111261c824e5fc06340241d4344f5 Mon Sep 17 00:00:00 2001 From: Ankur Kaneria Date: Wed, 8 Jun 2016 13:52:53 -0500 Subject: [PATCH 258/345] MAGETWO-53474: [Github] Caches Aren't Enabled by Default on RC1 with Composer when Upgrading via CLI - Update based on review. - Added returned error code to logged message. --- setup/src/Magento/Setup/Console/Command/UpgradeCommand.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php b/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php index d5e330c551ec3..17d86ef9bad58 100644 --- a/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php +++ b/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php @@ -127,7 +127,8 @@ private function enableCaches($objectManager, $output) $write->delete($pathToCacheStatus); if (isset($returnCode) && $returnCode > 0) { - $output->writeln(' Error occured during upgrade'); + $message = ' Error occured during upgrade. Error code: ' . $returnCode . ''; + $output->writeln($message); return \Magento\Framework\Console\Cli::RETURN_FAILURE; } } From 7ce6a1537b08d8e7547d77f746baa3ca12964c5f Mon Sep 17 00:00:00 2001 From: Igor Melnikov Date: Wed, 8 Jun 2016 18:00:49 -0500 Subject: [PATCH 259/345] MAGETWO-54078: Remove @deprecated annotation from save, delete, load methods in AbstractModel Removing @deprecated annotation --- lib/internal/Magento/Framework/Model/AbstractModel.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/internal/Magento/Framework/Model/AbstractModel.php b/lib/internal/Magento/Framework/Model/AbstractModel.php index f100b488652ac..0c0dabaec456b 100644 --- a/lib/internal/Magento/Framework/Model/AbstractModel.php +++ b/lib/internal/Magento/Framework/Model/AbstractModel.php @@ -520,7 +520,6 @@ public function getCollection() /** * Load object data * - * @deprecated * @param integer $modelId * @param null|string $field * @return $this @@ -622,7 +621,6 @@ public function setHasDataChanges($flag) /** * Save object data * - * @deprecated * @return $this * @throws \Exception */ @@ -807,7 +805,6 @@ public function afterSave() /** * Delete object from database * - * @deprecated * @return $this * @throws \Exception */ From e2c2267e8c024417dff1008f96412362f21ef0a1 Mon Sep 17 00:00:00 2001 From: Ievgen Shakhsuvarov Date: Thu, 9 Jun 2016 13:26:17 +0300 Subject: [PATCH 260/345] MAGETWO-53293: Remove PHP 5.5 from supported versions --- lib/internal/Magento/Framework/Filter/Input.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/internal/Magento/Framework/Filter/Input.php b/lib/internal/Magento/Framework/Filter/Input.php index c85bbc7231664..fe16605580bb4 100644 --- a/lib/internal/Magento/Framework/Filter/Input.php +++ b/lib/internal/Magento/Framework/Filter/Input.php @@ -343,13 +343,13 @@ protected function _createNativeZendFilter($filterData) $filter = $filterData['zend']; if (is_string($filter)) { $filterClassName = 'Zend_Filter_' . ucfirst($filter); + if (!is_a($filterClassName, \Zend_Filter_Interface::class, true)) { + throw new \Exception('Filter is not instance of \Zend_Filter_Interface'); + } $filterClassOptions = isset($filterData['args']) ? $filterData['args'] : []; $filter = new $filterClassName(...array_values($filterClassOptions)); } - - if (!$filter instanceof \Zend_Filter_Interface) { - throw new \Exception('Filter is not instance of \Zend_Filter_Interface'); - } + return $filter; } } From 1a5286d95cdd216d19818248145815ab8ddfb0d5 Mon Sep 17 00:00:00 2001 From: Andrii Kasian Date: Thu, 9 Jun 2016 16:52:11 +0300 Subject: [PATCH 261/345] MAGETWO-52124: Simple product special price lost if use it in grouped product --- .../Model/Product/Type/Grouped.php | 2 +- .../Pricing/Price/FinalPriceTest.php | 78 +++++++++++++++++++ 2 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 dev/tests/integration/testsuite/Magento/GroupedProduct/Pricing/Price/FinalPriceTest.php diff --git a/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php b/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php index 3080145bfcb09..02ff894df7c1f 100644 --- a/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php +++ b/app/code/Magento/GroupedProduct/Model/Product/Type/Grouped.php @@ -202,7 +202,7 @@ public function getAssociatedProducts($product) $collection = $this->getAssociatedProductCollection( $product )->addAttributeToSelect( - ['name', 'price'] + ['name', 'price', 'special_price', 'special_from_date', 'special_to_date'] )->addFilterByRequiredOptions()->setPositionOrder()->addStoreFilter( $this->getStoreFilter($product) )->addAttributeToFilter( diff --git a/dev/tests/integration/testsuite/Magento/GroupedProduct/Pricing/Price/FinalPriceTest.php b/dev/tests/integration/testsuite/Magento/GroupedProduct/Pricing/Price/FinalPriceTest.php new file mode 100644 index 0000000000000..ca26e5288ae7b --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/GroupedProduct/Pricing/Price/FinalPriceTest.php @@ -0,0 +1,78 @@ +get('\Magento\Catalog\Api\ProductRepositoryInterface'); + /** @var $product \Magento\Catalog\Model\Product */ + $product = $productRepository->get('grouped-product'); + + $this->assertEquals(10, $product->getPriceInfo()->getPrice(FinalPrice::PRICE_CODE)->getValue()); + } + + /** + * @magentoDataFixture Magento/GroupedProduct/_files/product_grouped.php + * @magentoAppIsolation enabled + */ + public function testFinalPriceWithTearPrice() + { + $productRepository = Bootstrap::getObjectManager() + ->get('\Magento\Catalog\Api\ProductRepositoryInterface'); + /** @var ProductTierPriceInterface $tierPrice */ + $tierPrice = Bootstrap::getObjectManager()->create(ProductTierPriceInterface::class); + $tierPrice->setQty(1); + $tierPrice->setCustomerGroupId(\Magento\Customer\Model\GroupManagement::CUST_GROUP_ALL); + $tierPrice->setValue(5); + + + /** @var $simpleProduct \Magento\Catalog\Api\Data\ProductInterface */ + $simpleProduct = $productRepository->get('simple'); + $simpleProduct->setTierPrices([ + $tierPrice + ]); + $productRepository->save($simpleProduct); + + + /** @var $product \Magento\Catalog\Model\Product */ + $product = $productRepository->get('grouped-product'); + $this->assertEquals(5, $product->getPriceInfo()->getPrice(FinalPrice::PRICE_CODE)->getValue()); + } + + /** + * @magentoDataFixture Magento/GroupedProduct/_files/product_grouped.php + * @magentoAppIsolation enabled + */ + public function testFinalPriceWithSpecialPrice() + { + $productRepository = Bootstrap::getObjectManager() + ->get('\Magento\Catalog\Api\ProductRepositoryInterface'); + + + + /** @var $simpleProduct \Magento\Catalog\Api\Data\ProductInterface */ + $simpleProduct = $productRepository->get('simple'); + $simpleProduct->setCustomAttribute('special_price', 6); + $productRepository->save($simpleProduct); + + + /** @var $product \Magento\Catalog\Model\Product */ + $product = $productRepository->get('grouped-product'); + $this->assertEquals(6, $product->getPriceInfo()->getPrice(FinalPrice::PRICE_CODE)->getValue()); + } +} From 5111c2ed6463d6b4e48d8d495433a71c8336a82b Mon Sep 17 00:00:00 2001 From: Andrii Kasian Date: Thu, 9 Jun 2016 17:08:50 +0300 Subject: [PATCH 262/345] MAGETWO-52124: Simple product special price lost if use it in grouped product --- .../GroupedProduct/Pricing/Price/FinalPriceTest.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/GroupedProduct/Pricing/Price/FinalPriceTest.php b/dev/tests/integration/testsuite/Magento/GroupedProduct/Pricing/Price/FinalPriceTest.php index ca26e5288ae7b..0fce2d53e1627 100644 --- a/dev/tests/integration/testsuite/Magento/GroupedProduct/Pricing/Price/FinalPriceTest.php +++ b/dev/tests/integration/testsuite/Magento/GroupedProduct/Pricing/Price/FinalPriceTest.php @@ -4,10 +4,9 @@ * See COPYING.txt for license details. */ -namespace testsuite\Magento\GroupedProduct\Pricing\Price; +namespace Magento\GroupedProduct\Pricing\Price; use Magento\Catalog\Api\Data\ProductTierPriceInterface; -use Magento\GroupedProduct\Pricing\Price\FinalPrice; use Magento\TestFramework\Helper\Bootstrap; class FinalPriceTest extends \PHPUnit_Framework_TestCase @@ -40,7 +39,6 @@ public function testFinalPriceWithTearPrice() $tierPrice->setCustomerGroupId(\Magento\Customer\Model\GroupManagement::CUST_GROUP_ALL); $tierPrice->setValue(5); - /** @var $simpleProduct \Magento\Catalog\Api\Data\ProductInterface */ $simpleProduct = $productRepository->get('simple'); $simpleProduct->setTierPrices([ @@ -48,7 +46,6 @@ public function testFinalPriceWithTearPrice() ]); $productRepository->save($simpleProduct); - /** @var $product \Magento\Catalog\Model\Product */ $product = $productRepository->get('grouped-product'); $this->assertEquals(5, $product->getPriceInfo()->getPrice(FinalPrice::PRICE_CODE)->getValue()); @@ -63,14 +60,11 @@ public function testFinalPriceWithSpecialPrice() $productRepository = Bootstrap::getObjectManager() ->get('\Magento\Catalog\Api\ProductRepositoryInterface'); - - /** @var $simpleProduct \Magento\Catalog\Api\Data\ProductInterface */ $simpleProduct = $productRepository->get('simple'); $simpleProduct->setCustomAttribute('special_price', 6); $productRepository->save($simpleProduct); - /** @var $product \Magento\Catalog\Model\Product */ $product = $productRepository->get('grouped-product'); $this->assertEquals(6, $product->getPriceInfo()->getPrice(FinalPrice::PRICE_CODE)->getValue()); From 3dc1d396948b80c46316de9b568997a7d8ca25d6 Mon Sep 17 00:00:00 2001 From: Ievgen Sentiabov Date: Thu, 9 Jun 2016 17:18:46 +0300 Subject: [PATCH 263/345] MAGETWO-53238: Vault Provider field contains Payflow Pro option in countries which don't have such solution - Set vault enabled as shared option --- .../Magento/Paypal/etc/adminhtml/system/paypal_payflowpro.xml | 1 + .../Model/Config/Structure/Reader/_files/expected/config.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/app/code/Magento/Paypal/etc/adminhtml/system/paypal_payflowpro.xml b/app/code/Magento/Paypal/etc/adminhtml/system/paypal_payflowpro.xml index 52ae27d80d7a3..2150d5dcb392b 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/system/paypal_payflowpro.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/system/paypal_payflowpro.xml @@ -84,6 +84,7 @@ Magento\Config\Model\Config\Source\Yesno payment/payflowpro_cc_vault/active + 1 diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Model/Config/Structure/Reader/_files/expected/config.xml b/dev/tests/integration/testsuite/Magento/Paypal/Model/Config/Structure/Reader/_files/expected/config.xml index 2e4c447ff83c1..61d9f6f2a475c 100644 --- a/dev/tests/integration/testsuite/Magento/Paypal/Model/Config/Structure/Reader/_files/expected/config.xml +++ b/dev/tests/integration/testsuite/Magento/Paypal/Model/Config/Structure/Reader/_files/expected/config.xml @@ -104,6 +104,7 @@ Magento\Config\Model\Config\Source\Yesno payment/payflowpro_cc_vault/active + 1 From abd173ad41a4ae11750627593b6c341419a6affb Mon Sep 17 00:00:00 2001 From: Roman Liukshyn Date: Thu, 9 Jun 2016 19:12:09 +0300 Subject: [PATCH 264/345] MAGETWO-53238: Vault Provider field contains Payflow Pro option in countries which don't have such solution --- .../Braintree/Test/Repository/ConfigData.xml | 4 +- .../TestCase/CreateVaultOrderBackendTest.xml | 2 +- .../TestCase/DeleteSavedCreditCardTest.xml | 26 -- .../Test/TestCase/UseVaultOnCheckoutTest.xml | 3 +- .../Payment/Test/Repository/CreditCard.xml | 7 + .../TestCase/DeleteSavedCreditCardTest.xml | 26 -- .../Test/TestCase/UseVaultOnCheckoutTest.xml | 2 +- .../TestCase/CreateVaultOrderBackendTest.php | 1 + .../TestCase/DeleteSavedCreditCardTest.php | 268 +++++++++++++++++- .../TestCase/DeleteSavedCreditCardTest.xml | 52 ++++ .../DeleteCreditCardFromMyAccountStep.php | 2 +- 11 files changed, 329 insertions(+), 64 deletions(-) delete mode 100644 dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/DeleteSavedCreditCardTest.xml delete mode 100644 dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/DeleteSavedCreditCardTest.xml create mode 100644 dev/tests/functional/tests/app/Magento/Vault/Test/TestCase/DeleteSavedCreditCardTest.xml diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/Repository/ConfigData.xml index cc1e9b714fbe3..916943e03af97 100644 --- a/dev/tests/functional/tests/app/Magento/Braintree/Test/Repository/ConfigData.xml +++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/Repository/ConfigData.xml @@ -191,7 +191,7 @@ - + payment 1 Yes @@ -199,7 +199,7 @@ - + payment 1 No diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateVaultOrderBackendTest.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateVaultOrderBackendTest.xml index 84b0a58433ca0..0ae7da744c2f4 100644 --- a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateVaultOrderBackendTest.xml +++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/CreateVaultOrderBackendTest.xml @@ -7,7 +7,7 @@ --> - + test_type:3rd_party_test catalogProductSimple::product_10_dollar default diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/DeleteSavedCreditCardTest.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/DeleteSavedCreditCardTest.xml deleted file mode 100644 index 0a3a7206175e2..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/DeleteSavedCreditCardTest.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - catalogProductSimple::product_10_dollar - default - US_address_1_without_email - login - Flat Rate - Fixed - braintree - credit_card_braintree - visa_braintree - Yes - braintree, braintree_use_vault - test_type:3rd_party_test - - - - diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/UseVaultOnCheckoutTest.xml b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/UseVaultOnCheckoutTest.xml index c9fc94be5ebae..cfe2e5f51b18e 100644 --- a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/UseVaultOnCheckoutTest.xml +++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/UseVaultOnCheckoutTest.xml @@ -7,7 +7,7 @@ --> - + Use saved for Braintree credit card on checkout catalogProductSimple::product_10_dollar default @@ -22,7 +22,6 @@ braintree, braintree_use_vault Processing test_type:3rd_party_test - Processing Back, Cancel, Send Email, Hold, Invoice, Ship diff --git a/dev/tests/functional/tests/app/Magento/Payment/Test/Repository/CreditCard.xml b/dev/tests/functional/tests/app/Magento/Payment/Test/Repository/CreditCard.xml index b5d754d8e2174..f6c93407a0ccd 100644 --- a/dev/tests/functional/tests/app/Magento/Payment/Test/Repository/CreditCard.xml +++ b/dev/tests/functional/tests/app/Magento/Payment/Test/Repository/CreditCard.xml @@ -14,6 +14,13 @@ 123 + + 378282246310005 + 02 - February + 2021 + 1234 + + 4617747819866651 01 - January diff --git a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/DeleteSavedCreditCardTest.xml b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/DeleteSavedCreditCardTest.xml deleted file mode 100644 index 42afe4fbb58f0..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/DeleteSavedCreditCardTest.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - catalogProductSimple::product_10_dollar - default - US_address_1_without_email - login - Flat Rate - Fixed - payflowpro - credit_card - visa_default - Yes - payflowpro, payflowpro_use_vault - test_type:3rd_party_test - - - - diff --git a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/UseVaultOnCheckoutTest.xml b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/UseVaultOnCheckoutTest.xml index ef66a1b419f27..ff5f151580b11 100644 --- a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/UseVaultOnCheckoutTest.xml +++ b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/UseVaultOnCheckoutTest.xml @@ -7,7 +7,7 @@ --> - + catalogProductSimple::product_10_dollar default US_address_1_without_email diff --git a/dev/tests/functional/tests/app/Magento/Vault/Test/TestCase/CreateVaultOrderBackendTest.php b/dev/tests/functional/tests/app/Magento/Vault/Test/TestCase/CreateVaultOrderBackendTest.php index 57fb2a998909e..37d0fdc81c5aa 100644 --- a/dev/tests/functional/tests/app/Magento/Vault/Test/TestCase/CreateVaultOrderBackendTest.php +++ b/dev/tests/functional/tests/app/Magento/Vault/Test/TestCase/CreateVaultOrderBackendTest.php @@ -31,6 +31,7 @@ * 16. Place order. * * @group Order_Management_(CS) + * @ZephyrId MAGETWO-48127, MAGETWO-48091 */ class CreateVaultOrderBackendTest extends Scenario { diff --git a/dev/tests/functional/tests/app/Magento/Vault/Test/TestCase/DeleteSavedCreditCardTest.php b/dev/tests/functional/tests/app/Magento/Vault/Test/TestCase/DeleteSavedCreditCardTest.php index 6964feb2533ed..433000c4cdd04 100644 --- a/dev/tests/functional/tests/app/Magento/Vault/Test/TestCase/DeleteSavedCreditCardTest.php +++ b/dev/tests/functional/tests/app/Magento/Vault/Test/TestCase/DeleteSavedCreditCardTest.php @@ -5,7 +5,10 @@ */ namespace Magento\Vault\Test\TestCase; -use Magento\Mtf\TestCase\Scenario; +use Magento\Checkout\Test\Page\CheckoutOnepage; +use Magento\Mtf\ObjectManager; +use Magento\Mtf\TestCase\Injectable; +use Magento\Vault\Test\Constraint\AssertCreditCardNotPresentOnCheckout; /** * Preconditions: @@ -21,9 +24,9 @@ * 7. Perform assertions. * * @group Vault_(CS) - * @ZephyrId MAGETWO-48086 + * @ZephyrId MAGETWO-54059, MAGETWO-54072, MAGETWO-54068, MAGETWO-54015, MAGETWO-54011 */ -class DeleteSavedCreditCardTest extends Scenario +class DeleteSavedCreditCardTest extends Injectable { /* tags */ const MVP = 'yes'; @@ -34,10 +37,265 @@ class DeleteSavedCreditCardTest extends Scenario /** * Runs delete saved credit card test. * + * @param AssertCreditCardNotPresentOnCheckout $assertCreditCardNotPresentOnCheckout + * @param CheckoutOnepage $checkoutOnepage + * @param $products + * @param $configData + * @param $customer + * @param $checkoutMethod + * @param $shippingAddress + * @param $shipping + * @param array $payments + * @param $creditCardSave + */ + public function test( + AssertCreditCardNotPresentOnCheckout $assertCreditCardNotPresentOnCheckout, + CheckoutOnepage $checkoutOnepage, + $products, + $configData, + $customer, + $checkoutMethod, + $shippingAddress, + $shipping, + array $payments, + $creditCardSave + ) { + // Preconditions + $products = $this->prepareProducts($products); + $this->setupConfiguration($configData); + $customer = $this->createCustomer($customer); + + // Steps + foreach ($payments as $key => $payment) { + $this->addToCart($products); + $this->proceedToCheckout(); + if($key < 1) { // if this is the first order to be placed + $this->selectCheckoutMethod($checkoutMethod, $customer); + $this->fillShippingAddress($shippingAddress); + } + $this->fillShippingMethod($shipping); + if ($key >= 2) { // if this order will be placed via stored credit card + $this->useSavedCreditCard($payment); + } else { + $this->selectPaymentMethod($payment, $payment['creditCardClass'], $payment['creditCard']); + $this->saveCreditCard($payment, $creditCardSave); + } + $this->placeOrder(); + } + // Delete credit cards from My Account and verify they are not available on checkout + foreach($payments as $key => $payment) { + if ($key >= 2) { + $deletedCard = $this->deleteCreditCardFromMyAccount( + $customer, + $payment['creditCard'], + $payment['creditCardClass'] + ); + $this->addToCart($products); + $this->proceedToCheckout(); + $this->fillShippingMethod($shipping); + $assertCreditCardNotPresentOnCheckout->processAssert( + $checkoutOnepage, + $deletedCard['deletedCreditCard'] + ); + } + } + } + + /** + * @param $configData + */ + protected function setupConfiguration($configData) + { + $setupConfigurationStep = ObjectManager::getInstance()->create( + \Magento\Config\Test\TestStep\SetupConfigurationStep::class, + ['configData' => $configData] + ); + + $setupConfigurationStep->run(); + } + + /** + * Create products + * + * @param string $productList + * @return array + */ + protected function prepareProducts($productList) + { + $addToCartStep = ObjectManager::getInstance()->create( + \Magento\Catalog\Test\TestStep\CreateProductsStep::class, + ['products' => $productList] + ); + + $result = $addToCartStep->run(); + return $result['products']; + } + + /** + * @param array $products + * @return void + */ + protected function addToCart(array $products) + { + $addToCartStep = ObjectManager::getInstance()->create( + \Magento\Checkout\Test\TestStep\AddProductsToTheCartStep::class, + ['products' => $products] + ); + $addToCartStep->run(); + } + + /** + * @return void + */ + protected function proceedToCheckout() + { + $clickProceedToCheckoutStep = ObjectManager::getInstance()->create( + \Magento\Checkout\Test\TestStep\ProceedToCheckoutStep::class + ); + $clickProceedToCheckoutStep->run(); + } + + /** + * @param array $customer + */ + protected function createCustomer(array $customer) + { + $createCustomerStep = ObjectManager::getInstance()->create( + \Magento\Customer\Test\TestStep\CreateCustomerStep::class, + ['customer' => $customer] + ); + $result = $createCustomerStep->run(); + return $result['customer']; + } + + /** + * @param $checkoutMethod + * @param $customer + */ + protected function selectCheckoutMethod($checkoutMethod, $customer) + { + $selectCheckoutMethodStep = ObjectManager::getInstance()->create( + \Magento\Checkout\Test\TestStep\SelectCheckoutMethodStep::class, + [ + 'checkoutMethod' => $checkoutMethod, + 'customer' => $customer, + ] + ); + $selectCheckoutMethodStep->run(); + } + + /** + * @param array $shippingAddress + */ + protected function fillShippingAddress(array $shippingAddress) + { + $fillShippingAddressStep = ObjectManager::getInstance()->create( + \Magento\Checkout\Test\TestStep\FillShippingAddressStep::class, + ['shippingAddress' => $shippingAddress] + ); + $fillShippingAddressStep->run(); + } + + /** + * Add products to cart + * + * @param array $shipping + */ + protected function fillShippingMethod(array $shipping) + { + $fillShippingMethodStep = ObjectManager::getInstance()->create( + \Magento\Checkout\Test\TestStep\FillShippingMethodStep::class, + ['shipping' => $shipping] + ); + $fillShippingMethodStep->run(); + } + + /** + * @param array $payment + * @param $creditCardClass + * @param array $creditCard + */ + protected function selectPaymentMethod(array $payment, $creditCardClass, array $creditCard) + { + $selectPaymentMethodStep = ObjectManager::getInstance()->create( + \Magento\Checkout\Test\TestStep\SelectPaymentMethodStep::class, + [ + 'payment' => $payment, + 'creditCardClass' => $creditCardClass, + 'creditCard' => $creditCard, + ] + ); + $selectPaymentMethodStep->run(); + } + + /** + * Add products to cart + * + * @param $payment + * @param $creditCardSave + */ + protected function saveCreditCard($payment, $creditCardSave) + { + $saveCreditCardStep = ObjectManager::getInstance()->create( + \Magento\Vault\Test\TestStep\SaveCreditCardStep::class, + [ + 'creditCardSave' => $creditCardSave, + 'payment' => $payment + ] + ); + $saveCreditCardStep->run(); + } + + /** + * @return void + */ + protected function fillBillingInformation() + { + $fillBillingInformationStep = ObjectManager::getInstance()->create( + \Magento\Checkout\Test\TestStep\FillBillingInformationStep::class + ); + $fillBillingInformationStep->run(); + } + + /** * @return void */ - public function test() + protected function placeOrder() + { + $placeOrderStep = ObjectManager::getInstance()->create( + \Magento\Checkout\Test\TestStep\PlaceOrderStep::class + ); + $placeOrderStep->run(); + } + + /** + * @param $payment + */ + protected function useSavedCreditCard($payment) + { + $useSavedCreditCardStep = ObjectManager::getInstance()->create( + \Magento\Vault\Test\TestStep\UseSavedCreditCardStep::class, + ['payment' => $payment] + ); + $useSavedCreditCardStep->run(); + } + + /** + * @param $customer + * @param $creditCard + * @param $creditCardClass + */ + protected function deleteCreditCardFromMyAccount($customer, $creditCard, $creditCardClass) { - $this->executeScenario(); + $deleteCreditCardFromMyAccountStep = ObjectManager::getInstance()->create( + \Magento\Vault\Test\TestStep\DeleteCreditCardFromMyAccountStep::class, + [ + 'customer' => $customer, + 'creditCard' => $creditCard, + 'creditCardClass' => $creditCardClass + ] + ); + $deletedCard = $deleteCreditCardFromMyAccountStep->run(); + return $deletedCard; } } diff --git a/dev/tests/functional/tests/app/Magento/Vault/Test/TestCase/DeleteSavedCreditCardTest.xml b/dev/tests/functional/tests/app/Magento/Vault/Test/TestCase/DeleteSavedCreditCardTest.xml new file mode 100644 index 0000000000000..ecbed706005b4 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Vault/Test/TestCase/DeleteSavedCreditCardTest.xml @@ -0,0 +1,52 @@ + + + + + + catalogProductSimple::product_10_dollar + default + US_address_1_without_email + login + Flat Rate + Fixed + + + braintree + credit_card_braintree + + visa_braintree + + + + payflowpro + credit_card + + amex_default + + + + braintree + credit_card_braintree + + visa_braintree + + + + payflowpro + credit_card + + amex_default + + + + Yes + braintree, payflowpro, braintree_use_vault, payflowpro_use_vault + test_type:3rd_party_test + + + diff --git a/dev/tests/functional/tests/app/Magento/Vault/Test/TestStep/DeleteCreditCardFromMyAccountStep.php b/dev/tests/functional/tests/app/Magento/Vault/Test/TestStep/DeleteCreditCardFromMyAccountStep.php index 85150d6c4798e..beb644a6ba224 100644 --- a/dev/tests/functional/tests/app/Magento/Vault/Test/TestStep/DeleteCreditCardFromMyAccountStep.php +++ b/dev/tests/functional/tests/app/Magento/Vault/Test/TestStep/DeleteCreditCardFromMyAccountStep.php @@ -90,7 +90,7 @@ public function __construct( public function run() { $this->objectManager->create( - 'Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep', + \Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep::class, ['customer' => $this->customer] )->run(); $this->customerAccountIndex->getAccountMenuBlock()->openMenuItem('My Credit Cards'); From b20c0c884263f0d045f5e8f0bf229c73df584be2 Mon Sep 17 00:00:00 2001 From: Dale Sikkema Date: Thu, 9 Jun 2016 14:45:57 -0500 Subject: [PATCH 265/345] MAGETWO-54031: Static Test for DI Configuration Misses Wrong Letter Case in Class Names --- .../Integrity/PluginValidator.php | 57 +++++++++++++++++++ .../Test/Integrity/Di/CompilerTest.php | 6 +- 2 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 dev/tests/static/framework/Magento/TestFramework/Integrity/PluginValidator.php diff --git a/dev/tests/static/framework/Magento/TestFramework/Integrity/PluginValidator.php b/dev/tests/static/framework/Magento/TestFramework/Integrity/PluginValidator.php new file mode 100644 index 0000000000000..509406bc7f1fb --- /dev/null +++ b/dev/tests/static/framework/Magento/TestFramework/Integrity/PluginValidator.php @@ -0,0 +1,57 @@ +frameworkValidator = $frameworkValidator; + } + + /** + * Validate plugin and intercepted class + * + * @param string $pluginClass + * @param string $interceptedType + * @throws ValidatorException + */ + public function validate($pluginClass, $interceptedType) + { + $this->frameworkValidator->validate($pluginClass, $interceptedType); + $this->validateClassNameMatchesCase($pluginClass); + $this->validateClassNameMatchesCase($interceptedType); + } + + /** + * Verify that the class name has same capitalization as the class declaration + * + * @param string $className + * @throws ValidatorException + */ + private function validateClassNameMatchesCase($className) + { + $declarationName = (new \ReflectionClass($className))->getName();; + if (ltrim($className, '\\') != ltrim($declarationName)) { + throw new ValidatorException( + new Phrase( + "Capitalization of class name '%1' does not match expected '%2'", + [$className, $declarationName] + ) + ); + } + } +} diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Di/CompilerTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/Di/CompilerTest.php index fdcc5a8657436..e36dcb4ba5357 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Di/CompilerTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Di/CompilerTest.php @@ -11,12 +11,14 @@ use Magento\Framework\Api\Code\Generator\SearchResults; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\Component\ComponentRegistrar; +use Magento\Framework\Interception\Code\InterfaceValidator; use Magento\Framework\ObjectManager\Code\Generator\Converter; use Magento\Framework\ObjectManager\Code\Generator\Factory; use Magento\Framework\ObjectManager\Code\Generator\Repository; use Magento\Framework\Api\Code\Generator\ExtensionAttributesInterfaceGenerator; use Magento\Framework\Api\Code\Generator\ExtensionAttributesGenerator; use Magento\Framework\App\Utility\Files; +use Magento\TestFramework\Integrity\PluginValidator; /** * @SuppressWarnings(PHPMD.CouplingBetweenObjects) @@ -56,7 +58,7 @@ class CompilerTest extends \PHPUnit_Framework_TestCase /** * Class arguments reader * - * @var \Magento\Framework\Interception\Code\InterfaceValidator + * @var PluginValidator */ protected $pluginValidator; @@ -103,7 +105,7 @@ protected function setUp() $this->_validator->add(new \Magento\Framework\Code\Validator\TypeDuplication()); $this->_validator->add(new \Magento\Framework\Code\Validator\ArgumentSequence()); $this->_validator->add(new \Magento\Framework\Code\Validator\ConstructorArgumentTypes()); - $this->pluginValidator = new \Magento\Framework\Interception\Code\InterfaceValidator(); + $this->pluginValidator = new PluginValidator(new InterfaceValidator()); } /** From a4852f84f5ae3ba9433c9166f1c485a98e812f4b Mon Sep 17 00:00:00 2001 From: Hayder Sharhan Date: Thu, 9 Jun 2016 14:49:29 -0500 Subject: [PATCH 266/345] MAGETWO-54051: [GITHUB] Cannot login on frontend if inline translation is enabled #4925 - Changed attribute to use single quote instead of double. --- app/code/Magento/Translation/Model/Inline/Parser.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Translation/Model/Inline/Parser.php b/app/code/Magento/Translation/Model/Inline/Parser.php index e44da486d4352..3a5a607aebf1e 100644 --- a/app/code/Magento/Translation/Model/Inline/Parser.php +++ b/app/code/Magento/Translation/Model/Inline/Parser.php @@ -436,12 +436,12 @@ private function _prepareTagAttributesForContent(&$content) $tagHtml = str_replace($matches[0], '', $tagHtml); $trAttr = ' ' . $this->_getHtmlAttribute( self::DATA_TRANSLATE, - '[' . htmlspecialchars($matches[1]) . ',' . join(',', $trArr) . ']' + '[' . htmlspecialchars($matches[1]) . ',' . str_replace("\"", "'", join(',', $trArr)) . ']' ); } else { $trAttr = ' ' . $this->_getHtmlAttribute( self::DATA_TRANSLATE, - '[' . join(',', $trArr) . ']' + '[' . str_replace("\"", "'", join(',', $trArr)) . ']' ); } $trAttr = $this->_addTranslateAttribute($trAttr); From 49fe79cd5f86c1d37db6541fe759d9e7be305f0c Mon Sep 17 00:00:00 2001 From: Robert He Date: Thu, 9 Jun 2016 15:57:23 -0500 Subject: [PATCH 267/345] MAGETWO-52891: [FT] CreateSimpleProductEntityTest failed to recognize a comma and a dot in the product price - added correct price and weight formats on backend product form --- .../Product/Form/Modifier/EavTest.php | 45 ++++++++++++- .../Product/Form/Modifier/CustomOptions.php | 28 ++++++++ .../Product/Form/Modifier/Eav.php | 28 ++++++++ .../Product/Form/Modifier/General.php | 65 ++++++++++++++++++- 4 files changed, 162 insertions(+), 4 deletions(-) mode change 100644 => 100755 app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/EavTest.php mode change 100644 => 100755 app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/CustomOptions.php mode change 100644 => 100755 app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php mode change 100644 => 100755 app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/General.php diff --git a/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/EavTest.php b/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/EavTest.php old mode 100644 new mode 100755 index 51d3ec6009e51..ecaf496a949af --- a/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/EavTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/EavTest.php @@ -10,6 +10,7 @@ use Magento\Eav\Model\Config; use Magento\Framework\App\RequestInterface; use Magento\Store\Model\StoreManagerInterface; +use Magento\Store\Api\Data\StoreInterface; use Magento\Ui\DataProvider\EavValidationRules; use Magento\Eav\Model\ResourceModel\Entity\Attribute\Group\Collection as GroupCollection; use Magento\Eav\Model\ResourceModel\Entity\Attribute\Group\CollectionFactory as GroupCollectionFactory; @@ -28,6 +29,8 @@ use Magento\Catalog\Api\Data\ProductAttributeInterface; use Magento\Eav\Api\Data\AttributeGroupInterface; use Magento\Catalog\Model\ResourceModel\Eav\Attribute; +use Magento\Framework\Currency; +use Magento\Framework\Locale\Currency as CurrencyLocale; /** * Class EavTest @@ -138,6 +141,21 @@ class EavTest extends AbstractModifierTest */ private $eavAttributeMock; + /** + * @var StoreInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $storeMock; + + /** + * @var Currency|\PHPUnit_Framework_MockObject_MockObject + */ + protected $currencyMock; + + /** + * @var CurrencyLocale|\PHPUnit_Framework_MockObject_MockObject + */ + protected $currencyLocaleMock; + protected function setUp() { parent::setUp(); @@ -236,6 +254,17 @@ protected function setUp() ->willReturn([ $this->attributeMock, ]); + $this->storeMock = $this->getMockBuilder(StoreInterface::class) + ->setMethods(['load', 'getId', 'getConfig', 'getBaseCurrencyCode']) + ->getMockForAbstractClass(); + $this->currencyMock = $this->getMockBuilder(Currency::class) + ->disableOriginalConstructor() + ->setMethods(['toCurrency']) + ->getMock(); + $this->currencyLocaleMock = $this->getMockBuilder(CurrencyLocale::class) + ->disableOriginalConstructor() + ->setMethods(['getCurrency']) + ->getMock(); } /** @@ -255,7 +284,8 @@ protected function createModel() 'searchCriteriaBuilder' => $this->searchCriteriaBuilderMock, 'attributeGroupRepository' => $this->attributeGroupRepositoryMock, 'sortOrderBuilder' => $this->sortOrderBuilderMock, - 'attributeRepository' => $this->attributeRepositoryMock + 'attributeRepository' => $this->attributeRepositoryMock, + 'localeCurrency' => $this->currencyLocaleMock, ]); } @@ -336,6 +366,19 @@ public function testModifyData() ->method('getItems') ->willReturn([$this->eavAttributeMock]); + $this->storeMock->expects(($this->once())) + ->method('getBaseCurrencyCode') + ->willReturn('en_US'); + $this->storeManagerMock->expects($this->once()) + ->method('getStore') + ->willReturn($this->storeMock); + $this->currencyMock->expects($this->once()) + ->method('toCurrency') + ->willReturn('19.99'); + $this->currencyLocaleMock->expects($this->once()) + ->method('getCurrency') + ->willReturn($this->currencyMock); + $this->assertEquals($sourceData, $this->getModel()->modifyData([])); } } diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/CustomOptions.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/CustomOptions.php old mode 100644 new mode 100755 index 43ad0e0018033..793f5c4ee39f5 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/CustomOptions.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/CustomOptions.php @@ -22,6 +22,7 @@ use Magento\Ui\Component\Form\Element\ActionDelete; use Magento\Ui\Component\Form\Element\DataType\Text; use Magento\Ui\Component\Form\Element\DataType\Number; +use Magento\Framework\Locale\CurrencyInterface; /** * Data provider for "Customizable Options" panel @@ -112,6 +113,11 @@ class CustomOptions extends AbstractModifier */ protected $urlBuilder; + /** + * @var CurrencyInterface + */ + protected $localeCurrency; + /** * @var ArrayManager */ @@ -128,6 +134,7 @@ class CustomOptions extends AbstractModifier * @param ConfigInterface $productOptionsConfig * @param ProductOptionsPrice $productOptionsPrice * @param UrlInterface $urlBuilder + * @param CurrencyInterface $localeCurrency * @param ArrayManager $arrayManager */ public function __construct( @@ -136,6 +143,7 @@ public function __construct( ConfigInterface $productOptionsConfig, ProductOptionsPrice $productOptionsPrice, UrlInterface $urlBuilder, + CurrencyInterface $localeCurrency, ArrayManager $arrayManager ) { $this->locator = $locator; @@ -143,6 +151,7 @@ public function __construct( $this->productOptionsConfig = $productOptionsConfig; $this->productOptionsPrice = $productOptionsPrice; $this->urlBuilder = $urlBuilder; + $this->localeCurrency = $localeCurrency; $this->arrayManager = $arrayManager; } @@ -1069,4 +1078,23 @@ protected function getCurrencySymbol() { return $this->storeManager->getStore()->getBaseCurrency()->getCurrencySymbol(); } + + /** + * Format price according to the locale of the currency + * + * @param mixed $value + * @return string + */ + protected function formatPrice($value) + { + if (!is_numeric($value)) { + return null; + } + + $store = $this->storeManager->getStore(); + $currency = $this->localeCurrency->getCurrency($store->getBaseCurrencyCode()); + $value = $currency->toCurrency($value, ['display' => \Magento\Framework\Currency::NO_SYMBOL]); + + return $value; + } } diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php old mode 100644 new mode 100755 index ca2d2e59aa238..d5e83cf79c726 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php @@ -30,6 +30,7 @@ use Magento\Ui\DataProvider\Mapper\MetaProperties as MetaPropertiesMapper; use Magento\Ui\Component\Form\Element\Wysiwyg as WysiwygElement; use Magento\Catalog\Model\Attribute\ScopeOverriddenValue; +use Magento\Framework\Locale\CurrencyInterface; /** * Class Eav @@ -161,6 +162,11 @@ class Eav extends AbstractModifier */ private $prevSetAttributes; + /** + * @var CurrencyInterface + */ + protected $localeCurrency; + /** * @param LocatorInterface $locator * @param CatalogEavValidationRules $catalogEavValidationRules @@ -179,6 +185,7 @@ class Eav extends AbstractModifier * @param ArrayManager $arrayManager * @param ScopeOverriddenValue $scopeOverriddenValue * @param DataPersistorInterface $dataPersistor + * @param CurrencyInterface $localeCurrency * @param array $attributesToDisable * @param array $attributesToEliminate * @SuppressWarnings(PHPMD.ExcessiveParameterList) @@ -201,6 +208,7 @@ public function __construct( ArrayManager $arrayManager, ScopeOverriddenValue $scopeOverriddenValue, DataPersistorInterface $dataPersistor, + CurrencyInterface $localeCurrency, $attributesToDisable = [], $attributesToEliminate = [] ) { @@ -221,6 +229,7 @@ public function __construct( $this->arrayManager = $arrayManager; $this->scopeOverriddenValue = $scopeOverriddenValue; $this->dataPersistor = $dataPersistor; + $this->localeCurrency = $localeCurrency; $this->attributesToDisable = $attributesToDisable; $this->attributesToEliminate = $attributesToEliminate; } @@ -867,4 +876,23 @@ private function calculateGroupCode(AttributeGroupInterface $group) return $attributeGroupCode; } + + /** + * Format price according to the locale of the currency + * + * @param mixed $value + * @return string + */ + protected function formatPrice($value) + { + if (!is_numeric($value)) { + return null; + } + + $store = $this->storeManager->getStore(); + $currency = $this->localeCurrency->getCurrency($store->getBaseCurrencyCode()); + $value = $currency->toCurrency($value, ['display' => \Magento\Framework\Currency::NO_SYMBOL]); + + return $value; + } } diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/General.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/General.php old mode 100644 new mode 100755 index 03bacd2bdccb1..23247445ee1ee --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/General.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/General.php @@ -9,6 +9,8 @@ use Magento\Catalog\Model\Locator\LocatorInterface; use Magento\Ui\Component\Form; use Magento\Framework\Stdlib\ArrayManager; +use Magento\Store\Model\StoreManagerInterface; +use Magento\Framework\Locale\CurrencyInterface; /** * Data provider for main panel of product page @@ -24,17 +26,33 @@ class General extends AbstractModifier * @var ArrayManager */ protected $arrayManager; + + /** + * @var StoreManagerInterface + */ + protected $storeManager; + + /** + * @var CurrencyInterface + */ + protected $localeCurrency; /** * @param LocatorInterface $locator * @param ArrayManager $arrayManager + * @param StoreManagerInterface $storeManager + * @param CurrencyInterface $localeCurrency */ public function __construct( LocatorInterface $locator, - ArrayManager $arrayManager + ArrayManager $arrayManager, + StoreManagerInterface $storeManager, + CurrencyInterface $localeCurrency ) { $this->locator = $locator; $this->arrayManager = $arrayManager; + $this->storeManager = $storeManager; + $this->localeCurrency = $localeCurrency; } /** @@ -70,7 +88,7 @@ protected function customizeWeightFormat(array $data) $data = $this->arrayManager->replace( $path, $data, - $this->formatWeight($this->arrayManager->get($path, $data)) + $this->formatNumber($this->arrayManager->get($path, $data)) ); } @@ -93,7 +111,7 @@ protected function customizeAdvancedPriceFormat(array $data) $value[ProductAttributeInterface::CODE_TIER_PRICE_FIELD_PRICE] = $this->formatPrice($value[ProductAttributeInterface::CODE_TIER_PRICE_FIELD_PRICE]); $value[ProductAttributeInterface::CODE_TIER_PRICE_FIELD_PRICE_QTY] = - (int)$value[ProductAttributeInterface::CODE_TIER_PRICE_FIELD_PRICE_QTY]; + $this->formatNumber((int)$value[ProductAttributeInterface::CODE_TIER_PRICE_FIELD_PRICE_QTY]); } } @@ -350,4 +368,45 @@ protected function customizeNameListeners(array $meta) ] ); } + + /** + * Format price according to the locale of the currency + * + * @param mixed $value + * @return string + */ + protected function formatPrice($value) + { + if (!is_numeric($value)) { + return null; + } + + $store = $this->storeManager->getStore(); + $currency = $this->localeCurrency->getCurrency($store->getBaseCurrencyCode()); + $value = $currency->toCurrency($value, ['display' => \Magento\Framework\Currency::NO_SYMBOL]); + + return $value; + } + + /** + * Format number according to the locale of the currency and precision of input + * + * @param mixed $value + * @return string + */ + protected function formatNumber($value) + { + if (!is_numeric($value)) { + return null; + } + + $value = (float)$value; + $precision = strlen(substr(strrchr($value, "."), 1)); + $store = $this->storeManager->getStore(); + $currency = $this->localeCurrency->getCurrency($store->getBaseCurrencyCode()); + $value = $currency->toCurrency($value, ['display' => \Magento\Framework\Currency::NO_SYMBOL, + 'precision' => $precision]); + + return $value; + } } From 6010651ef88b978bb993af69649210d4fbe8ae22 Mon Sep 17 00:00:00 2001 From: Roman Liukshyn Date: Fri, 10 Jun 2016 10:49:10 +0300 Subject: [PATCH 268/345] MAGETWO-53238: Vault Provider field contains Payflow Pro option in countries which don't have such solution - Fixed functional test --- .../TestCase/DeleteSavedCreditCardTest.php | 29 +++++++++---------- .../app/Magento/Vault/Test/etc/testcase.xml | 19 ------------ 2 files changed, 14 insertions(+), 34 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Vault/Test/TestCase/DeleteSavedCreditCardTest.php b/dev/tests/functional/tests/app/Magento/Vault/Test/TestCase/DeleteSavedCreditCardTest.php index 433000c4cdd04..43497e821f6a9 100644 --- a/dev/tests/functional/tests/app/Magento/Vault/Test/TestCase/DeleteSavedCreditCardTest.php +++ b/dev/tests/functional/tests/app/Magento/Vault/Test/TestCase/DeleteSavedCreditCardTest.php @@ -83,21 +83,20 @@ public function test( $this->placeOrder(); } // Delete credit cards from My Account and verify they are not available on checkout - foreach($payments as $key => $payment) { - if ($key >= 2) { - $deletedCard = $this->deleteCreditCardFromMyAccount( - $customer, - $payment['creditCard'], - $payment['creditCardClass'] - ); - $this->addToCart($products); - $this->proceedToCheckout(); - $this->fillShippingMethod($shipping); - $assertCreditCardNotPresentOnCheckout->processAssert( - $checkoutOnepage, - $deletedCard['deletedCreditCard'] - ); - } + $paymentsCount = count($payments); + for($i = 2; $i < $paymentsCount; $i++) { + $deletedCard = $this->deleteCreditCardFromMyAccount( + $customer, + $payments[$i]['creditCard'], + $payments[$i]['creditCardClass'] + ); + $this->addToCart($products); + $this->proceedToCheckout(); + $this->fillShippingMethod($shipping); + $assertCreditCardNotPresentOnCheckout->processAssert( + $checkoutOnepage, + $deletedCard['deletedCreditCard'] + ); } } diff --git a/dev/tests/functional/tests/app/Magento/Vault/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Magento/Vault/Test/etc/testcase.xml index 3ffbabdec638b..a804e4ac34555 100644 --- a/dev/tests/functional/tests/app/Magento/Vault/Test/etc/testcase.xml +++ b/dev/tests/functional/tests/app/Magento/Vault/Test/etc/testcase.xml @@ -6,25 +6,6 @@ */ --> - - - - - - - - - - - - - - - - - - - From 9eb120d22029c75850d7ee60c98a5b8aba9f770b Mon Sep 17 00:00:00 2001 From: Anton Kaplya Date: Fri, 10 Jun 2016 15:41:16 +0300 Subject: [PATCH 269/345] MAGETWO-53424: Added additional arguments into attributes creation --- lib/internal/Magento/Framework/EntityManager/Operation/Read.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/EntityManager/Operation/Read.php b/lib/internal/Magento/Framework/EntityManager/Operation/Read.php index 7ab9bbe259151..1cd988f53a005 100644 --- a/lib/internal/Magento/Framework/EntityManager/Operation/Read.php +++ b/lib/internal/Magento/Framework/EntityManager/Operation/Read.php @@ -110,7 +110,7 @@ public function execute($entity, $identifier, $arguments = []) 'arguments' => $arguments ] ); - $entity = $this->readMain->execute($entity, $identifier, $arguments); + $entity = $this->readMain->execute($entity, $identifier); $entityData = array_merge($hydrator->extract($entity), $arguments); if (isset($entityData[$metadata->getLinkField()])) { $entity = $this->readAttributes->execute($entity, $arguments); From 2e5c1e32753a885cd3917b924f2a4e8d2a2b9790 Mon Sep 17 00:00:00 2001 From: Roman Ganin Date: Fri, 10 Jun 2016 17:22:20 +0300 Subject: [PATCH 270/345] MAGETWO-54172: Product URL rewrites are not created on mass assign to new website --- .../CatalogUrlRewrite/etc/adminhtml/events.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 app/code/Magento/CatalogUrlRewrite/etc/adminhtml/events.xml diff --git a/app/code/Magento/CatalogUrlRewrite/etc/adminhtml/events.xml b/app/code/Magento/CatalogUrlRewrite/etc/adminhtml/events.xml new file mode 100644 index 0000000000000..3f5eecc9eb7bb --- /dev/null +++ b/app/code/Magento/CatalogUrlRewrite/etc/adminhtml/events.xml @@ -0,0 +1,12 @@ + + + + + + + From 4dc358dffe4df460fe9a6f955c1beeca65769b2c Mon Sep 17 00:00:00 2001 From: Hayder Sharhan Date: Fri, 10 Jun 2016 11:15:23 -0500 Subject: [PATCH 271/345] MAGETWO-54051: [GITHUB] Cannot login on frontend if inline translation is enabled #4925 - Added test. --- .../Test/Unit/Model/Inline/ParserTest.php | 112 ++++++++++++++++++ .../Inline/_files/datatranslate_fixture.html | 32 +++++ 2 files changed, 144 insertions(+) create mode 100644 app/code/Magento/Translation/Test/Unit/Model/Inline/ParserTest.php create mode 100644 app/code/Magento/Translation/Test/Unit/Model/Inline/_files/datatranslate_fixture.html diff --git a/app/code/Magento/Translation/Test/Unit/Model/Inline/ParserTest.php b/app/code/Magento/Translation/Test/Unit/Model/Inline/ParserTest.php new file mode 100644 index 0000000000000..ded9e27c2cac1 --- /dev/null +++ b/app/code/Magento/Translation/Test/Unit/Model/Inline/ParserTest.php @@ -0,0 +1,112 @@ +resourceMock = $this->getMockBuilder('Magento\Translation\Model\ResourceModel\StringUtilsFactory') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMock(); + + $this->storeManagerMock = $this->getMockBuilder('Magento\Store\Model\StoreManagerInterface') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMock(); + + $this->inputFilterMock = $this->getMockBuilder('Zend_Filter_Interface') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMock(); + + $this->appStateMock = $this->getMockBuilder('Magento\Framework\App\State') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMock(); + + $this->appCacheMock = $this->getMockBuilder('Magento\Framework\App\Cache\TypeListInterface') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMock(); + + $this->translateInlineMock= $this->getMockBuilder('Magento\Framework\Translate\InlineInterface') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMock(); + + $objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); + $this->model = $objectManagerHelper->getObject( + 'Magento\Translation\Model\Inline\Parser', + [ + "_resourceFactory" => $this->resourceMock, + "_storeManager" => $this->storeManagerMock, + "_inputFilter" => $this->inputFilterMock, + "_appState" => $this->appStateMock, + "_appCache" => $this->appCacheMock, + "_translateInline" => $this->translateInlineMock + ] + ); + } + + public function testProcessResponseBodyStringProcessingAttributesCorrectly() + { + $testContent = file_get_contents(__DIR__ . '/_files/datatranslate_fixture.html'); + $processedAttributes = [ + "data-translate=\"[{'shown':'* Required Fields','translated':'* Required Fields'," + . "'original':'* Required Fields','location':'Tag attribute (ALT, TITLE, etc.)'}]\"", + "data-translate=\"[{'shown':'Email','translated':'Email','original':'Email'," + . "'location':'Tag attribute (ALT, TITLE, etc.)'}]\"", + "data-translate=\"[{'shown':'Password','translated':'Password','original':'Password'," + . "'location':'Tag attribute (ALT, TITLE, etc.)'}]\"" + ]; + $this->translateInlineMock->expects($this->any())->method('getAdditionalHtmlAttribute')->willReturn(null); + + $processedContent = $this->model->processResponseBodyString($testContent); + foreach ($processedAttributes as $attribute) { + $this->assertContains($attribute, $processedContent, "data-translate attribute not processed correctly"); + } + } +} diff --git a/app/code/Magento/Translation/Test/Unit/Model/Inline/_files/datatranslate_fixture.html b/app/code/Magento/Translation/Test/Unit/Model/Inline/_files/datatranslate_fixture.html new file mode 100644 index 0000000000000..0775ad2c44bbe --- /dev/null +++ b/app/code/Magento/Translation/Test/Unit/Model/Inline/_files/datatranslate_fixture.html @@ -0,0 +1,32 @@ + From ab6d2bf5ea0b730c897bd610f47e40bbf4ef1cf1 Mon Sep 17 00:00:00 2001 From: Hayder Sharhan Date: Fri, 10 Jun 2016 12:19:29 -0500 Subject: [PATCH 272/345] MAGETWO-53008: [Github] Format of responses doesn't match Swagger - Fixed api functional test. --- .../Webapi/JsonGenerationFromDataObjectTest.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dev/tests/api-functional/testsuite/Magento/Webapi/JsonGenerationFromDataObjectTest.php b/dev/tests/api-functional/testsuite/Magento/Webapi/JsonGenerationFromDataObjectTest.php index 1f078d5c034a8..82cd0eaf58827 100644 --- a/dev/tests/api-functional/testsuite/Magento/Webapi/JsonGenerationFromDataObjectTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Webapi/JsonGenerationFromDataObjectTest.php @@ -240,7 +240,7 @@ public function getExpectedMultiServiceData() 'type' => 'object', 'description' => 'Interface for custom attribute value.', 'properties' => [ - 'attributeCode' => [ + 'attribute_code' => [ 'type' => 'string', 'description' => 'Attribute code', ], @@ -250,7 +250,7 @@ public function getExpectedMultiServiceData() ], ], 'required' => [ - 'attributeCode', + 'attribute_code', 'value', ], ], @@ -258,7 +258,7 @@ public function getExpectedMultiServiceData() 'type' => 'object', 'description' => 'Some Data Object short description. Data Object long multi line description.', 'properties' => [ - 'entityId' => [ + 'entity_id' => [ 'type' => 'integer', 'description' => 'Item ID', ], @@ -274,7 +274,7 @@ public function getExpectedMultiServiceData() 'type' => 'boolean', 'description' => 'If current entity has a property defined', ], - 'customAttributes' => [ + 'custom_attributes' => [ 'type' => 'array', 'description' => 'Custom attributes values.', 'items' => [ @@ -283,7 +283,7 @@ public function getExpectedMultiServiceData() ], ], 'required' => [ - 'entityId', + 'entity_id', 'enabled', 'orders', ], From bc86310ae92d162c923db3413718a67595840c8a Mon Sep 17 00:00:00 2001 From: Alexander Paliarush Date: Fri, 10 Jun 2016 12:27:29 -0500 Subject: [PATCH 273/345] MAGETWO-54231: Integration broken after deleting admin with same ID --- .../Magento/User/Model/ResourceModel/User.php | 29 +++++++++++++------ 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/User/Model/ResourceModel/User.php b/app/code/Magento/User/Model/ResourceModel/User.php index 64b12162e020f..b35deb6c5c6f1 100644 --- a/app/code/Magento/User/Model/ResourceModel/User.php +++ b/app/code/Magento/User/Model/ResourceModel/User.php @@ -186,7 +186,7 @@ protected function _afterSave(\Magento\Framework\Model\AbstractModel $user) */ public function _clearUserRoles(ModelUser $user) { - $conditions = ['user_id = ?' => (int)$user->getId()]; + $conditions = ['user_id = ?' => (int)$user->getId(), 'user_type = ?' => UserContextInterface::USER_TYPE_ADMIN]; $this->getConnection()->delete($this->getTable('authorization_role'), $conditions); } @@ -255,13 +255,13 @@ public function delete(\Magento\Framework\Model\AbstractModel $user) $uid = $user->getId(); $connection->beginTransaction(); try { - $conditions = ['user_id = ?' => $uid]; - - $connection->delete($this->getMainTable(), $conditions); - $connection->delete($this->getTable('authorization_role'), $conditions); + $connection->delete($this->getMainTable(), ['user_id = ?' => $uid]); + $connection->delete( + $this->getTable('authorization_role'), + ['user_id = ?' => $uid, 'user_type = ?' => UserContextInterface::USER_TYPE_ADMIN] + ); } catch (\Magento\Framework\Exception\LocalizedException $e) { throw $e; - return false; } catch (\Exception $e) { $connection->rollBack(); return false; @@ -329,7 +329,11 @@ public function deleteFromRole(\Magento\Framework\Model\AbstractModel $user) $dbh = $this->getConnection(); - $condition = ['user_id = ?' => (int)$user->getId(), 'parent_id = ?' => (int)$user->getRoleId()]; + $condition = [ + 'user_id = ?' => (int)$user->getId(), + 'parent_id = ?' => (int)$user->getRoleId(), + 'user_type = ?' => UserContextInterface::USER_TYPE_ADMIN + ]; $dbh->delete($this->getTable('authorization_role'), $condition); return $this; @@ -348,9 +352,16 @@ public function roleUserExists(\Magento\Framework\Model\AbstractModel $user) $dbh = $this->getConnection(); - $binds = ['parent_id' => $user->getRoleId(), 'user_id' => $user->getUserId()]; + $binds = [ + 'parent_id' => $user->getRoleId(), + 'user_id' => $user->getUserId(), + 'user_type' => UserContextInterface::USER_TYPE_ADMIN + ]; - $select = $dbh->select()->from($roleTable)->where('parent_id = :parent_id')->where('user_id = :user_id'); + $select = $dbh->select()->from($roleTable) + ->where('parent_id = :parent_id') + ->where('user_type = :user_type') + ->where('user_id = :user_id'); return $dbh->fetchCol($select, $binds); } else { From 1865c1407a84b1b2a450a90a0c17228c088a7548 Mon Sep 17 00:00:00 2001 From: brywaters Date: Fri, 10 Jun 2016 13:03:11 -0500 Subject: [PATCH 274/345] MAGETWO-54228: Varnish cache disabled on most html requests - Updated varnish config file --- app/code/Magento/PageCache/etc/varnish4.vcl | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/PageCache/etc/varnish4.vcl b/app/code/Magento/PageCache/etc/varnish4.vcl index 49a8fe1585519..58d22bbcb8e33 100644 --- a/app/code/Magento/PageCache/etc/varnish4.vcl +++ b/app/code/Magento/PageCache/etc/varnish4.vcl @@ -41,8 +41,8 @@ sub vcl_recv { return (pass); } - # Bypass shopping cart and checkout requests - if (req.url ~ "/checkout") { + # Bypass shopping cart and checkout and search requests + if (req.url ~ "/checkout" || req.url ~ "/catalogsearch") { return (pass); } @@ -136,6 +136,18 @@ sub vcl_backend_response { set beresp.grace = 1m; } } + + #If page is not cacheable then bypass varnish for 2 minutes as Hit-For-Pass + if (beresp.ttl <= 0s || + beresp.http.Surrogate-control ~ "no-store" || + (!beresp.http.Surrogate-Control && beresp.http.Vary == "*")) { + /* + * Mark as "Hit-For-Pass" for the next 2 minutes + */ + set beresp.ttl = 120s; + set beresp.uncacheable = true; + } + return (deliver); } sub vcl_deliver { From a48309c5fb7c577c6e54c2fdf5d61540dd428ba9 Mon Sep 17 00:00:00 2001 From: brywaters Date: Fri, 10 Jun 2016 13:10:24 -0500 Subject: [PATCH 275/345] MAGETWO-54228: Varnish cache disabled on most html requests - fixed indentation and comments on vcl --- app/code/Magento/PageCache/etc/varnish4.vcl | 24 ++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/app/code/Magento/PageCache/etc/varnish4.vcl b/app/code/Magento/PageCache/etc/varnish4.vcl index 58d22bbcb8e33..73d3b5ed42887 100644 --- a/app/code/Magento/PageCache/etc/varnish4.vcl +++ b/app/code/Magento/PageCache/etc/varnish4.vcl @@ -41,7 +41,7 @@ sub vcl_recv { return (pass); } - # Bypass shopping cart and checkout and search requests + # Bypass shopping cart, checkout and search requests if (req.url ~ "/checkout" || req.url ~ "/catalogsearch") { return (pass); } @@ -137,17 +137,17 @@ sub vcl_backend_response { } } - #If page is not cacheable then bypass varnish for 2 minutes as Hit-For-Pass - if (beresp.ttl <= 0s || - beresp.http.Surrogate-control ~ "no-store" || - (!beresp.http.Surrogate-Control && beresp.http.Vary == "*")) { - /* - * Mark as "Hit-For-Pass" for the next 2 minutes - */ - set beresp.ttl = 120s; - set beresp.uncacheable = true; - } - return (deliver); + #If page is not cacheable then bypass varnish for 2 minutes as Hit-For-Pass + if (beresp.ttl <= 0s || + beresp.http.Surrogate-control ~ "no-store" || + (!beresp.http.Surrogate-Control && beresp.http.Vary == "*")) { + /* + * Mark as "Hit-For-Pass" for the next 2 minutes + */ + set beresp.ttl = 120s; + set beresp.uncacheable = true; + } + return (deliver); } sub vcl_deliver { From 1716f16eb8170e91bf4974a701ca5911eeeb3347 Mon Sep 17 00:00:00 2001 From: Igor Melnikov Date: Fri, 10 Jun 2016 15:37:54 -0500 Subject: [PATCH 276/345] MAGETWO-54120: Installation fails Removing magento-hackathon/magento-composer-installer from replace section --- composer.json | 3 +-- composer.lock | 17 ++++++++++------- .../Magento/Test/Integrity/ComposerTest.php | 4 ---- .../_files/blacklist/missing_components.txt | 1 - 4 files changed, 11 insertions(+), 14 deletions(-) delete mode 100644 dev/tests/static/testsuite/Magento/Test/Integrity/_files/blacklist/missing_components.txt diff --git a/composer.json b/composer.json index 22b8c98354a6d..708f4089454a7 100644 --- a/composer.json +++ b/composer.json @@ -194,8 +194,7 @@ "blueimp/jquery-file-upload": "5.6.14", "components/jqueryui": "1.10.4", "twbs/bootstrap": "3.1.0", - "tinymce/tinymce": "3.4.7", - "magento-hackathon/magento-composer-installer": "*" + "tinymce/tinymce": "3.4.7" }, "extra": { "component_paths": { diff --git a/composer.lock b/composer.lock index a3c12c6721b11..7831e25162f52 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "4b506e9d5ccb146e8bc9ccd3faeaf326", - "content-hash": "55b9016c4626d466c655c75be44479d4", + "hash": "4aadd259bcd32c913113b3d9e5002543", + "content-hash": "cdd9bfe776bcf1291c819122d3cbc6b1", "packages": [ { "name": "braintree/braintree_php", @@ -554,21 +554,24 @@ }, { "name": "magento/magento-composer-installer", - "version": "0.1.9", + "version": "0.1.10", "source": { "type": "git", "url": "https://github.com/magento/magento-composer-installer.git", - "reference": "109eedd74dc94ffe77e71bf91d594f6fa95dd33e" + "reference": "29df8c84494e3592cf999d9cbadf15220a003ff1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/magento/magento-composer-installer/zipball/109eedd74dc94ffe77e71bf91d594f6fa95dd33e", - "reference": "109eedd74dc94ffe77e71bf91d594f6fa95dd33e", + "url": "https://api.github.com/repos/magento/magento-composer-installer/zipball/29df8c84494e3592cf999d9cbadf15220a003ff1", + "reference": "29df8c84494e3592cf999d9cbadf15220a003ff1", "shasum": "" }, "require": { "composer-plugin-api": "^1.0" }, + "replace": { + "magento-hackathon/magento-composer-installer": "*" + }, "require-dev": { "composer/composer": "*@dev", "firegento/phpcs": "dev-patch-1", @@ -626,7 +629,7 @@ "composer-installer", "magento" ], - "time": "2016-05-24 16:22:26" + "time": "2016-06-10 16:59:12" }, { "name": "magento/zendframework1", diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php index 542a679cf08bf..6b2f339f43d10 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php @@ -341,11 +341,7 @@ public function testComponentPathsInRoot() "The {$component} is specified in 'extra->component_paths', but missing in 'replace' section" ); } - $allowedMissingComponents = file(__DIR__ . '/_files/blacklist/missing_components.txt'); foreach (array_keys(self::$rootJson['replace']) as $replace) { - if (in_array($replace, $allowedMissingComponents)) { - continue; - } if (!MagentoComponent::matchMagentoComponent($replace)) { $this->assertArrayHasKey( $replace, diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/_files/blacklist/missing_components.txt b/dev/tests/static/testsuite/Magento/Test/Integrity/_files/blacklist/missing_components.txt deleted file mode 100644 index 76a0540cbd071..0000000000000 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/_files/blacklist/missing_components.txt +++ /dev/null @@ -1 +0,0 @@ -magento-hackathon/magento-composer-installer \ No newline at end of file From 8ac29f0ac84653e5196c176e7083f9f5abae7316 Mon Sep 17 00:00:00 2001 From: brywaters Date: Fri, 10 Jun 2016 15:49:37 -0500 Subject: [PATCH 277/345] MAGETWO-54228: Varnish cache disabled on most html requests - Added catalogsearch exclusion to varnish3.vcl - Cleaned up comments on varnish4.vcl --- app/code/Magento/PageCache/etc/varnish3.vcl | 4 ++-- app/code/Magento/PageCache/etc/varnish4.vcl | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/PageCache/etc/varnish3.vcl b/app/code/Magento/PageCache/etc/varnish3.vcl index 763e462756d94..feb4d7c14df56 100644 --- a/app/code/Magento/PageCache/etc/varnish3.vcl +++ b/app/code/Magento/PageCache/etc/varnish3.vcl @@ -49,8 +49,8 @@ sub vcl_recv { return (pass); } - # Bypass shopping cart and checkout requests - if (req.url ~ "/checkout") { + # Bypass shopping cart, checkout and search requests + if (req.url ~ "/checkout" || req.url ~ "/catalogsearch") { return (pass); } diff --git a/app/code/Magento/PageCache/etc/varnish4.vcl b/app/code/Magento/PageCache/etc/varnish4.vcl index 73d3b5ed42887..dafeefbe5b5b7 100644 --- a/app/code/Magento/PageCache/etc/varnish4.vcl +++ b/app/code/Magento/PageCache/etc/varnish4.vcl @@ -137,13 +137,11 @@ sub vcl_backend_response { } } - #If page is not cacheable then bypass varnish for 2 minutes as Hit-For-Pass + # If page is not cacheable then bypass varnish for 2 minutes as Hit-For-Pass if (beresp.ttl <= 0s || beresp.http.Surrogate-control ~ "no-store" || (!beresp.http.Surrogate-Control && beresp.http.Vary == "*")) { - /* - * Mark as "Hit-For-Pass" for the next 2 minutes - */ + # Mark as Hit-For-Pass for the next 2 minutes set beresp.ttl = 120s; set beresp.uncacheable = true; } From 339609da24193522e2ca52ccd3cdce99448a344a Mon Sep 17 00:00:00 2001 From: Ankur Kaneria Date: Fri, 10 Jun 2016 16:52:11 -0500 Subject: [PATCH 278/345] MAGETWO-54205: After Disable/Enable Magento modules via CLI all cache types become disabled --- .../Framework/App/ObjectManagerFactory.php | 2 +- .../Magento/Framework/Code/GeneratedFiles.php | 108 +++++++++++++----- .../Code/Test/Unit/GeneratedFilesTest.php | 15 +-- .../Setup/Console/Command/UpgradeCommand.php | 1 + 4 files changed, 90 insertions(+), 36 deletions(-) diff --git a/lib/internal/Magento/Framework/App/ObjectManagerFactory.php b/lib/internal/Magento/Framework/App/ObjectManagerFactory.php index 1b84ed9bb008b..ddff84be4a177 100644 --- a/lib/internal/Magento/Framework/App/ObjectManagerFactory.php +++ b/lib/internal/Magento/Framework/App/ObjectManagerFactory.php @@ -111,7 +111,7 @@ public function create(array $arguments) { $writeFactory = new \Magento\Framework\Filesystem\Directory\WriteFactory($this->driverPool); $generatedFiles = new GeneratedFiles($this->directoryList, $writeFactory); - $generatedFiles->regenerate(); + $generatedFiles->cleanGeneratedFiles(); $deploymentConfig = $this->createDeploymentConfig($this->directoryList, $this->configFilePool, $arguments); $arguments = array_merge($deploymentConfig->get(), $arguments); diff --git a/lib/internal/Magento/Framework/Code/GeneratedFiles.php b/lib/internal/Magento/Framework/Code/GeneratedFiles.php index ec6e43b8c67f1..dde846e4f2222 100644 --- a/lib/internal/Magento/Framework/Code/GeneratedFiles.php +++ b/lib/internal/Magento/Framework/Code/GeneratedFiles.php @@ -5,7 +5,6 @@ */ namespace Magento\Framework\Code; -use Magento\Framework\Config\Data\ConfigData; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\Config\File\ConfigFilePool; use Magento\Framework\Filesystem\Directory\WriteFactory; @@ -45,54 +44,70 @@ public function __construct(DirectoryList $directoryList, WriteFactory $writeFac } /** - * Clean generated code and DI configuration + * Clean var/generation, var/di and var/cache * * @return void */ - public function regenerate() + public function cleanGeneratedFiles() { if ($this->write->isExist(self::REGENERATE_FLAG)) { + //TODO: to be removed in scope of MAGETWO-53476 - //clean cache $deploymentConfig = $this->directoryList->getPath(DirectoryList::CONFIG); $configPool = new ConfigFilePool(); $envPath = $deploymentConfig . '/' . $configPool->getPath(ConfigFilePool::APP_ENV); if ($this->write->isExist($this->write->getRelativePath($envPath))) { - $this->saveCacheStatus($envPath); + $this->saveCacheConfiguration($envPath); + $this->disableAllCacheTypes($envPath); } //TODO: Till here + $cachePath = $this->write->getRelativePath($this->directoryList->getPath(DirectoryList::CACHE)); $generationPath = $this->write->getRelativePath($this->directoryList->getPath(DirectoryList::GENERATION)); $diPath = $this->write->getRelativePath($this->directoryList->getPath(DirectoryList::DI)); + // Clean var/generation dir if ($this->write->isDirectory($generationPath)) { $this->write->delete($generationPath); } + + // Clean var/di if ($this->write->isDirectory($diPath)) { $this->write->delete($diPath); } + + // Clean var/cache if ($this->write->isDirectory($cachePath)) { $this->write->delete($cachePath); } - //add to queue - $this->write->delete(self::REGENERATE_FLAG); + $this->reEnableCacheTypes($envPath); } } /** - * Read Cache types from env.php and write to a json file. + * Create flag for cleaning up var/generation, var/di and var/cache directories for subsequent + * regeneration of this content + * + * @return void + */ + public function requestRegeneration() + { + $this->write->touch(self::REGENERATE_FLAG); + } + + /** + * Read Cache configuration from env.php and write to a json file. * * @param string $envPath * @return void */ - private function saveCacheStatus($envPath) + private function saveCacheConfiguration($envPath) { - $cacheData = include $envPath; + $envData = include $envPath; - if (isset($cacheData['cache_types'])) { - $enabledCacheTypes = $cacheData['cache_types']; - $enabledCacheTypes = array_filter($enabledCacheTypes, function ($value) { + if (isset($envData['cache_types'])) { + $enabledCacheTypes = array_filter($envData['cache_types'], function ($value) { return $value; }); if (!empty($enabledCacheTypes)) { @@ -101,32 +116,69 @@ private function saveCacheStatus($envPath) $this->write->getRelativePath($varDir) . '/.cachestates.json', json_encode($enabledCacheTypes) ); - $cacheTypes = array_keys($cacheData['cache_types']); + } + } + } - foreach ($cacheTypes as $cacheType) { - $cacheData['cache_types'][$cacheType] = 0; - } + /** + * Disable all cache types by updating env.php. + * + * @param string $envPath + * @return void + */ + private function disableAllCacheTypes($envPath) + { + $envData = include $envPath; - $formatter = new PhpFormatter(); - $contents = $formatter->format($cacheData); + if (isset($envData['cache_types'])) { + $cacheTypes = array_keys($envData['cache_types']); - $this->write->writeFile($this->write->getRelativePath($envPath), $contents); - if (function_exists('opcache_invalidate')) { - opcache_invalidate( - $this->write->getAbsolutePath($envPath) - ); - } + foreach ($cacheTypes as $cacheType) { + $envData['cache_types'][$cacheType] = 0; + } + + $formatter = new PhpFormatter(); + $contents = $formatter->format($envData); + + $this->write->writeFile($this->write->getRelativePath($envPath), $contents); + if (function_exists('opcache_invalidate')) { + opcache_invalidate( + $this->write->getAbsolutePath($envPath) + ); } } } /** - * Create flag for regeneration of code and di + * Enables appropriate cache types based on var/.cachestates file settings + * TODO: to be removed in scope of MAGETWO-53476 * * @return void */ - public function requestRegeneration() + private function reEnableCacheTypes($envPath) { - $this->write->touch(self::REGENERATE_FLAG); + $pathToCacheStatus = $this->write->getRelativePath( + $this->directoryList->getPath(DirectoryList::VAR_DIR) . '/.cachestates.json' + ); + + if ($this->write->isExist($pathToCacheStatus)) { + $enabledCacheTypes = array_keys(json_decode($this->write->readFile($pathToCacheStatus), true)); + + $envData = include $envPath; + foreach ($enabledCacheTypes as $cacheType) { + $envData['cache_types'][$cacheType] = 1; + } + + $formatter = new PhpFormatter(); + $contents = $formatter->format($envData); + + $this->write->writeFile($this->write->getRelativePath($envPath), $contents); + if (function_exists('opcache_invalidate')) { + opcache_invalidate( + $this->write->getAbsolutePath($envPath) + ); + } + $this->write->delete($pathToCacheStatus); + } } } diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/GeneratedFilesTest.php b/lib/internal/Magento/Framework/Code/Test/Unit/GeneratedFilesTest.php index 4fef046786871..5d5f7178ed909 100644 --- a/lib/internal/Magento/Framework/Code/Test/Unit/GeneratedFilesTest.php +++ b/lib/internal/Magento/Framework/Code/Test/Unit/GeneratedFilesTest.php @@ -45,9 +45,9 @@ protected function setUp() * @param array $getPathMap * @param array $isDirectoryMap * @param array $deleteMap - * @dataProvider regenerateDataProvider + * @dataProvider cleanGeneratedFilesDataProvider */ - public function testRegenerate($getPathMap, $isDirectoryMap, $deleteMap) + public function testCleanGeneratedFiles($getPathMap, $isDirectoryMap, $deleteMap) { $this->writeInterface @@ -62,20 +62,21 @@ public function testRegenerate($getPathMap, $isDirectoryMap, $deleteMap) $this->writeInterface->expects($this->any())->method('getRelativePath')->willReturnMap($getPathMap); $this->writeInterface->expects($this->any())->method('isDirectory')->willReturnMap($isDirectoryMap); $this->writeInterface->expects($this->exactly(1))->method('delete')->willReturnMap($deleteMap); - $this->model->regenerate(); + $this->model->cleanGeneratedFiles(); } /** * @return array */ - public function regenerateDataProvider() + public function cleanGeneratedFilesDataProvider() { $pathToGeneration = 'path/to/generation'; $pathToDi = 'path/to/di'; $pathToCache = 'path/to/di'; $pathToConfig = 'path/to/config'; - $getPathMap = [[DirectoryList::GENERATION, $pathToGeneration], + $getPathMap = [ + [DirectoryList::GENERATION, $pathToGeneration], [DirectoryList::DI, $pathToDi], [DirectoryList::CACHE, $pathToCache], [DirectoryList::CONFIG, $pathToConfig], @@ -98,7 +99,7 @@ public function regenerateDataProvider() ]; } - public function testRegenerateWithNoFlag() + public function testCleanGeneratedFilesWithNoFlag() { $this->writeInterface ->expects($this->once()) @@ -108,7 +109,7 @@ public function testRegenerateWithNoFlag() $this->directoryList->expects($this->never())->method('getPath'); $this->writeInterface->expects($this->never())->method('getPath'); $this->writeInterface->expects($this->never())->method('delete'); - $this->model->regenerate(); + $this->model->cleanGeneratedFiles(); } public function testRequestRegeneration() diff --git a/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php b/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php index 17d86ef9bad58..be584a1717176 100644 --- a/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php +++ b/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php @@ -112,6 +112,7 @@ protected function execute(InputInterface $input, OutputInterface $output) private function enableCaches($objectManager, $output) { $writeFactory = $objectManager->get('Magento\Framework\Filesystem\Directory\WriteFactory'); + /** @var \Magento\Framework\Filesystem\Directory\Write $write */ $write = $writeFactory->create(BP); /** @var \Magento\Framework\App\Filesystem\DirectoryList $dirList */ $dirList = $objectManager->get('Magento\Framework\App\Filesystem\DirectoryList'); From b4d470da0a298b3866b4f63fa6bf5dd4f7211faf Mon Sep 17 00:00:00 2001 From: Yaroslav Onischenko Date: Sat, 11 Jun 2016 09:21:28 +0300 Subject: [PATCH 279/345] MAGETWO-53170: Add/Remove product actions are not observed by update cart qty event --- app/code/Magento/Checkout/CustomerData/DefaultItem.php | 1 + .../view/frontend/web/template/minicart/item/default.html | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Checkout/CustomerData/DefaultItem.php b/app/code/Magento/Checkout/CustomerData/DefaultItem.php index 887928ab34dda..86f3afca00f40 100644 --- a/app/code/Magento/Checkout/CustomerData/DefaultItem.php +++ b/app/code/Magento/Checkout/CustomerData/DefaultItem.php @@ -71,6 +71,7 @@ protected function doGetItemData() 'configure_url' => $this->getConfigureUrl(), 'is_visible_in_site_visibility' => $this->item->getProduct()->isVisibleInSiteVisibility(), 'product_name' => $this->item->getProduct()->getName(), + 'product_sku' => $this->item->getProduct()->getSku(), 'product_url' => $this->getProductUrl(), 'product_has_url' => $this->hasProductUrl(), 'product_price' => $this->checkoutHelper->formatPrice($this->item->getCalculationPrice()), diff --git a/app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html b/app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html index 3b28ffae14603..7fb56e9c4441b 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html @@ -74,7 +74,8 @@ Date: Wed, 8 Jun 2016 15:44:55 +0300 Subject: [PATCH 280/345] MAGETWO-54073: Stabilize Sample Data functional tests --- .../tests/app/Magento/Catalog/Test/Block/Product/View.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View.php index 93cf5d643a510..9005da1a7a42e 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View.php @@ -189,6 +189,11 @@ class View extends AbstractConfigureBlock */ protected $baseImage = '[data-gallery-role="gallery"] img.fotorama__img.fotorama__img'; + /** + * @var string + */ + protected $galleryLoader = '.fotorama__spinner--show'; + /** * Video Container selector * @@ -499,6 +504,7 @@ public function waitLoader() */ public function isGalleryVisible() { + $this->waitForElementNotVisible($this->galleryLoader); return $this->_rootElement->find($this->mediaGallery)->isVisible(); } @@ -509,6 +515,7 @@ public function isGalleryVisible() */ public function isFullImageVisible() { + $this->waitForElementNotVisible($this->galleryLoader); return $this->browser->find($this->fullImage)->isVisible(); } From 6ccada9bb823d9034e89e2a593a8b23920a68a04 Mon Sep 17 00:00:00 2001 From: Ievgen Sentiabov Date: Sat, 11 Jun 2016 10:01:07 +0300 Subject: [PATCH 281/345] MAGETWO-54214: Order can't be placed via Payflow Pro payment method - Added assignData method for Payflow Pro model --- app/code/Magento/Paypal/Model/Payflowpro.php | 41 ++++++++++++++++--- .../Paypal/Test/Unit/Model/PayflowproTest.php | 32 +++++++++++++++ 2 files changed, 67 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Paypal/Model/Payflowpro.php b/app/code/Magento/Paypal/Model/Payflowpro.php index e8a2c326de486..ec96cb19c5937 100644 --- a/app/code/Magento/Paypal/Model/Payflowpro.php +++ b/app/code/Magento/Paypal/Model/Payflowpro.php @@ -8,18 +8,17 @@ use Magento\Framework\DataObject; use Magento\Framework\Exception\LocalizedException; use Magento\Payment\Model\InfoInterface; +use Magento\Payment\Model\Method\ConfigInterface; use Magento\Payment\Model\Method\ConfigInterfaceFactory; +use Magento\Payment\Model\Method\Online\GatewayInterface; +use Magento\Payment\Observer\AbstractDataAssignObserver; +use Magento\Paypal\Model\Config; use Magento\Paypal\Model\Payflow\Service\Gateway; use Magento\Paypal\Model\Payflow\Service\Response\Handler\HandlerInterface; -use Magento\Paypal\Model\Payflow\Transparent; use Magento\Quote\Model\Quote; -use Magento\Sales\Model\Order\Payment; -use Magento\Payment\Model\Method\Online\GatewayInterface; -use Magento\Payment\Model\Method\ConfigInterface; -use Magento\Paypal\Model\Config; use Magento\Sales\Model\Order; +use Magento\Sales\Model\Order\Payment; use Magento\Store\Model\ScopeInterface; -use Magento\Vault\Api\Data\PaymentTokenInterface; /** * Payflow Pro payment gateway model @@ -861,6 +860,36 @@ public function addRequestOrderInfo(DataObject $request, Order $order) ->setComment1($orderIncrementId); } + /** + * Assign data to info model instance + * + * @param array|DataObject $data + * @return $this + * @throws \Magento\Framework\Exception\LocalizedException + */ + public function assignData(DataObject $data) + { + $this->_eventManager->dispatch( + 'payment_method_assign_data_' . $this->getCode(), + [ + AbstractDataAssignObserver::METHOD_CODE => $this, + AbstractDataAssignObserver::MODEL_CODE => $this->getInfoInstance(), + AbstractDataAssignObserver::DATA_CODE => $data + ] + ); + + $this->_eventManager->dispatch( + 'payment_method_assign_data', + [ + AbstractDataAssignObserver::METHOD_CODE => $this, + AbstractDataAssignObserver::MODEL_CODE => $this->getInfoInstance(), + AbstractDataAssignObserver::DATA_CODE => $data + ] + ); + + return $this; + } + /** * @param InfoInterface $payment * @param string $transactionId diff --git a/app/code/Magento/Paypal/Test/Unit/Model/PayflowproTest.php b/app/code/Magento/Paypal/Test/Unit/Model/PayflowproTest.php index 5c899714253fa..eb59cf44a13c5 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/PayflowproTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/PayflowproTest.php @@ -11,10 +11,12 @@ use Magento\Framework\DataObject; use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Event\ManagerInterface; use Magento\Payment\Model\Method\ConfigInterface; use Magento\Paypal\Model\Config; use Magento\Paypal\Model\Payflowpro; use Magento\Store\Model\ScopeInterface; +use Magento\Payment\Model\InfoInterface; /** * Class PayflowproTest @@ -54,6 +56,11 @@ class PayflowproTest extends \PHPUnit_Framework_TestCase */ protected $scopeConfigMock; + /** + * @var ManagerInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $eventManager; + protected function setUp() { $configFactoryMock = $this->getMock( @@ -114,10 +121,13 @@ protected function setUp() $clientFactory = $this->getMock('Magento\Framework\HTTP\ZendClientFactory', ['create'], [], '', false); $clientFactory->expects($this->any())->method('create')->will($this->returnValue($client)); + $this->eventManager = $this->getMockForAbstractClass(ManagerInterface::class); + $this->helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->payflowpro = $this->helper->getObject( 'Magento\Paypal\Model\Payflowpro', [ + 'eventDispatcher' => $this->eventManager, 'configFactory' => $configFactoryMock, 'httpClientFactory' => $clientFactory, 'storeManager' => $this->storeManagerMock, @@ -498,4 +508,26 @@ public function testPostRequestException() $this->payflowpro->postRequest($request, $config); } + + /** + * @covers \Magento\Paypal\Model\Payflowpro::assignData + */ + public function testAssignData() + { + $data = [ + 'cc_type' => 'VI', + 'cc_last_4' => 1111, + 'cc_exp_month' => 12, + 'cc_exp_year' => 2023 + ]; + $dataObject = new DataObject($data); + + $infoInstance = $this->getMockForAbstractClass(InfoInterface::class); + $this->payflowpro->setData('info_instance', $infoInstance); + + $this->eventManager->expects(static::exactly(2)) + ->method('dispatch'); + + $this->payflowpro->assignData($dataObject); + } } From 8979c2deaaedd5cc31c8a483b5081927b57ba5c0 Mon Sep 17 00:00:00 2001 From: Yaroslav Onischenko Date: Sat, 11 Jun 2016 11:02:03 +0300 Subject: [PATCH 282/345] MAGETWO-53170: Add/Remove product actions are not observed by update cart qty event --- .../Unit/CustomerData/DefaultItemTest.php | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 app/code/Magento/Checkout/Test/Unit/CustomerData/DefaultItemTest.php diff --git a/app/code/Magento/Checkout/Test/Unit/CustomerData/DefaultItemTest.php b/app/code/Magento/Checkout/Test/Unit/CustomerData/DefaultItemTest.php new file mode 100644 index 0000000000000..fcd9bf310144a --- /dev/null +++ b/app/code/Magento/Checkout/Test/Unit/CustomerData/DefaultItemTest.php @@ -0,0 +1,92 @@ +imageHelper = $this->getMockBuilder(\Magento\Catalog\Helper\Image::class) + ->disableOriginalConstructor() + ->getMock(); + $this->configurationPool = $this->getMockBuilder(\Magento\Catalog\Helper\Product\ConfigurationPool::class) + ->setMethods([]) + ->disableOriginalConstructor() + ->getMock(); + $checkoutHelper = $this->getMockBuilder(\Magento\Checkout\Helper\Data::class) + ->setMethods(['formatPrice'])->disableOriginalConstructor()->getMock(); + $checkoutHelper->expects($this->any())->method('formatPrice')->willReturn(5); + $this->model = $objectManager->getObject( + \Magento\Checkout\CustomerData\DefaultItem::class, + [ + 'imageHelper' => $this->imageHelper, + 'configurationPool' => $this->configurationPool, + 'checkoutHelper' => $checkoutHelper + ] + ); + } + + public function testGetItemData() + { + $urlModel = $this->getMockBuilder(\Magento\Catalog\Model\Product\Url::class) + ->disableOriginalConstructor() + ->getMock(); + $product = $this->getMockBuilder(\Magento\Catalog\Model\Product::class) + ->setMethods(['getUrlModel', 'isVisibleInSiteVisibility', 'getSku']) + ->disableOriginalConstructor() + ->getMock(); + $product->expects($this->any())->method('getUrlModel')->willReturn($urlModel); + $product->expects($this->any())->method('isVisibleInSiteVisibility')->willReturn(true); + $product->expects($this->any())->method('getSku')->willReturn('simple'); + /** @var \Magento\Quote\Model\Quote\Item $item */ + $item = $this->getMockBuilder(\Magento\Quote\Model\Quote\Item::class) + ->setMethods(['getProductType', 'getProduct', 'getCalculationPrice']) + ->disableOriginalConstructor() + ->getMock(); + $item->expects($this->any())->method('getProduct')->willReturn($product); + $item->expects($this->any())->method('getProductType')->willReturn('simple'); + $item->expects($this->any())->method('getCalculationPrice')->willReturn(5); + + $this->imageHelper->expects($this->any())->method('init')->with($product)->willReturnSelf(); + $this->imageHelper->expects($this->any())->method('getUrl')->willReturn('url'); + $this->imageHelper->expects($this->any())->method('getLabel')->willReturn('label'); + $this->imageHelper->expects($this->any())->method('getWidth')->willReturn(100); + $this->imageHelper->expects($this->any())->method('getHeight')->willReturn(100); + $this->configurationPool->expects($this->any())->method('getByProductType')->willReturn($product); + + $itemData = $this->model->getItemData($item); + $this->assertArrayHasKey('options', $itemData); + $this->assertArrayHasKey('qty', $itemData); + $this->assertArrayHasKey('item_id', $itemData); + $this->assertArrayHasKey('configure_url', $itemData); + $this->assertArrayHasKey('is_visible_in_site_visibility', $itemData); + $this->assertArrayHasKey('product_type', $itemData); + $this->assertArrayHasKey('product_name', $itemData); + $this->assertArrayHasKey('product_sku', $itemData); + $this->assertArrayHasKey('product_url', $itemData); + $this->assertArrayHasKey('product_has_url', $itemData); + $this->assertArrayHasKey('product_price', $itemData); + $this->assertArrayHasKey('product_image', $itemData); + $this->assertArrayHasKey('canApplyMsrp', $itemData); + } +} + From 6a1d203245dfa991b705621d2904e84b563b28e5 Mon Sep 17 00:00:00 2001 From: Yaroslav Onischenko Date: Sat, 11 Jun 2016 11:04:26 +0300 Subject: [PATCH 283/345] MAGETWO-53170: Add/Remove product actions are not observed by update cart qty event --- .../view/frontend/web/template/minicart/item/default.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html b/app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html index 7fb56e9c4441b..89789996e5248 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html @@ -75,7 +75,7 @@ id: 'cart-item-'+item_id+'-qty', 'data-cart-item': item_id, 'data-item-qty': qty, - 'data-cart-item-id': product_sku + 'data-cart-item-id': product_sku }, value: qty" type="number" size="4" From 7f46ba4dddefcefc6f9a2e9943408583a9c813ca Mon Sep 17 00:00:00 2001 From: Anton Kaplya Date: Sat, 11 Jun 2016 12:37:29 +0300 Subject: [PATCH 284/345] MAGETWO-53424: Added additional arguments into attributes creation --- app/code/Magento/Store/Model/StoreScopeProvider.php | 6 +++++- .../CatalogRule/Model/Indexer/IndexerBuilderTest.php | 9 ++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Store/Model/StoreScopeProvider.php b/app/code/Magento/Store/Model/StoreScopeProvider.php index 1054b6bca4105..31c966a4c05cc 100644 --- a/app/code/Magento/Store/Model/StoreScopeProvider.php +++ b/app/code/Magento/Store/Model/StoreScopeProvider.php @@ -50,7 +50,11 @@ public function getContext($entityType, $entityData = []) if (isset($entityData[Store::STORE_ID])) { $value = $entityData[Store::STORE_ID]; } else { - $value = (int)$this->storeManager->getStore(true)->getId(); + if ($this->storeManager->hasSingleStore()) { + $value = Store::DEFAULT_STORE_ID; + } else { + $value = (int)$this->storeManager->getStore(true)->getId(); + } } $identifier = Store::STORE_ID; diff --git a/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/IndexerBuilderTest.php b/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/IndexerBuilderTest.php index 9ca08d62c0005..4e200586ce213 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/IndexerBuilderTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/IndexerBuilderTest.php @@ -99,11 +99,10 @@ public function testReindexFull() $this->indexerBuilder->reindexFull(); - $this->assertEquals(9.8, $this->resourceRule->getRulePrice(new \DateTime(), 1, 1, $this->product->getId())); - $this->assertEquals( - 9.8, - $this->resourceRule->getRulePrice(new \DateTime(), 1, 1, $this->productSecond->getId()) - ); + $rulePrice = $this->resourceRule->getRulePrice(new \DateTime(), 1, 1, $this->product->getId()); + $this->assertEquals(9.8, $rulePrice); + $rulePrice = $this->resourceRule->getRulePrice(new \DateTime(), 1, 1, $this->productSecond->getId()); + $this->assertEquals(9.8, $rulePrice); $this->assertFalse($this->resourceRule->getRulePrice(new \DateTime(), 1, 1, $this->productThird->getId())); } From 67a48c4e5ace3e8208ac502e23bd426a438eabc9 Mon Sep 17 00:00:00 2001 From: Yaroslav Onischenko Date: Sat, 11 Jun 2016 14:52:01 +0300 Subject: [PATCH 285/345] MAGETWO-53170: Add/Remove product actions are not observed by update cart qty event --- app/code/Magento/Checkout/CustomerData/DefaultItem.php | 1 + .../Magento/Checkout/Test/Unit/CustomerData/DefaultItemTest.php | 1 + 2 files changed, 2 insertions(+) diff --git a/app/code/Magento/Checkout/CustomerData/DefaultItem.php b/app/code/Magento/Checkout/CustomerData/DefaultItem.php index 86f3afca00f40..4cdc4c59b9726 100644 --- a/app/code/Magento/Checkout/CustomerData/DefaultItem.php +++ b/app/code/Magento/Checkout/CustomerData/DefaultItem.php @@ -75,6 +75,7 @@ protected function doGetItemData() 'product_url' => $this->getProductUrl(), 'product_has_url' => $this->hasProductUrl(), 'product_price' => $this->checkoutHelper->formatPrice($this->item->getCalculationPrice()), + 'product_price_value' => $this->item->getCalculationPrice(), 'product_image' => [ 'src' => $imageHelper->getUrl(), 'alt' => $imageHelper->getLabel(), diff --git a/app/code/Magento/Checkout/Test/Unit/CustomerData/DefaultItemTest.php b/app/code/Magento/Checkout/Test/Unit/CustomerData/DefaultItemTest.php index fcd9bf310144a..dc28f1d46de4d 100644 --- a/app/code/Magento/Checkout/Test/Unit/CustomerData/DefaultItemTest.php +++ b/app/code/Magento/Checkout/Test/Unit/CustomerData/DefaultItemTest.php @@ -85,6 +85,7 @@ public function testGetItemData() $this->assertArrayHasKey('product_url', $itemData); $this->assertArrayHasKey('product_has_url', $itemData); $this->assertArrayHasKey('product_price', $itemData); + $this->assertArrayHasKey('product_price_value', $itemData); $this->assertArrayHasKey('product_image', $itemData); $this->assertArrayHasKey('canApplyMsrp', $itemData); } From 3bcdd349c770aa1fe6218b98f1f088975b7f8684 Mon Sep 17 00:00:00 2001 From: Roman Ganin Date: Sat, 11 Jun 2016 17:44:17 +0300 Subject: [PATCH 286/345] MAGETWO-54211: Downloadable product has direct link in category after update applied --- .../ProductProcessUrlRewriteSavingObserver.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserver.php b/app/code/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserver.php index 2b7bfe017455b..6639437eab449 100644 --- a/app/code/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserver.php +++ b/app/code/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserver.php @@ -47,17 +47,18 @@ public function execute(\Magento\Framework\Event\Observer $observer) $product = $observer->getEvent()->getProduct(); $isChangedWebsites = $product->getIsChangedWebsites(); - if ($product->dataHasChangedFor('url_key') || $product->getIsChangedCategories() || $isChangedWebsites - || $product->dataHasChangedFor('visibility')) { - if ($isChangedWebsites) { + if ($product->dataHasChangedFor('url_key') + || $product->getIsChangedCategories() + || $isChangedWebsites + || $product->dataHasChangedFor('visibility') + ) { $this->urlPersist->deleteByData([ UrlRewrite::ENTITY_ID => $product->getId(), UrlRewrite::ENTITY_TYPE => ProductUrlRewriteGenerator::ENTITY_TYPE, ]); - } - if (!in_array($product->getOrigData('visibility'), $product->getVisibleInSiteVisibilities())) { - $this->urlPersist->replace($this->productUrlRewriteGenerator->generate($product)); - } + if (in_array($product->getVisibility(), $product->getVisibleInSiteVisibilities())) { + $this->urlPersist->replace($this->productUrlRewriteGenerator->generate($product)); + } } } } From b9b9d5ee6cda623d1e07c425e5940f951607135b Mon Sep 17 00:00:00 2001 From: Anton Kaplya Date: Sat, 11 Jun 2016 17:46:21 +0300 Subject: [PATCH 287/345] MAGETWO-53424: Added additional arguments into attributes creation --- app/code/Magento/Store/Model/StoreScopeProvider.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Store/Model/StoreScopeProvider.php b/app/code/Magento/Store/Model/StoreScopeProvider.php index 31c966a4c05cc..84e6df92b5340 100644 --- a/app/code/Magento/Store/Model/StoreScopeProvider.php +++ b/app/code/Magento/Store/Model/StoreScopeProvider.php @@ -50,11 +50,12 @@ public function getContext($entityType, $entityData = []) if (isset($entityData[Store::STORE_ID])) { $value = $entityData[Store::STORE_ID]; } else { - if ($this->storeManager->hasSingleStore()) { - $value = Store::DEFAULT_STORE_ID; - } else { - $value = (int)$this->storeManager->getStore(true)->getId(); - } +// if ($this->storeManager->hasSingleStore()) { +// $value = Store::DEFAULT_STORE_ID; +// } else { +// $value = (int)$this->storeManager->getStore(true)->getId(); +// } + $value = (int)$this->storeManager->getStore(true)->getId(); } $identifier = Store::STORE_ID; From 7ed3a7d45a0b20735a48e676cb0708766a2320e4 Mon Sep 17 00:00:00 2001 From: Roman Ganin Date: Sat, 11 Jun 2016 18:24:07 +0300 Subject: [PATCH 288/345] MAGETWO-54211: Downloadable product has direct link in category after update applied --- .../ProductProcessUrlRewriteSavingObserver.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserver.php b/app/code/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserver.php index 6639437eab449..13dffac83d7ce 100644 --- a/app/code/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserver.php +++ b/app/code/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserver.php @@ -52,13 +52,14 @@ public function execute(\Magento\Framework\Event\Observer $observer) || $isChangedWebsites || $product->dataHasChangedFor('visibility') ) { - $this->urlPersist->deleteByData([ - UrlRewrite::ENTITY_ID => $product->getId(), - UrlRewrite::ENTITY_TYPE => ProductUrlRewriteGenerator::ENTITY_TYPE, - ]); - if (in_array($product->getVisibility(), $product->getVisibleInSiteVisibilities())) { - $this->urlPersist->replace($this->productUrlRewriteGenerator->generate($product)); - } + $this->urlPersist->deleteByData([ + UrlRewrite::ENTITY_ID => $product->getId(), + UrlRewrite::ENTITY_TYPE => ProductUrlRewriteGenerator::ENTITY_TYPE, + UrlRewrite::REDIRECT_TYPE => 0, + ]); + if (in_array($product->getVisibility(), $product->getVisibleInSiteVisibilities())) { + $this->urlPersist->replace($this->productUrlRewriteGenerator->generate($product)); + } } } } From 65a6e413f0a5a4d7f9051b9b91470fe159250946 Mon Sep 17 00:00:00 2001 From: Michail Slabko Date: Sat, 11 Jun 2016 19:10:26 +0300 Subject: [PATCH 289/345] MAGETWO-54257: "Stock Status" attribute is not changed for Variation Simple Product --- .../Model/Product/VariationHandler.php | 9 ++++----- .../Test/Unit/Model/Product/VariationHandlerTest.php | 5 ----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/app/code/Magento/ConfigurableProduct/Model/Product/VariationHandler.php b/app/code/Magento/ConfigurableProduct/Model/Product/VariationHandler.php index 9a40931c05d02..7ba330f5a060c 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Product/VariationHandler.php +++ b/app/code/Magento/ConfigurableProduct/Model/Product/VariationHandler.php @@ -29,7 +29,10 @@ class VariationHandler /** @var \Magento\Catalog\Model\ProductFactory */ protected $productFactory; - /** @var \Magento\CatalogInventory\Api\StockConfigurationInterface */ + /** + * @var \Magento\CatalogInventory\Api\StockConfigurationInterface + * @deprecated + */ protected $stockConfiguration; /** @@ -168,14 +171,10 @@ protected function fillSimpleProductData( $keysFilter = ['item_id', 'product_id', 'stock_id', 'type_id', 'website_id']; $postData['stock_data'] = array_diff_key((array)$parentProduct->getStockData(), array_flip($keysFilter)); - $postData['stock_data']['manage_stock'] = $postData['quantity_and_stock_status']['qty'] === '' ? 0 : 1; if (!isset($postData['stock_data']['is_in_stock'])) { $stockStatus = $parentProduct->getQuantityAndStockStatus(); $postData['stock_data']['is_in_stock'] = $stockStatus['is_in_stock']; } - $configDefaultValue = $this->stockConfiguration->getManageStock($product->getStoreId()); - $postData['stock_data']['use_config_manage_stock'] = $postData['stock_data']['manage_stock'] == - $configDefaultValue ? 1 : 0; $postData = $this->processMediaGallery($product, $postData); $postData['status'] = isset($postData['status']) ? $postData['status'] diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Product/VariationHandlerTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Product/VariationHandlerTest.php index 7efc0794f11b8..026fed5e29db5 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Product/VariationHandlerTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Product/VariationHandlerTest.php @@ -254,11 +254,6 @@ public function testGenerateSimpleProducts() $parentProductMock->expects($this->once()) ->method('getQuantityAndStockStatus') ->willReturn(['is_in_stock' => 1]); - $newSimpleProductMock->expects($this->once())->method('getStoreId')->willReturn('store_id'); - $this->stockConfiguration->expects($this->once()) - ->method('getManageStock') - ->with('store_id') - ->willReturn(1); $newSimpleProductMock->expects($this->once())->method('addData')->willReturnSelf(); $parentProductMock->expects($this->once())->method('getWebsiteIds')->willReturn('website_id'); $newSimpleProductMock->expects($this->once())->method('setWebsiteIds')->with('website_id')->willReturnSelf(); From 6c913ce48a133e1eba99e4e97a2d359e22076765 Mon Sep 17 00:00:00 2001 From: Michail Slabko Date: Sat, 11 Jun 2016 19:44:00 +0300 Subject: [PATCH 290/345] MAGETWO-54257: "Stock Status" attribute is not changed for Variation Simple Product --- .../Model/Product/VariationHandlerTest.php | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/VariationHandlerTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/VariationHandlerTest.php index 2957a9de06c14..b463f2acaf9e5 100644 --- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/VariationHandlerTest.php +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/VariationHandlerTest.php @@ -8,6 +8,8 @@ namespace Magento\ConfigurableProduct\Model\Product; +use Magento\TestFramework\Helper\Bootstrap; + /** * @magentoAppIsolation enabled * @magentoDataFixture Magento/ConfigurableProduct/_files/product_configurable.php @@ -26,19 +28,22 @@ class VariationHandlerTest extends \PHPUnit_Framework_TestCase */ protected $_product; + /** @var \Magento\CatalogInventory\Api\StockRegistryInterface */ + protected $stockRegistry; + protected function setUp() { - $this->_product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + $this->_product = Bootstrap::getObjectManager()->create( 'Magento\Catalog\Model\Product' ); $this->_product->load(1); - // fixture - $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + $this->_model = Bootstrap::getObjectManager()->create( 'Magento\ConfigurableProduct\Model\Product\VariationHandler' ); // prevent fatal errors by assigning proper "singleton" of type instance to the product $this->_product->setTypeInstance($this->_model); + $this->stockRegistry = Bootstrap::getObjectManager()->get('Magento\CatalogInventory\Api\StockRegistryInterface'); } /** @@ -52,8 +57,9 @@ public function testGenerateSimpleProducts($productsData) $generatedProducts = $this->_model->generateSimpleProducts($this->_product, $productsData); $this->assertEquals(3, count($generatedProducts)); foreach ($generatedProducts as $productId) { + $stockItem = $this->stockRegistry->getStockItem($productId); /** @var $product \Magento\Catalog\Model\Product */ - $product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + $product = Bootstrap::getObjectManager()->create( 'Magento\Catalog\Model\Product' ); $product->load($productId); @@ -61,6 +67,8 @@ public function testGenerateSimpleProducts($productsData) $this->assertNotNull($product->getSku()); $this->assertNotNull($product->getPrice()); $this->assertNotNull($product->getWeight()); + $this->assertEquals('1', $stockItem->getIsInStock()); + } } @@ -71,14 +79,12 @@ public function testGenerateSimpleProducts($productsData) */ public function testGenerateSimpleProductsWithPartialData($productsData) { - $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry */ - $stockRegistry = $objectManager->get('Magento\CatalogInventory\Api\StockRegistryInterface'); $this->_product->setNewVariationsAttributeSetId(4); $generatedProducts = $this->_model->generateSimpleProducts($this->_product, $productsData); + $parentStockItem = $this->stockRegistry->getStockItem($this->_product->getId()); foreach ($generatedProducts as $productId) { - $stockItem = $stockRegistry->getStockItem($productId); - $this->assertEquals('0', $stockItem->getManageStock()); + $stockItem = $this->stockRegistry->getStockItem($productId); + $this->assertEquals($parentStockItem->getManageStock(), $stockItem->getManageStock()); $this->assertEquals('1', $stockItem->getIsInStock()); } } From e8b279cdbe261615b27d9cc2bd8ea9bb822c789e Mon Sep 17 00:00:00 2001 From: Michail Slabko Date: Sat, 11 Jun 2016 19:48:58 +0300 Subject: [PATCH 291/345] MAGETWO-54257: "Stock Status" attribute is not changed for Variation Simple Product --- .../Model/Product/VariationHandlerTest.php | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/VariationHandlerTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/VariationHandlerTest.php index b463f2acaf9e5..68b445ed80da3 100644 --- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/VariationHandlerTest.php +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/VariationHandlerTest.php @@ -16,20 +16,14 @@ */ class VariationHandlerTest extends \PHPUnit_Framework_TestCase { - /** - * Object under test - * - * @var \Magento\ConfigurableProduct\Model\Product\VariationHandler - */ - protected $_model; + /** @var \Magento\ConfigurableProduct\Model\Product\VariationHandler */ + private $_model; - /** - * @var \Magento\Catalog\Model\Product - */ - protected $_product; + /** @var \Magento\Catalog\Model\Product */ + private $_product; /** @var \Magento\CatalogInventory\Api\StockRegistryInterface */ - protected $stockRegistry; + private $stockRegistry; protected function setUp() { @@ -68,7 +62,6 @@ public function testGenerateSimpleProducts($productsData) $this->assertNotNull($product->getPrice()); $this->assertNotNull($product->getWeight()); $this->assertEquals('1', $stockItem->getIsInStock()); - } } From 57f58679c8f021d5c3a1e9eea31524dde4f3192b Mon Sep 17 00:00:00 2001 From: Cari Spruiell Date: Sat, 11 Jun 2016 13:12:21 -0500 Subject: [PATCH 292/345] MAGETWO-52914: Setup UI Modifications - remove extra empty line --- setup/src/Magento/Setup/Model/SystemPackage.php | 1 - 1 file changed, 1 deletion(-) diff --git a/setup/src/Magento/Setup/Model/SystemPackage.php b/setup/src/Magento/Setup/Model/SystemPackage.php index 393d901400359..edb9e4412ad52 100755 --- a/setup/src/Magento/Setup/Model/SystemPackage.php +++ b/setup/src/Magento/Setup/Model/SystemPackage.php @@ -204,7 +204,6 @@ public function sortVersions($enterpriseVersions) */ private function formatPackages($packages) { - $versions = []; foreach ($packages as $package) { From 781281d06ee0bfcc3a8e5e90332f96fcc07c6b52 Mon Sep 17 00:00:00 2001 From: Dale Sikkema Date: Sat, 11 Jun 2016 14:42:40 -0500 Subject: [PATCH 293/345] MAGETWO-54255: Full Path Disclosure in cache management --- app/code/Magento/Backend/i18n/en_US.csv | 1 + .../Framework/App/DeploymentConfig/Writer.php | 10 ++- .../Test/Unit/DeploymentConfig/WriterTest.php | 72 ++++++++++--------- 3 files changed, 49 insertions(+), 34 deletions(-) diff --git a/app/code/Magento/Backend/i18n/en_US.csv b/app/code/Magento/Backend/i18n/en_US.csv index 60c8a4ed29227..252269ba97ffb 100644 --- a/app/code/Magento/Backend/i18n/en_US.csv +++ b/app/code/Magento/Backend/i18n/en_US.csv @@ -456,3 +456,4 @@ Pagination,Pagination "Anchor Text for Next","Anchor Text for Next" "Alternative text for the next pages link in the pagination menu. If empty, default arrow image is used.","Alternative text for the next pages link in the pagination menu. If empty, default arrow image is used." "Theme Name","Theme Name" +"Deployment config file %1 is not writable.","Deployment config file %1 is not writable." diff --git a/lib/internal/Magento/Framework/App/DeploymentConfig/Writer.php b/lib/internal/Magento/Framework/App/DeploymentConfig/Writer.php index b3f8ec62a41a1..ac1e5f6ecf897 100644 --- a/lib/internal/Magento/Framework/App/DeploymentConfig/Writer.php +++ b/lib/internal/Magento/Framework/App/DeploymentConfig/Writer.php @@ -8,8 +8,10 @@ use Magento\Framework\App\DeploymentConfig; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Exception\FileSystemException; use Magento\Framework\Filesystem; use Magento\Framework\Config\File\ConfigFilePool; +use Magento\Framework\Phrase; /** * Deployment configuration writer @@ -110,7 +112,13 @@ public function saveConfig(array $data, $override = false) } $contents = $this->formatter->format($config); - $this->filesystem->getDirectoryWrite(DirectoryList::CONFIG)->writeFile($paths[$fileKey], $contents); + try { + $this->filesystem->getDirectoryWrite(DirectoryList::CONFIG)->writeFile($paths[$fileKey], $contents); + } catch (FileSystemException $e) { + throw new FileSystemException( + new Phrase('Deployment config file %1 is not writable.', [$paths[$fileKey]]) + ); + } if (function_exists('opcache_invalidate')) { opcache_invalidate( $this->filesystem->getDirectoryRead(DirectoryList::CONFIG)->getAbsolutePath($paths[$fileKey]) diff --git a/lib/internal/Magento/Framework/App/Test/Unit/DeploymentConfig/WriterTest.php b/lib/internal/Magento/Framework/App/Test/Unit/DeploymentConfig/WriterTest.php index 9382dc42be6bb..de06f6f18a590 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/DeploymentConfig/WriterTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/DeploymentConfig/WriterTest.php @@ -7,73 +7,67 @@ namespace Magento\Framework\App\Test\Unit\DeploymentConfig; use Magento\Framework\App\DeploymentConfig; +use Magento\Framework\App\DeploymentConfig\Reader; use Magento\Framework\App\DeploymentConfig\Writer; +use Magento\Framework\App\DeploymentConfig\Writer\FormatterInterface; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\Config\File\ConfigFilePool; +use Magento\Framework\Exception\FileSystemException; +use Magento\Framework\Filesystem; +use Magento\Framework\Filesystem\Directory\ReadInterface; +use Magento\Framework\Filesystem\Directory\WriteInterface; +use Magento\Framework\Phrase; class WriterTest extends \PHPUnit_Framework_TestCase { - /** - * @var Writer - */ + /** @var Writer */ private $object; - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ + /** @var \PHPUnit_Framework_MockObject_MockObject */ private $reader; - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ + /** @var \PHPUnit_Framework_MockObject_MockObject */ private $dirWrite; - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ + /** @var \PHPUnit_Framework_MockObject_MockObject */ private $dirRead; - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ + /** @var \PHPUnit_Framework_MockObject_MockObject */ protected $formatter; - /** - * @var ConfigFilePool - */ + /** @var ConfigFilePool */ private $configFilePool; - /** - * @var DeploymentConfig - */ + /** @var DeploymentConfig */ private $deploymentConfig; + /** @var Filesystem */ + private $filesystem; + protected function setUp() { - $this->reader = $this->getMock('Magento\Framework\App\DeploymentConfig\Reader', [], [], '', false); - $filesystem = $this->getMock('Magento\Framework\Filesystem', [], [], '', false); - $this->formatter = $this->getMockForAbstractClass( - 'Magento\Framework\App\DeploymentConfig\Writer\FormatterInterface' - ); - $this->configFilePool = $this->getMock('Magento\Framework\Config\File\ConfigFilePool', [], [], '', false); - $this->deploymentConfig = $this->getMock('Magento\Framework\App\DeploymentConfig', [], [], '', false); + $this->reader = $this->getMock(Reader::class, [], [], '', false); + $this->filesystem = $this->getMock(Filesystem::class, [], [], '', false); + $this->formatter = $this->getMockForAbstractClass(FormatterInterface::class); + $this->configFilePool = $this->getMock(ConfigFilePool::class, [], [], '', false); + $this->deploymentConfig = $this->getMock(DeploymentConfig::class, [], [], '', false); $this->object = new Writer( $this->reader, - $filesystem, + $this->filesystem, $this->configFilePool, $this->deploymentConfig, $this->formatter ); $this->reader->expects($this->any())->method('getFiles')->willReturn('test.php'); - $this->dirWrite = $this->getMockForAbstractClass('Magento\Framework\Filesystem\Directory\WriteInterface'); - $this->dirRead = $this->getMockForAbstractClass('Magento\Framework\Filesystem\Directory\ReadInterface'); + $this->dirWrite = $this->getMockForAbstractClass(WriteInterface::class); + $this->dirRead = $this->getMockForAbstractClass(ReadInterface::class); $this->dirRead->expects($this->any()) ->method('getAbsolutePath'); - $filesystem->expects($this->any()) + $this->filesystem->expects($this->any()) ->method('getDirectoryWrite') ->with(DirectoryList::CONFIG) ->willReturn($this->dirWrite); - $filesystem->expects($this->any()) + $this->filesystem->expects($this->any()) ->method('getDirectoryRead') ->with(DirectoryList::CONFIG) ->willReturn($this->dirRead); @@ -179,4 +173,16 @@ public function testSaveConfigOverride() $this->object->saveConfig($testSetUpdate, true); } + + /** + * @expectedException \Magento\Framework\Exception\FileSystemException + * @expectedExceptionMessage Deployment config file env.php is not writable. + */ + public function testSaveConfigException() + { + $this->configFilePool->method('getPaths')->willReturn([ConfigFilePool::APP_ENV => 'env.php']); + $exception = new FileSystemException(new Phrase('error when writing file config file')); + $this->dirWrite->method('writeFile')->willThrowException($exception); + $this->object->saveConfig([ConfigFilePool::APP_ENV => ['key' => 'value']]); + } } From cf1df1ca861bf38140aeb2697b2ad482ef3d890c Mon Sep 17 00:00:00 2001 From: Anton Kaplya Date: Sun, 12 Jun 2016 12:53:39 +0300 Subject: [PATCH 294/345] MAGETWO-53424: Added additional arguments into attributes creation --- .../Magento/CatalogRule/Model/Indexer/IndexerBuilderTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/IndexerBuilderTest.php b/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/IndexerBuilderTest.php index 4e200586ce213..88862c05698ea 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/IndexerBuilderTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogRule/Model/Indexer/IndexerBuilderTest.php @@ -112,7 +112,7 @@ protected function prepareProducts() $product->load($product->getId()); $this->product = $product; - $this->product->setData('test_attribute', 'test_attribute_value')->save(); + $this->product->setStoreId(0)->setData('test_attribute', 'test_attribute_value')->save(); $this->productSecond = clone $this->product; $this->productSecond->setId(null)->setUrlKey('product-second')->save(); $this->productThird = clone $this->product; From 707839f931847d3e3afbbdfbe3f93a5e25fa0dff Mon Sep 17 00:00:00 2001 From: Andrii Lugovyi Date: Sun, 12 Jun 2016 18:41:15 +0300 Subject: [PATCH 295/345] MAGETWO-54222: [GitHub] Configurable Product. Edit Configurations changes names of simple products to SKU #4951 --- .../view/adminhtml/web/js/variations/steps/summary.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/summary.js b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/summary.js index 3439f8d9f2177..de2c7aa1db53f 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/summary.js +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/summary.js @@ -81,6 +81,7 @@ define([ options: options, images: images, sku: sku, + name: sku, quantity: quantity, price: price, productId: productId, @@ -91,6 +92,7 @@ define([ if (productId) { variation.sku = product.sku; variation.weight = product.weight; + variation.name = product.name; gridExisting.push(this.prepareRowForGrid(variation)); } else { gridNew.push(this.prepareRowForGrid(variation)); From a3673c3b58ab884672268d71861935947a7a818b Mon Sep 17 00:00:00 2001 From: Ievgen Sentiabov Date: Mon, 13 Jun 2016 10:56:09 +0300 Subject: [PATCH 296/345] MAGETWO-54293: Unable to place order from admin within Braintree if 3d secure enabled - Renamed data builders for adminhtml area --- app/code/Magento/Braintree/etc/adminhtml/di.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Braintree/etc/adminhtml/di.xml b/app/code/Magento/Braintree/etc/adminhtml/di.xml index 9cffa57abd6dc..ed52db8cf7234 100644 --- a/app/code/Magento/Braintree/etc/adminhtml/di.xml +++ b/app/code/Magento/Braintree/etc/adminhtml/di.xml @@ -19,7 +19,7 @@ - + Magento\Braintree\Gateway\Request\CustomerDataBuilder @@ -30,7 +30,7 @@ - + Magento\Braintree\Gateway\Request\CustomerDataBuilder From 65eb8de7184a53641c4d9ec538747a448ce44f18 Mon Sep 17 00:00:00 2001 From: Ievgen Shakhsuvarov Date: Mon, 13 Jun 2016 11:16:58 +0300 Subject: [PATCH 297/345] MAGETWO-54182: Unable to place order with quantity more than half in stock --- app/code/Magento/Quote/Model/Quote/Item/CartItemPersister.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Quote/Model/Quote/Item/CartItemPersister.php b/app/code/Magento/Quote/Model/Quote/Item/CartItemPersister.php index 85d3ccb3396ee..b2247f333bc3a 100644 --- a/app/code/Magento/Quote/Model/Quote/Item/CartItemPersister.php +++ b/app/code/Magento/Quote/Model/Quote/Item/CartItemPersister.php @@ -71,7 +71,9 @@ public function save(CartInterface $quote, CartItemInterface $item) /** Update item product options */ $item = $quote->updateItem($itemId, $buyRequestData); } else { - $currentItem->setQty($qty); + if ($item->getQty() !== $currentItem->getQty()) { + $currentItem->setQty($qty); + } } } else { /** add new item to shopping cart */ From f32e362a0e8f32697fcbdb4002e4aa81fd8bdb9f Mon Sep 17 00:00:00 2001 From: Yaroslav Onischenko Date: Mon, 13 Jun 2016 12:01:14 +0300 Subject: [PATCH 298/345] MAGETWO-53139: Price of last customizable options add to price on product page --- app/code/Magento/Catalog/view/base/web/js/price-options.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/view/base/web/js/price-options.js b/app/code/Magento/Catalog/view/base/web/js/price-options.js index 66db2b1e515b0..04a34288e4c1a 100644 --- a/app/code/Magento/Catalog/view/base/web/js/price-options.js +++ b/app/code/Magento/Catalog/view/base/web/js/price-options.js @@ -76,7 +76,6 @@ define([ $(this.options.priceHolderSelector).trigger('updatePrice', changes); }, - /** * Helper to fix issue with option nodes: * - you can't place any html in option -> @@ -174,7 +173,10 @@ define([ break; case 'radio': - + if (element.is(':checked')) { + changes[optionHash] = optionConfig[optionValue] && optionConfig[optionValue].prices || {}; + } + break; case 'select-one': changes[optionHash] = optionConfig[optionValue] && optionConfig[optionValue].prices || {}; break; From 895efff8fa701eb2313d5302605b5c3c7fb0c9ac Mon Sep 17 00:00:00 2001 From: Stanislav Lopukhov Date: Mon, 13 Jun 2016 12:15:24 +0300 Subject: [PATCH 299/345] MAGETWO-54242: [Github] Magento2: Issue in pagination #3861 --- app/code/Magento/Catalog/Helper/Product/ProductList.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Helper/Product/ProductList.php b/app/code/Magento/Catalog/Helper/Product/ProductList.php index 4a220a1051b0f..9c818969e73a8 100644 --- a/app/code/Magento/Catalog/Helper/Product/ProductList.php +++ b/app/code/Magento/Catalog/Helper/Product/ProductList.php @@ -18,7 +18,7 @@ class ProductList */ const XML_PATH_LIST_MODE = 'catalog/frontend/list_mode'; - const VIEW_MODE_LIST = 'view'; + const VIEW_MODE_LIST = 'list'; const VIEW_MODE_GRID = 'grid'; const DEFAULT_SORT_DIRECTION = 'asc'; From f509b9cb4f0aff029f6e5cb73a8d75b106925847 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets Date: Mon, 13 Jun 2016 13:04:14 +0300 Subject: [PATCH 300/345] MAGETWO-54186: Problem with js validation when adding product to shopping cart --- .../view/frontend/templates/product/view/addtocart.phtml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/view/addtocart.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/view/addtocart.phtml index 3f15701216005..c9680034e1e21 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/view/addtocart.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/view/addtocart.phtml @@ -53,7 +53,9 @@ From b9e0026929f048ae9b155a4b047e794f5f8d8f90 Mon Sep 17 00:00:00 2001 From: Ievgen Shakhsuvarov Date: Mon, 13 Jun 2016 13:24:29 +0300 Subject: [PATCH 301/345] MAGETWO-54262: Cannot remove product from shopping cart --- .../Model/Quote/Item/QuantityValidator.php | 7 ------- app/code/Magento/Checkout/Block/Cart.php | 12 ++++++++++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/CatalogInventory/Model/Quote/Item/QuantityValidator.php b/app/code/Magento/CatalogInventory/Model/Quote/Item/QuantityValidator.php index 0f28d9f26c3e9..bf8e13f35dde4 100644 --- a/app/code/Magento/CatalogInventory/Model/Quote/Item/QuantityValidator.php +++ b/app/code/Magento/CatalogInventory/Model/Quote/Item/QuantityValidator.php @@ -183,13 +183,6 @@ public function validate(\Magento\Framework\Event\Observer $observer) \Magento\CatalogInventory\Helper\Data::ERROR_QTY, $result->getMessage() ); - - $quoteItem->getQuote()->addErrorInfo( - $result->getQuoteMessageIndex(), - 'cataloginventory', - \Magento\CatalogInventory\Helper\Data::ERROR_QTY, - $result->getQuoteMessage() - ); } else { // Delete error from item and its quote, if it was set due to qty lack $this->_removeErrorsFromQuoteAndItem($quoteItem, \Magento\CatalogInventory\Helper\Data::ERROR_QTY); diff --git a/app/code/Magento/Checkout/Block/Cart.php b/app/code/Magento/Checkout/Block/Cart.php index 71302d8d279f4..057ee54ef409f 100644 --- a/app/code/Magento/Checkout/Block/Cart.php +++ b/app/code/Magento/Checkout/Block/Cart.php @@ -108,12 +108,20 @@ public function prepareItemUrls() } /** - * @codeCoverageIgnore * @return bool */ public function hasError() { - return $this->getQuote()->getHasError(); + if ($this->getQuote()->getHasError()) { + return true; + } + + foreach ($this->getQuote()->getItems() as $quoteItem) { + if (!empty($quoteItem->getErrorInfos())) { + return true; + } + } + return false; } /** From 073a5f60c55a4d40c43ffa0676f345256474a056 Mon Sep 17 00:00:00 2001 From: Anton Kaplya Date: Mon, 13 Jun 2016 13:39:52 +0300 Subject: [PATCH 302/345] MAGETWO-53424: Added additional arguments into attributes creation --- app/code/Magento/Store/Model/StoreScopeProvider.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/code/Magento/Store/Model/StoreScopeProvider.php b/app/code/Magento/Store/Model/StoreScopeProvider.php index 84e6df92b5340..1054b6bca4105 100644 --- a/app/code/Magento/Store/Model/StoreScopeProvider.php +++ b/app/code/Magento/Store/Model/StoreScopeProvider.php @@ -50,11 +50,6 @@ public function getContext($entityType, $entityData = []) if (isset($entityData[Store::STORE_ID])) { $value = $entityData[Store::STORE_ID]; } else { -// if ($this->storeManager->hasSingleStore()) { -// $value = Store::DEFAULT_STORE_ID; -// } else { -// $value = (int)$this->storeManager->getStore(true)->getId(); -// } $value = (int)$this->storeManager->getStore(true)->getId(); } From 62459228a31f57ca2fbebfe4db0aaaddf1417f29 Mon Sep 17 00:00:00 2001 From: Nadiya Syvokonenko Date: Mon, 13 Jun 2016 13:54:17 +0300 Subject: [PATCH 303/345] MAGETWO-54197: 'Configure' button for items (add by Customer sections) on Create New Order page is not clicable --- .../Block/Adminhtml/Order/Create/Sidebar.php | 51 +++++++++++++++++++ .../ConfigurableProduct/etc/adminhtml/di.xml | 3 ++ 2 files changed, 54 insertions(+) create mode 100644 app/code/Magento/ConfigurableProduct/Block/Adminhtml/Order/Create/Sidebar.php diff --git a/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Order/Create/Sidebar.php b/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Order/Create/Sidebar.php new file mode 100644 index 0000000000000..0cff9d736a250 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Order/Create/Sidebar.php @@ -0,0 +1,51 @@ +getProduct()->getTypeId() == Configurable::TYPE_CODE) { + return ''; + } + return $proceed($item); + } + + /** + * Check whether product configuration is required before adding to order + * + * @param \Magento\Sales\Block\Adminhtml\Order\Create\Sidebar\AbstractSidebar $subject + * @param \Closure $proceed + * @param string $productType + * @return bool + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function aroundIsConfigurationRequired( + \Magento\Sales\Block\Adminhtml\Order\Create\Sidebar\AbstractSidebar $subject, + \Closure $proceed, + $productType + ) { + if ($productType == Configurable::TYPE_CODE) { + return true; + } + return $proceed($productType); + } +} diff --git a/app/code/Magento/ConfigurableProduct/etc/adminhtml/di.xml b/app/code/Magento/ConfigurableProduct/etc/adminhtml/di.xml index 3fe4a122c2b35..90c5612f5e507 100644 --- a/app/code/Magento/ConfigurableProduct/etc/adminhtml/di.xml +++ b/app/code/Magento/ConfigurableProduct/etc/adminhtml/di.xml @@ -16,6 +16,9 @@ + + + Magento\Catalog\Model\System\Config\Source\InputtypeFactory From 61769514a1180a69adf3281058dc05c20c2cf4da Mon Sep 17 00:00:00 2001 From: Oleksandr Radchenko Date: Mon, 13 Jun 2016 13:59:44 +0300 Subject: [PATCH 304/345] MAGETWO-54191: [GITHUB] Error saving new order status in backend #4146 --- .../Sales/Controller/Adminhtml/Order/Status/Save.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Status/Save.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Status/Save.php index 6e81434275856..463279367e04f 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Status/Save.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Status/Save.php @@ -27,8 +27,12 @@ public function execute() $filterManager = $this->_objectManager->get('Magento\Framework\Filter\FilterManager'); if ($isNew) { $statusCode = $data['status'] = $filterManager->stripTags($data['status']); + } + $data['label'] = $filterManager->stripTags($data['label']); + if (!isset($data['store_labels'])) { + $data['store_labels'] = []; } - $data['label'] = $filterManager->stripTags($data['label']); + foreach ($data['store_labels'] as &$label) { $label = $filterManager->stripTags($label); } From bce574cd6469752bd4dca921388a060a28713fb6 Mon Sep 17 00:00:00 2001 From: Ievgen Shakhsuvarov Date: Mon, 13 Jun 2016 14:01:20 +0300 Subject: [PATCH 305/345] MAGETWO-54262: Cannot remove product from shopping cart - This reverts commit b9e0026929f048ae9b155a4b047e794f5f8d8f90. --- .../Model/Quote/Item/QuantityValidator.php | 7 +++++++ app/code/Magento/Checkout/Block/Cart.php | 12 ++---------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/app/code/Magento/CatalogInventory/Model/Quote/Item/QuantityValidator.php b/app/code/Magento/CatalogInventory/Model/Quote/Item/QuantityValidator.php index bf8e13f35dde4..0f28d9f26c3e9 100644 --- a/app/code/Magento/CatalogInventory/Model/Quote/Item/QuantityValidator.php +++ b/app/code/Magento/CatalogInventory/Model/Quote/Item/QuantityValidator.php @@ -183,6 +183,13 @@ public function validate(\Magento\Framework\Event\Observer $observer) \Magento\CatalogInventory\Helper\Data::ERROR_QTY, $result->getMessage() ); + + $quoteItem->getQuote()->addErrorInfo( + $result->getQuoteMessageIndex(), + 'cataloginventory', + \Magento\CatalogInventory\Helper\Data::ERROR_QTY, + $result->getQuoteMessage() + ); } else { // Delete error from item and its quote, if it was set due to qty lack $this->_removeErrorsFromQuoteAndItem($quoteItem, \Magento\CatalogInventory\Helper\Data::ERROR_QTY); diff --git a/app/code/Magento/Checkout/Block/Cart.php b/app/code/Magento/Checkout/Block/Cart.php index 057ee54ef409f..71302d8d279f4 100644 --- a/app/code/Magento/Checkout/Block/Cart.php +++ b/app/code/Magento/Checkout/Block/Cart.php @@ -108,20 +108,12 @@ public function prepareItemUrls() } /** + * @codeCoverageIgnore * @return bool */ public function hasError() { - if ($this->getQuote()->getHasError()) { - return true; - } - - foreach ($this->getQuote()->getItems() as $quoteItem) { - if (!empty($quoteItem->getErrorInfos())) { - return true; - } - } - return false; + return $this->getQuote()->getHasError(); } /** From b16884e0204787aa9bb0ca312006da7be0f33969 Mon Sep 17 00:00:00 2001 From: Ievgen Shakhsuvarov Date: Mon, 13 Jun 2016 14:03:23 +0300 Subject: [PATCH 306/345] MAGETWO-54262: Cannot remove product from shopping cart --- .../Model/QuoteRepository/SaveHandler.php | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/app/code/Magento/Quote/Model/QuoteRepository/SaveHandler.php b/app/code/Magento/Quote/Model/QuoteRepository/SaveHandler.php index 6b06dbc8c8f13..1bece9a0887ca 100644 --- a/app/code/Magento/Quote/Model/QuoteRepository/SaveHandler.php +++ b/app/code/Magento/Quote/Model/QuoteRepository/SaveHandler.php @@ -5,10 +5,8 @@ */ namespace Magento\Quote\Model\QuoteRepository; -use Magento\Framework\App\ObjectManager; use Magento\Quote\Api\Data\CartInterface; use Magento\Framework\Exception\InputException; -use Magento\Framework\Exception\CouldNotSaveException; class SaveHandler { @@ -32,11 +30,6 @@ class SaveHandler */ private $shippingAssignmentPersister; - /** - * @var \Magento\Framework\Message\PhraseFactory - */ - private $phraseFactory; - /** * @param \Magento\Quote\Model\ResourceModel\Quote $quoteResource * @param \Magento\Quote\Model\Quote\Item\CartItemPersister $cartItemPersister @@ -77,13 +70,6 @@ public function save(CartInterface $quote) } } } - $errors = $quote->getErrors(); - if (!empty($errors)) { - $phraseFactory = $this->getPhraseFactory(); - throw new CouldNotSaveException( - $phraseFactory->create('Following errors occurred on save: %1', $errors) - ); - } // Billing Address processing $billingAddress = $quote->getBillingAddress(); @@ -97,18 +83,6 @@ public function save(CartInterface $quote) return $quote; } - /** - * @deprecated - * @return \Magento\Framework\Message\PhraseFactory - */ - private function getPhraseFactory() - { - if (!is_object($this->phraseFactory)) { - $this->phraseFactory = ObjectManager::getInstance()->get(\Magento\Framework\Message\PhraseFactory::class); - } - return $this->phraseFactory; - } - /** * @param \Magento\Quote\Model\Quote $quote * @return void From 3591ce83207909bbad281f8845535b80ee31a049 Mon Sep 17 00:00:00 2001 From: Ankur Kaneria Date: Mon, 13 Jun 2016 09:15:26 -0500 Subject: [PATCH 307/345] MAGETWO-54205: After Disable/Enable Magento modules via CLI all cache types become disabled --- .../Magento/Framework/Code/GeneratedFiles.php | 36 +++++++---- .../Setup/Console/Command/UpgradeCommand.php | 64 +++++++------------ .../Console/Command/UpgradeCommandTest.php | 13 ++-- 3 files changed, 52 insertions(+), 61 deletions(-) diff --git a/lib/internal/Magento/Framework/Code/GeneratedFiles.php b/lib/internal/Magento/Framework/Code/GeneratedFiles.php index dde846e4f2222..21307f26266bd 100644 --- a/lib/internal/Magento/Framework/Code/GeneratedFiles.php +++ b/lib/internal/Magento/Framework/Code/GeneratedFiles.php @@ -57,8 +57,8 @@ public function cleanGeneratedFiles() $configPool = new ConfigFilePool(); $envPath = $deploymentConfig . '/' . $configPool->getPath(ConfigFilePool::APP_ENV); if ($this->write->isExist($this->write->getRelativePath($envPath))) { - $this->saveCacheConfiguration($envPath); - $this->disableAllCacheTypes($envPath); + $this->saveCacheConfiguration(); + $this->disableAllCacheTypes(); } //TODO: Till here @@ -81,7 +81,7 @@ public function cleanGeneratedFiles() $this->write->delete($cachePath); } $this->write->delete(self::REGENERATE_FLAG); - $this->reEnableCacheTypes($envPath); + $this->reEnableCacheTypes(); } } @@ -97,13 +97,13 @@ public function requestRegeneration() } /** - * Read Cache configuration from env.php and write to a json file. + * Reads Cache configuration from env.php and write to a json file. * - * @param string $envPath * @return void */ - private function saveCacheConfiguration($envPath) + public function saveCacheConfiguration() { + $envPath = $this->GetEnvPath(); $envData = include $envPath; if (isset($envData['cache_types'])) { @@ -121,13 +121,27 @@ private function saveCacheConfiguration($envPath) } /** - * Disable all cache types by updating env.php. + * Returns path to env.php file + * + * @return string + * @throws \Exception + */ + private function GetEnvPath() + { + $deploymentConfig = $this->directoryList->getPath(DirectoryList::CONFIG); + $configPool = new ConfigFilePool(); + $envPath = $deploymentConfig . '/' . $configPool->getPath(ConfigFilePool::APP_ENV); + return $envPath; + } + + /** + * Disables all cache types by updating env.php. * - * @param string $envPath * @return void */ - private function disableAllCacheTypes($envPath) + private function disableAllCacheTypes() { + $envPath = $this->GetEnvPath(); $envData = include $envPath; if (isset($envData['cache_types'])) { @@ -155,7 +169,7 @@ private function disableAllCacheTypes($envPath) * * @return void */ - private function reEnableCacheTypes($envPath) + private function reEnableCacheTypes() { $pathToCacheStatus = $this->write->getRelativePath( $this->directoryList->getPath(DirectoryList::VAR_DIR) . '/.cachestates.json' @@ -164,6 +178,7 @@ private function reEnableCacheTypes($envPath) if ($this->write->isExist($pathToCacheStatus)) { $enabledCacheTypes = array_keys(json_decode($this->write->readFile($pathToCacheStatus), true)); + $envPath = $this->GetEnvPath(); $envData = include $envPath; foreach ($enabledCacheTypes as $cacheType) { $envData['cache_types'][$cacheType] = 1; @@ -178,7 +193,6 @@ private function reEnableCacheTypes($envPath) $this->write->getAbsolutePath($envPath) ); } - $this->write->delete($pathToCacheStatus); } } } diff --git a/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php b/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php index be584a1717176..3d86c44e40493 100644 --- a/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php +++ b/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php @@ -5,9 +5,6 @@ */ namespace Magento\Setup\Console\Command; -use Magento\Framework\App\Filesystem\DirectoryList; -use Magento\Backend\Console\Command\AbstractCacheManageCommand; -use Magento\Framework\ObjectManagerInterface; use Magento\Framework\Setup\ConsoleLogger; use Magento\Setup\Model\InstallerFactory; use Magento\Setup\Model\ObjectManagerProvider; @@ -15,6 +12,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +use Magento\Framework\Code\GeneratedFiles; /** * Command for updating installed application after the code base has changed @@ -34,11 +32,14 @@ class UpgradeCommand extends AbstractSetupCommand private $installerFactory; /** - * Object Manager - * - * @var ObjectManagerProvider + * @var \Magento\Framework\ObjectManagerInterface */ - private $objectManagerProvider; + private $objectManager; + + /** + * @var GeneratedFiles + */ + private $generatedFiles; /** * Constructor @@ -49,7 +50,8 @@ class UpgradeCommand extends AbstractSetupCommand public function __construct(InstallerFactory $installerFactory, ObjectManagerProvider $objectManagerProvider) { $this->installerFactory = $installerFactory; - $this->objectManagerProvider = $objectManagerProvider; + /** @var \Magento\Framework\ObjectManagerInterface objectManager */ + $this->objectManager = $objectManagerProvider->get(); parent::__construct(); } @@ -79,15 +81,14 @@ protected function configure() */ protected function execute(InputInterface $input, OutputInterface $output) { - /** @var \Magento\Framework\ObjectManagerInterface $objectManager */ - $objectManager = $this->objectManagerProvider->get(); + $this->getGeneratedFiles()->requestRegeneration(); $areaCode = 'setup'; /** @var \Magento\Framework\App\State $appState */ - $appState = $objectManager->get('Magento\Framework\App\State'); + $appState = $this->objectManager->get('Magento\Framework\App\State'); $appState->setAreaCode($areaCode); /** @var \Magento\Framework\ObjectManager\ConfigLoaderInterface $configLoader */ - $configLoader = $objectManager->get('Magento\Framework\ObjectManager\ConfigLoaderInterface'); - $objectManager->configure($configLoader->load($areaCode)); + $configLoader = $this->objectManager->get('Magento\Framework\ObjectManager\ConfigLoaderInterface'); + $this->objectManager->configure($configLoader->load($areaCode)); $keepGenerated = $input->getOption(self::INPUT_KEY_KEEP_GENERATED); $installer = $this->installerFactory->create(new ConsoleLogger($output)); @@ -98,41 +99,20 @@ protected function execute(InputInterface $input, OutputInterface $output) $output->writeln('Please re-run Magento compile command'); } - return $this->enableCaches($objectManager, $output); + return \Magento\Framework\Console\Cli::RETURN_SUCCESS; } /** - * Enables cache if cachestates exists - * TODO: to be removed in scope of MAGETWO-53476 + * Get deployment config * - * @param \Magento\Framework\ObjectManagerInterface $objectManager - * @param \Symfony\Component\Console\Output\OutputInterface $output - * @return int + * @return GeneratedFiles + * @deprecated */ - private function enableCaches($objectManager, $output) + private function getGeneratedFiles() { - $writeFactory = $objectManager->get('Magento\Framework\Filesystem\Directory\WriteFactory'); - /** @var \Magento\Framework\Filesystem\Directory\Write $write */ - $write = $writeFactory->create(BP); - /** @var \Magento\Framework\App\Filesystem\DirectoryList $dirList */ - $dirList = $objectManager->get('Magento\Framework\App\Filesystem\DirectoryList'); - - $pathToCacheStatus = $write->getRelativePath($dirList->getPath(DirectoryList::VAR_DIR) . '/.cachestates.json'); - - if ($write->isExist($pathToCacheStatus)) { - $params = array_keys(json_decode($write->readFile($pathToCacheStatus), true)); - $command = $this->getApplication()->find('cache:enable'); - - $arguments = ['command' => 'cache:enable', AbstractCacheManageCommand::INPUT_KEY_TYPES => $params ]; - $returnCode = $command->run(new ArrayInput($arguments), $output); - - $write->delete($pathToCacheStatus); - if (isset($returnCode) && $returnCode > 0) { - $message = ' Error occured during upgrade. Error code: ' . $returnCode . ''; - $output->writeln($message); - return \Magento\Framework\Console\Cli::RETURN_FAILURE; - } + if (!($this->generatedFiles instanceof GeneratedFiles)) { + return $this->objectManager->get(GeneratedFiles::class); } - return \Magento\Framework\Console\Cli::RETURN_SUCCESS; + return $this->generatedFiles; } } diff --git a/setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php b/setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php index 9066201ace7b3..03fb1194316c5 100644 --- a/setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php @@ -27,22 +27,19 @@ public function testExecute() $installer->expects($this->at(1))->method('installSchema'); $installer->expects($this->at(2))->method('installDataFixtures'); $installerFactory->expects($this->once())->method('create')->willReturn($installer); - - $pathToCacheStatus = '/path/to/cachefile'; $writeFactory = $this->getMock('\Magento\Framework\Filesystem\Directory\WriteFactory', [], [], '', false); - $write = $this->getMock('\Magento\Framework\Filesystem\Directory\Write', [], [], '', false); - $write->expects($this->once())->method('isExist')->with('/path/to/cachefile')->willReturn(false); - $write->expects($this->once())->method('getRelativePath')->willReturn($pathToCacheStatus); - - $writeFactory->expects($this->once())->method('create')->willReturn($write); $directoryList = $this->getMock('\Magento\Framework\App\Filesystem\DirectoryList', [], [], '', false); - $objectManager->expects($this->exactly(4)) + $generatedFiles = $this->getMock('\Magento\Framework\Code\GeneratedFiles', [], [], '', false); + $generatedFiles->expects($this->once())->method('requestRegeneration'); + + $objectManager->expects($this->exactly(3)) ->method('get') ->will($this->returnValueMap([ ['Magento\Framework\App\State', $state], ['Magento\Framework\ObjectManager\ConfigLoaderInterface', $configLoader], ['Magento\Framework\Filesystem\Directory\WriteFactory', $writeFactory], ['Magento\Framework\App\Filesystem\DirectoryList', $directoryList], + ['Magento\Framework\Code\GeneratedFiles', $generatedFiles] ])); $commandTester = new CommandTester(new UpgradeCommand($installerFactory, $objectManagerProvider)); From 762556f900d67c836266c5d643eb0cd7d756900e Mon Sep 17 00:00:00 2001 From: Michail Slabko Date: Mon, 13 Jun 2016 17:39:46 +0300 Subject: [PATCH 308/345] MAGETWO-54283: ProductsList widget should implement IdentityInterface and return correct identities --- .../Block/Product/ProductsList.php | 22 +++++++- .../Unit/Block/Product/ProductsListTest.php | 54 ++++++++++++++----- 2 files changed, 61 insertions(+), 15 deletions(-) diff --git a/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php b/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php index 08de47e9bb074..d9a519857f5e7 100644 --- a/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php +++ b/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php @@ -8,12 +8,15 @@ namespace Magento\CatalogWidget\Block\Product; +use Magento\Framework\DataObject\IdentityInterface; +use Magento\Widget\Block\BlockInterface; + /** * Catalog Products List widget block * Class ProductsList * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class ProductsList extends \Magento\Catalog\Block\Product\AbstractProduct implements \Magento\Widget\Block\BlockInterface +class ProductsList extends \Magento\Catalog\Block\Product\AbstractProduct implements BlockInterface, IdentityInterface { /** * Default value for products count that will be shown @@ -78,6 +81,9 @@ class ProductsList extends \Magento\Catalog\Block\Product\AbstractProduct implem */ protected $conditionsHelper; + /** @var array */ + private $widgetIdentities; + /** * @param \Magento\Catalog\Block\Product\Context $context * @param \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory @@ -327,7 +333,19 @@ public function getPagerHtml() */ public function getIdentities() { - return [\Magento\Catalog\Model\Product::CACHE_TAG]; + if ($this->widgetIdentities === null) { + $collection = $this->productCollectionFactory->create(); + $conditions = $this->getConditions(); + $conditions->collectValidatedAttributes($collection); + $this->sqlBuilder->attachConditionToCollection($collection, $conditions); + $this->widgetIdentities = []; + foreach ($collection as $product) { + $this->widgetIdentities[] = \Magento\Catalog\Model\Product::CACHE_TAG . '_' . $product->getId(); + } + $this->widgetIdentities = $this->widgetIdentities ?: [\Magento\Catalog\Model\Product::CACHE_TAG]; + } + + return $this->widgetIdentities; } /** diff --git a/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php b/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php index 7ee5b3448d340..9ca3bdab457cd 100644 --- a/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php +++ b/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php @@ -261,21 +261,10 @@ public function testCreateCollection($pagerEnable, $productsCount, $productsPerP $this->collectionFactory->expects($this->once())->method('create')->willReturn($collection); $this->productsList->setData('conditions_encoded', 'some_serialized_conditions'); - $conditions = $this->getMockBuilder('\Magento\Rule\Model\Condition\Combine') - ->setMethods(['collectValidatedAttributes']) - ->disableOriginalConstructor() - ->getMock(); - $conditions->expects($this->once())->method('collectValidatedAttributes') - ->with($collection) - ->willReturnSelf(); - $this->builder->expects($this->once())->method('attachConditionToCollection') - ->with($collection, $conditions) + ->with($collection, $this->getConditionsForCollection($collection)) ->willReturnSelf(); - $this->rule->expects($this->once())->method('loadPost')->willReturnSelf(); - $this->rule->expects($this->once())->method('getConditions')->willReturn($conditions); - if ($productsPerPage) { $this->productsList->setData('products_per_page', $productsPerPage); } else { @@ -333,7 +322,46 @@ public function testShowPager() public function testGetIdentities() { - $this->assertEquals([\Magento\Catalog\Model\Product::CACHE_TAG], $this->productsList->getIdentities()); + $collection = $this->getMockBuilder('\Magento\Catalog\Model\ResourceModel\Product\Collection') + ->setMethods([ + 'addAttributeToSelect', + 'getIterator', + ])->disableOriginalConstructor() + ->getMock(); + + $this->collectionFactory->expects($this->once())->method('create')->willReturn($collection); + $this->productsList->setData('conditions_encoded', 'some_serialized_conditions'); + + $this->builder->expects($this->once())->method('attachConditionToCollection') + ->with($collection, $this->getConditionsForCollection($collection)) + ->willReturnSelf(); + $product = $this->getMock('Magento\Catalog\Api\ProductInterface', ['getId']); + $product->expects($this->once())->method('getId')->willReturn('product_id'); + $collection->expects($this->once())->method('getIterator')->willReturn(new \ArrayIterator([$product])); + + $this->assertEquals( + [\Magento\Catalog\Model\Product::CACHE_TAG . '_' . 'product_id'], + $this->productsList->getIdentities() + ); + } + + /** + * @param $collection + * @return \PHPUnit_Framework_MockObject_MockObject + */ + private function getConditionsForCollection($collection) + { + $conditions = $this->getMockBuilder('\Magento\Rule\Model\Condition\Combine') + ->setMethods(['collectValidatedAttributes']) + ->disableOriginalConstructor() + ->getMock(); + $conditions->expects($this->once())->method('collectValidatedAttributes') + ->with($collection) + ->willReturnSelf(); + + $this->rule->expects($this->once())->method('loadPost')->willReturnSelf(); + $this->rule->expects($this->once())->method('getConditions')->willReturn($conditions); + return $conditions; } public function testGetTitle() From 583eedaa85966ef13142c284c9e113feffcd4ece Mon Sep 17 00:00:00 2001 From: Robert He Date: Mon, 13 Jun 2016 11:06:36 -0500 Subject: [PATCH 309/345] MAGETWO-52891: [FT] CreateSimpleProductEntityTest failed to recognize a comma and a dot in the product price - fix error without changing constructor --- .../Product/Form/Modifier/EavTest.php | 22 +++++++- .../Product/Form/Modifier/CustomOptions.php | 32 ++++++++---- .../Product/Form/Modifier/Eav.php | 22 ++++++-- .../Product/Form/Modifier/General.php | 52 ++++++++++++++----- 4 files changed, 98 insertions(+), 30 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/EavTest.php b/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/EavTest.php index ecaf496a949af..6b09d7b6c4398 100755 --- a/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/EavTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/EavTest.php @@ -31,6 +31,7 @@ use Magento\Catalog\Model\ResourceModel\Eav\Attribute; use Magento\Framework\Currency; use Magento\Framework\Locale\Currency as CurrencyLocale; +Use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; /** * Class EavTest @@ -156,9 +157,20 @@ class EavTest extends AbstractModifierTest */ protected $currencyLocaleMock; + /** + * @var ObjectManager + */ + protected $objectManager; + + /** + * @var Eav + */ + protected $eav; + protected function setUp() { parent::setUp(); + $this->objectManager = new ObjectManager($this); $this->eavConfigMock = $this->getMockBuilder(Config::class) ->disableOriginalConstructor() ->getMock(); @@ -265,6 +277,13 @@ protected function setUp() ->disableOriginalConstructor() ->setMethods(['getCurrency']) ->getMock(); + + $this->eav =$this->getModel(); + $this->objectManager->setBackwardCompatibleProperty( + $this->eav, + 'localeCurrency', + $this->currencyLocaleMock + ); } /** @@ -285,7 +304,6 @@ protected function createModel() 'attributeGroupRepository' => $this->attributeGroupRepositoryMock, 'sortOrderBuilder' => $this->sortOrderBuilderMock, 'attributeRepository' => $this->attributeRepositoryMock, - 'localeCurrency' => $this->currencyLocaleMock, ]); } @@ -379,6 +397,6 @@ public function testModifyData() ->method('getCurrency') ->willReturn($this->currencyMock); - $this->assertEquals($sourceData, $this->getModel()->modifyData([])); + $this->assertEquals($sourceData, $this->eav->modifyData([])); } } diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/CustomOptions.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/CustomOptions.php index 793f5c4ee39f5..d4103e20c5647 100755 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/CustomOptions.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/CustomOptions.php @@ -112,12 +112,7 @@ class CustomOptions extends AbstractModifier * @var UrlInterface */ protected $urlBuilder; - - /** - * @var CurrencyInterface - */ - protected $localeCurrency; - + /** * @var ArrayManager */ @@ -128,13 +123,17 @@ class CustomOptions extends AbstractModifier */ protected $meta = []; + /** + * @var CurrencyInterface + */ + private $localeCurrency; + /** * @param LocatorInterface $locator * @param StoreManagerInterface $storeManager * @param ConfigInterface $productOptionsConfig * @param ProductOptionsPrice $productOptionsPrice * @param UrlInterface $urlBuilder - * @param CurrencyInterface $localeCurrency * @param ArrayManager $arrayManager */ public function __construct( @@ -143,7 +142,6 @@ public function __construct( ConfigInterface $productOptionsConfig, ProductOptionsPrice $productOptionsPrice, UrlInterface $urlBuilder, - CurrencyInterface $localeCurrency, ArrayManager $arrayManager ) { $this->locator = $locator; @@ -151,7 +149,6 @@ public function __construct( $this->productOptionsConfig = $productOptionsConfig; $this->productOptionsPrice = $productOptionsPrice; $this->urlBuilder = $urlBuilder; - $this->localeCurrency = $localeCurrency; $this->arrayManager = $arrayManager; } @@ -1079,6 +1076,21 @@ protected function getCurrencySymbol() return $this->storeManager->getStore()->getBaseCurrency()->getCurrencySymbol(); } + /** + * The getter function to get the locale currency for real application code + * + * @return \Magento\Framework\Locale\CurrencyInterface + * + * @deprecated + */ + private function getLocaleCurrency() + { + if ($this->localeCurrency === null) { + $this->localeCurrency = \Magento\Framework\App\ObjectManager::getInstance()->get(CurrencyInterface::class); + } + return $this->localeCurrency; + } + /** * Format price according to the locale of the currency * @@ -1092,7 +1104,7 @@ protected function formatPrice($value) } $store = $this->storeManager->getStore(); - $currency = $this->localeCurrency->getCurrency($store->getBaseCurrencyCode()); + $currency = $this->getLocaleCurrency()->getCurrency($store->getBaseCurrencyCode()); $value = $currency->toCurrency($value, ['display' => \Magento\Framework\Currency::NO_SYMBOL]); return $value; diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php index d5e83cf79c726..4fe12118dbfb3 100755 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php @@ -165,7 +165,7 @@ class Eav extends AbstractModifier /** * @var CurrencyInterface */ - protected $localeCurrency; + private $localeCurrency; /** * @param LocatorInterface $locator @@ -185,7 +185,6 @@ class Eav extends AbstractModifier * @param ArrayManager $arrayManager * @param ScopeOverriddenValue $scopeOverriddenValue * @param DataPersistorInterface $dataPersistor - * @param CurrencyInterface $localeCurrency * @param array $attributesToDisable * @param array $attributesToEliminate * @SuppressWarnings(PHPMD.ExcessiveParameterList) @@ -208,7 +207,6 @@ public function __construct( ArrayManager $arrayManager, ScopeOverriddenValue $scopeOverriddenValue, DataPersistorInterface $dataPersistor, - CurrencyInterface $localeCurrency, $attributesToDisable = [], $attributesToEliminate = [] ) { @@ -229,7 +227,6 @@ public function __construct( $this->arrayManager = $arrayManager; $this->scopeOverriddenValue = $scopeOverriddenValue; $this->dataPersistor = $dataPersistor; - $this->localeCurrency = $localeCurrency; $this->attributesToDisable = $attributesToDisable; $this->attributesToEliminate = $attributesToEliminate; } @@ -877,6 +874,21 @@ private function calculateGroupCode(AttributeGroupInterface $group) return $attributeGroupCode; } + /** + * The getter function to get the locale currency for real application code + * + * @return \Magento\Framework\Locale\CurrencyInterface + * + * @deprecated + */ + private function getLocaleCurrency() + { + if ($this->localeCurrency === null) { + $this->localeCurrency = \Magento\Framework\App\ObjectManager::getInstance()->get(CurrencyInterface::class); + } + return $this->localeCurrency; + } + /** * Format price according to the locale of the currency * @@ -890,7 +902,7 @@ protected function formatPrice($value) } $store = $this->storeManager->getStore(); - $currency = $this->localeCurrency->getCurrency($store->getBaseCurrencyCode()); + $currency = $this->getLocaleCurrency()->getCurrency($store->getBaseCurrencyCode()); $value = $currency->toCurrency($value, ['display' => \Magento\Framework\Currency::NO_SYMBOL]); return $value; diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/General.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/General.php index 23247445ee1ee..7b54a508b8168 100755 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/General.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/General.php @@ -30,29 +30,23 @@ class General extends AbstractModifier /** * @var StoreManagerInterface */ - protected $storeManager; + private $storeManager; /** * @var CurrencyInterface */ - protected $localeCurrency; + private $localeCurrency; /** * @param LocatorInterface $locator * @param ArrayManager $arrayManager - * @param StoreManagerInterface $storeManager - * @param CurrencyInterface $localeCurrency */ public function __construct( LocatorInterface $locator, - ArrayManager $arrayManager, - StoreManagerInterface $storeManager, - CurrencyInterface $localeCurrency + ArrayManager $arrayManager ) { $this->locator = $locator; $this->arrayManager = $arrayManager; - $this->storeManager = $storeManager; - $this->localeCurrency = $localeCurrency; } /** @@ -369,6 +363,38 @@ protected function customizeNameListeners(array $meta) ); } + /** + * The getter function to get the locale currency for real application code + * + * @return \Magento\Framework\Locale\CurrencyInterface + * + * @deprecated + */ + private function getLocaleCurrency() + { + if ($this->localeCurrency === null) { + $this->localeCurrency = \Magento\Framework\App\ObjectManager::getInstance()->get(CurrencyInterface::class); + } + return $this->localeCurrency; + } + + /** + * The getter function to get the store manager for real application code + * + * @return \Magento\Store\Model\StoreManagerInterface + * + * @deprecated + */ + private function getStoreManager() + { + if ($this->storeManager === null) { + $this->storeManager = + \Magento\Framework\App\ObjectManager::getInstance()->get(StoreManagerInterface::class); + } + return $this->storeManager; + } + + /** * Format price according to the locale of the currency * @@ -381,8 +407,8 @@ protected function formatPrice($value) return null; } - $store = $this->storeManager->getStore(); - $currency = $this->localeCurrency->getCurrency($store->getBaseCurrencyCode()); + $store = $this->getStoreManager()->getStore(); + $currency = $this->getLocaleCurrency()->getCurrency($store->getBaseCurrencyCode()); $value = $currency->toCurrency($value, ['display' => \Magento\Framework\Currency::NO_SYMBOL]); return $value; @@ -402,8 +428,8 @@ protected function formatNumber($value) $value = (float)$value; $precision = strlen(substr(strrchr($value, "."), 1)); - $store = $this->storeManager->getStore(); - $currency = $this->localeCurrency->getCurrency($store->getBaseCurrencyCode()); + $store = $this->getStoreManager()->getStore(); + $currency = $this->getLocaleCurrency()->getCurrency($store->getBaseCurrencyCode()); $value = $currency->toCurrency($value, ['display' => \Magento\Framework\Currency::NO_SYMBOL, 'precision' => $precision]); From 9e4fa33a8e756ee3f4f9219c1ff8d0193efcc045 Mon Sep 17 00:00:00 2001 From: Ankur Kaneria Date: Mon, 13 Jun 2016 13:22:28 -0500 Subject: [PATCH 310/345] MAGETWO-54205: After Disable/Enable Magento modules via CLI all cache types become disabled --- .../Magento/Framework/Code/GeneratedFiles.php | 133 ++++++++++++++---- 1 file changed, 108 insertions(+), 25 deletions(-) diff --git a/lib/internal/Magento/Framework/Code/GeneratedFiles.php b/lib/internal/Magento/Framework/Code/GeneratedFiles.php index 21307f26266bd..ef431939f314d 100644 --- a/lib/internal/Magento/Framework/Code/GeneratedFiles.php +++ b/lib/internal/Magento/Framework/Code/GeneratedFiles.php @@ -43,6 +43,46 @@ public function __construct(DirectoryList $directoryList, WriteFactory $writeFac $this->write = $writeFactory->create(BP); } + /** + * Clean generated code and DI configuration + * + * @return void + * + * @deprecated + * @see \Magento\Framework\Code\GeneratedFiles::cleanGeneratedFiles + */ + public function regenerate() + { + if ($this->write->isExist(self::REGENERATE_FLAG)) { + //TODO: to be removed in scope of MAGETWO-53476 + //clean cache + $deploymentConfig = $this->directoryList->getPath(DirectoryList::CONFIG); + $configPool = new ConfigFilePool(); + $envPath = $deploymentConfig . '/' . $configPool->getPath(ConfigFilePool::APP_ENV); + if ($this->write->isExist($this->write->getRelativePath($envPath))) { + $this->saveCacheStatus($envPath); + } + //TODO: Till here + $cachePath = $this->write->getRelativePath($this->directoryList->getPath(DirectoryList::CACHE)); + $generationPath = $this->write->getRelativePath($this->directoryList->getPath(DirectoryList::GENERATION)); + $diPath = $this->write->getRelativePath($this->directoryList->getPath(DirectoryList::DI)); + + if ($this->write->isDirectory($generationPath)) { + $this->write->delete($generationPath); + } + if ($this->write->isDirectory($diPath)) { + $this->write->delete($diPath); + } + if ($this->write->isDirectory($cachePath)) { + $this->write->delete($cachePath); + } + //add to queue + + $this->write->delete(self::REGENERATE_FLAG); + } + } + + /** * Clean var/generation, var/di and var/cache * @@ -52,12 +92,14 @@ public function cleanGeneratedFiles() { if ($this->write->isExist(self::REGENERATE_FLAG)) { + $cacheStatus = []; + //TODO: to be removed in scope of MAGETWO-53476 $deploymentConfig = $this->directoryList->getPath(DirectoryList::CONFIG); $configPool = new ConfigFilePool(); $envPath = $deploymentConfig . '/' . $configPool->getPath(ConfigFilePool::APP_ENV); if ($this->write->isExist($this->write->getRelativePath($envPath))) { - $this->saveCacheConfiguration(); + $cacheStatus = $this->getCacheStatus(); $this->disableAllCacheTypes(); } //TODO: Till here @@ -81,7 +123,7 @@ public function cleanGeneratedFiles() $this->write->delete($cachePath); } $this->write->delete(self::REGENERATE_FLAG); - $this->reEnableCacheTypes(); + $this->restoreCacheStatus($cacheStatus); } } @@ -97,17 +139,19 @@ public function requestRegeneration() } /** - * Reads Cache configuration from env.php and write to a json file. + * Read Cache types from env.php and write to a json file. * + * @param string $envPath * @return void + * */ - public function saveCacheConfiguration() + private function saveCacheStatus($envPath) { - $envPath = $this->GetEnvPath(); - $envData = include $envPath; + $cacheData = include $envPath; - if (isset($envData['cache_types'])) { - $enabledCacheTypes = array_filter($envData['cache_types'], function ($value) { + if (isset($cacheData['cache_types'])) { + $enabledCacheTypes = $cacheData['cache_types']; + $enabledCacheTypes = array_filter($enabledCacheTypes, function ($value) { return $value; }); if (!empty($enabledCacheTypes)) { @@ -116,17 +160,56 @@ public function saveCacheConfiguration() $this->write->getRelativePath($varDir) . '/.cachestates.json', json_encode($enabledCacheTypes) ); + $cacheTypes = array_keys($cacheData['cache_types']); + + foreach ($cacheTypes as $cacheType) { + $cacheData['cache_types'][$cacheType] = 0; + } + + $formatter = new PhpFormatter(); + $contents = $formatter->format($cacheData); + + $this->write->writeFile($this->write->getRelativePath($envPath), $contents); + if (function_exists('opcache_invalidate')) { + opcache_invalidate( + $this->write->getAbsolutePath($envPath) + ); + } } } } + /** + * Reads Cache configuration from env.php and returns the 'cache_types' key data which is the current + * cache status. + * + * @return array + */ + private function getCacheStatus() + { + $cacheStatus = []; + if (empty($envPath)) { + $envPath = $this->getEnvPath(); + } + + if ($this->write->isExist($this->write->getRelativePath($envPath) && + $this->write->isReadable($this->write->getRelativePath($envPath)))) { + $envData = include $envPath; + if (isset($envData['cache_types'])) { + $cacheStatus = $envData['cache_types']; + } + } + return $cacheStatus; + } + + /** * Returns path to env.php file * * @return string * @throws \Exception */ - private function GetEnvPath() + private function getEnvPath() { $deploymentConfig = $this->directoryList->getPath(DirectoryList::CONFIG); $configPool = new ConfigFilePool(); @@ -141,7 +224,7 @@ private function GetEnvPath() */ private function disableAllCacheTypes() { - $envPath = $this->GetEnvPath(); + $envPath = $this->getEnvPath(); $envData = include $envPath; if (isset($envData['cache_types'])) { @@ -164,24 +247,26 @@ private function disableAllCacheTypes() } /** - * Enables appropriate cache types based on var/.cachestates file settings + * restore the cacache setting in env.php * TODO: to be removed in scope of MAGETWO-53476 * + * @param array + * * @return void */ - private function reEnableCacheTypes() + private function restoreCacheStatus($cacheStatus) { - $pathToCacheStatus = $this->write->getRelativePath( - $this->directoryList->getPath(DirectoryList::VAR_DIR) . '/.cachestates.json' - ); - - if ($this->write->isExist($pathToCacheStatus)) { - $enabledCacheTypes = array_keys(json_decode($this->write->readFile($pathToCacheStatus), true)); - - $envPath = $this->GetEnvPath(); + if (empty($cacheStatus)) { + return; + } + $envPath = $this->getEnvPath(); + if ($this->write->isExist($this->write->getRelativePath($envPath) && + $this->write->isReadable($this->write->getRelativePath($envPath)))) { $envData = include $envPath; - foreach ($enabledCacheTypes as $cacheType) { - $envData['cache_types'][$cacheType] = 1; + foreach ($cacheStatus as $cacheType => $state) { + if (isset($envData['cache_types'][$cacheType])) { + $envData['cache_types'][$cacheType] = $state; + } } $formatter = new PhpFormatter(); @@ -189,9 +274,7 @@ private function reEnableCacheTypes() $this->write->writeFile($this->write->getRelativePath($envPath), $contents); if (function_exists('opcache_invalidate')) { - opcache_invalidate( - $this->write->getAbsolutePath($envPath) - ); + opcache_invalidate($this->write->getAbsolutePath($envPath)); } } } From a83acb71910946fd1f1e4c9eaef89955b5ce6dc8 Mon Sep 17 00:00:00 2001 From: Ankur Kaneria Date: Mon, 13 Jun 2016 14:15:06 -0500 Subject: [PATCH 311/345] MAGETWO-54205: After Disable/Enable Magento modules via CLI all cache types become disabled --- lib/internal/Magento/Framework/Code/GeneratedFiles.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/internal/Magento/Framework/Code/GeneratedFiles.php b/lib/internal/Magento/Framework/Code/GeneratedFiles.php index ef431939f314d..ec4182df962cf 100644 --- a/lib/internal/Magento/Framework/Code/GeneratedFiles.php +++ b/lib/internal/Magento/Framework/Code/GeneratedFiles.php @@ -192,8 +192,7 @@ private function getCacheStatus() $envPath = $this->getEnvPath(); } - if ($this->write->isExist($this->write->getRelativePath($envPath) && - $this->write->isReadable($this->write->getRelativePath($envPath)))) { + if ($this->write->isReadable($this->write->getRelativePath($envPath))) { $envData = include $envPath; if (isset($envData['cache_types'])) { $cacheStatus = $envData['cache_types']; @@ -260,8 +259,7 @@ private function restoreCacheStatus($cacheStatus) return; } $envPath = $this->getEnvPath(); - if ($this->write->isExist($this->write->getRelativePath($envPath) && - $this->write->isReadable($this->write->getRelativePath($envPath)))) { + if ($this->write->isReadable($this->write->getRelativePath($envPath))) { $envData = include $envPath; foreach ($cacheStatus as $cacheType => $state) { if (isset($envData['cache_types'][$cacheType])) { From 81a5c5a965a871f852e209f40958167ca861b198 Mon Sep 17 00:00:00 2001 From: Andrii Lugovyi Date: Mon, 13 Jun 2016 22:19:07 +0300 Subject: [PATCH 312/345] MAGETWO-54200: Wrong "gift_message_available" parameter exported --- .../Model/Export/Product.php | 3 +-- .../Model/Import/Product.php | 1 - .../Model/GiftMessageConfigProvider.php | 15 ++++++++---- .../Magento/GiftMessage/Setup/UpgradeData.php | 23 ++++++++++++++----- .../Product/Modifier/GiftMessage.php | 20 ++++++++-------- 5 files changed, 38 insertions(+), 24 deletions(-) diff --git a/app/code/Magento/CatalogImportExport/Model/Export/Product.php b/app/code/Magento/CatalogImportExport/Model/Export/Product.php index 8afc9e369d772..4e78d6cf93085 100644 --- a/app/code/Magento/CatalogImportExport/Model/Export/Product.php +++ b/app/code/Magento/CatalogImportExport/Model/Export/Product.php @@ -84,8 +84,7 @@ class Product extends \Magento\ImportExport\Model\Export\Entity\AbstractEntity * @var string[] */ protected $_indexValueAttributes = [ - 'status', - 'gift_message_available', + 'status' ]; /** diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product.php b/app/code/Magento/CatalogImportExport/Model/Import/Product.php index 5c4a19efba143..970b8a1aaea0f 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product.php @@ -196,7 +196,6 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity protected $_indexValueAttributes = [ 'status', 'tax_class_id', - 'gift_message_available', ]; /** diff --git a/app/code/Magento/GiftMessage/Model/GiftMessageConfigProvider.php b/app/code/Magento/GiftMessage/Model/GiftMessageConfigProvider.php index 08849921cbf87..c3ed51e45a1df 100644 --- a/app/code/Magento/GiftMessage/Model/GiftMessageConfigProvider.php +++ b/app/code/Magento/GiftMessage/Model/GiftMessageConfigProvider.php @@ -12,6 +12,8 @@ use Magento\Framework\UrlInterface; use Magento\Framework\Locale\FormatInterface as LocaleFormat; use Magento\Framework\Data\Form\FormKey; +use Magento\Catalog\Model\Product\Attribute\Source\Boolean; +use Magento\Store\Model\ScopeInterface; /** * Configuration provider for GiftMessage rendering on "Checkout cart" page. @@ -94,11 +96,11 @@ public function getConfig() $configuration['giftMessage'] = []; $orderLevelGiftMessageConfiguration = (bool)$this->scopeConfiguration->getValue( GiftMessageHelper::XPATH_CONFIG_GIFT_MESSAGE_ALLOW_ORDER, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE + ScopeInterface::SCOPE_STORE ); $itemLevelGiftMessageConfiguration = (bool)$this->scopeConfiguration->getValue( GiftMessageHelper::XPATH_CONFIG_GIFT_MESSAGE_ALLOW_ITEMS, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE + ScopeInterface::SCOPE_STORE ); if ($orderLevelGiftMessageConfiguration) { $orderMessages = $this->getOrderLevelGiftMessages(); @@ -178,9 +180,12 @@ protected function getItemLevelGiftMessages() $itemId = $item->getId(); $itemLevelConfig[$itemId] = []; $isMessageAvailable = $item->getProduct()->getGiftMessageAvailable(); - // use gift message product setting if it is available - if ($isMessageAvailable !== null) { - $itemLevelConfig[$itemId]['is_available'] = (bool)$isMessageAvailable; + + if ($isMessageAvailable == Boolean::VALUE_USE_CONFIG || in_array($isMessageAvailable, [null, ''], true)) { + $itemLevelConfig[$itemId]['is_available'] = (bool)$this->scopeConfiguration->getValue( + GiftMessageHelper::XPATH_CONFIG_GIFT_MESSAGE_ALLOW_ITEMS, + ScopeInterface::SCOPE_STORE + ); } $message = $this->itemRepository->get($quote->getId(), $itemId); if ($message) { diff --git a/app/code/Magento/GiftMessage/Setup/UpgradeData.php b/app/code/Magento/GiftMessage/Setup/UpgradeData.php index a73009a36baf7..9429c27e2ab5d 100644 --- a/app/code/Magento/GiftMessage/Setup/UpgradeData.php +++ b/app/code/Magento/GiftMessage/Setup/UpgradeData.php @@ -35,19 +35,20 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface { $setup->startSetup(); + /** @var \Magento\Catalog\Setup\CategorySetup $categorySetup */ + $categorySetup = $this->categorySetupFactory->create(['setup' => $setup]); + $entityTypeId = $categorySetup->getEntityTypeId(Product::ENTITY); + $attributeSetId = $categorySetup->getAttributeSetId($entityTypeId, 'Default'); + $attribute = $categorySetup->getAttribute($entityTypeId, 'gift_message_available'); + if (version_compare($context->getVersion(), '2.0.1', '<')) { - /** @var \Magento\Catalog\Setup\CategorySetup $categorySetup */ - $categorySetup = $this->categorySetupFactory->create(['setup' => $setup]); + $groupName = 'Gift Options'; if (!$categorySetup->getAttributeGroup(Product::ENTITY, 'Default', $groupName)) { $categorySetup->addAttributeGroup(Product::ENTITY, 'Default', $groupName, 60); } - $entityTypeId = $categorySetup->getEntityTypeId(Product::ENTITY); - $attributeSetId = $categorySetup->getAttributeSetId($entityTypeId, 'Default'); - $attribute = $categorySetup->getAttribute($entityTypeId, 'gift_message_available'); - $categorySetup->addAttributeToGroup( $entityTypeId, $attributeSetId, @@ -57,6 +58,16 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface ); } + if (version_compare($context->getVersion(), '2.1.0', '<')) { + + $categorySetup->updateAttribute( + $entityTypeId, + $attribute['attribute_id'], + 'source_model', + 'Magento\Catalog\Model\Product\Attribute\Source\Boolean' + ); + } + $setup->endSetup(); } } diff --git a/app/code/Magento/GiftMessage/Ui/DataProvider/Product/Modifier/GiftMessage.php b/app/code/Magento/GiftMessage/Ui/DataProvider/Product/Modifier/GiftMessage.php index 606687fe1da1e..0a0d5514accfc 100644 --- a/app/code/Magento/GiftMessage/Ui/DataProvider/Product/Modifier/GiftMessage.php +++ b/app/code/Magento/GiftMessage/Ui/DataProvider/Product/Modifier/GiftMessage.php @@ -13,6 +13,7 @@ use Magento\Store\Model\ScopeInterface; use Magento\Ui\Component\Form\Element\Checkbox; use Magento\Ui\Component\Form\Field; +use Magento\Catalog\Model\Product\Attribute\Source\Boolean; /** * Class GiftMessageDataProvider @@ -63,9 +64,8 @@ public function modifyData(array $data) $value = $data[$modelId][static::DATA_SOURCE_DEFAULT][static::FIELD_MESSAGE_AVAILABLE]; } - if ('' === $value) { - $data[$modelId][static::DATA_SOURCE_DEFAULT][static::FIELD_MESSAGE_AVAILABLE] = - $this->getValueFromConfig(); + if ($value == Boolean::VALUE_USE_CONFIG || $value === '' || $value === null) { + $data[$modelId][static::DATA_SOURCE_DEFAULT][static::FIELD_MESSAGE_AVAILABLE] = $this->getValueFromConfig(); $data[$modelId][static::DATA_SOURCE_DEFAULT]['use_config_' . static::FIELD_MESSAGE_AVAILABLE] = '1'; } @@ -129,14 +129,8 @@ protected function customizeAllowGiftMessageField(array $meta) 'data' => [ 'config' => [ 'dataScope' => static::FIELD_MESSAGE_AVAILABLE, - 'imports' => [ - 'disabled' => - '${$.parentName}.use_config_' - . static::FIELD_MESSAGE_AVAILABLE - . ':checked', - ], + 'component' => 'Magento_Ui/js/form/element/single-checkbox-use-config', 'additionalClasses' => 'admin__field-x-small', - 'formElement' => Checkbox::NAME, 'componentType' => Field::NAME, 'prefer' => 'toggle', 'valueMap' => [ @@ -160,6 +154,12 @@ protected function customizeAllowGiftMessageField(array $meta) 'false' => '0', 'true' => '1', ], + 'exports' => [ + 'checked' => '${$.parentName}.' . static::FIELD_MESSAGE_AVAILABLE . ':isUseConfig', + ], + 'imports' => [ + 'disabled' => '${$.parentName}.' . static::FIELD_MESSAGE_AVAILABLE . ':isUseDefault', + ], ], ], ], From da198f25ec1af6d970d08b83a788052a7dde8b64 Mon Sep 17 00:00:00 2001 From: Cari Spruiell Date: Mon, 13 Jun 2016 15:56:49 -0500 Subject: [PATCH 313/345] MAGETWO-52165: [PS-API-FT] Fix functional test Magento\User\Test\TestCase\RevokeAllAccessTokensForAdminWithoutTokensTest - over-escape apostrophe was breaking the Force Sign-In button --- app/code/Magento/User/Block/User/Edit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/User/Block/User/Edit.php b/app/code/Magento/User/Block/User/Edit.php index 40b719bdffc08..bd69d23b01afd 100644 --- a/app/code/Magento/User/Block/User/Edit.php +++ b/app/code/Magento/User/Block/User/Edit.php @@ -53,7 +53,7 @@ protected function _construct() $objId = $this->getRequest()->getParam($this->_objectId); if (!empty($objId)) { - $deleteConfirmMsg = __("Are you sure you want to revoke the users\\\\'s tokens?"); + $deleteConfirmMsg = __("Are you sure you want to revoke the user\'s tokens?"); $this->addButton( 'invalidate', [ From 7396ce3cd1930e215ccbddc0693fdc554ffc938e Mon Sep 17 00:00:00 2001 From: Igor Melnikov Date: Mon, 13 Jun 2016 16:01:35 -0500 Subject: [PATCH 314/345] MAGETWO-54341: Add @deprecated annotation to load, save and delete methods in AbstractModel Adding annotation --- lib/internal/Magento/Framework/Model/AbstractModel.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/internal/Magento/Framework/Model/AbstractModel.php b/lib/internal/Magento/Framework/Model/AbstractModel.php index 0c0dabaec456b..be41ca10ee8f6 100644 --- a/lib/internal/Magento/Framework/Model/AbstractModel.php +++ b/lib/internal/Magento/Framework/Model/AbstractModel.php @@ -523,6 +523,7 @@ public function getCollection() * @param integer $modelId * @param null|string $field * @return $this + * @deprecated */ public function load($modelId, $field = null) { @@ -623,6 +624,7 @@ public function setHasDataChanges($flag) * * @return $this * @throws \Exception + * @deprecated */ public function save() { @@ -807,6 +809,7 @@ public function afterSave() * * @return $this * @throws \Exception + * @deprecated */ public function delete() { From 91ca5ad55119fadaff8a19cffc56a499d33e1430 Mon Sep 17 00:00:00 2001 From: Alexander Paliarush Date: Mon, 13 Jun 2016 16:11:13 -0500 Subject: [PATCH 315/345] CICD-2236: S2 builds are broken after bamboo migration --- .../app/Magento/Upgrade/Test/TestCase/UpgradeSystemTest.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Upgrade/Test/TestCase/UpgradeSystemTest.php b/dev/tests/functional/tests/app/Magento/Upgrade/Test/TestCase/UpgradeSystemTest.php index cfdd69bfa0ace..f5933fa91e51d 100644 --- a/dev/tests/functional/tests/app/Magento/Upgrade/Test/TestCase/UpgradeSystemTest.php +++ b/dev/tests/functional/tests/app/Magento/Upgrade/Test/TestCase/UpgradeSystemTest.php @@ -81,8 +81,9 @@ public function test( . "(-{$preReleaseVersion}(\\.{$preReleaseVersion})*)?" . "(\\+{$buildVersion}(\\.{$buildVersion})*)?{$suffix}/"; - if (preg_match($versionPattern, $version, $out)) { - $version = array_shift($out); + if (preg_match($versionPattern, $version)) { + preg_match("/(.*){$suffix}/", $version, $matches); + $version = $matches[1]; } else { $this->fail( "Provided version format does not comply with semantic versioning specification. Got '{$version}'" From 548abd8e5ab41df534d5d79fda1229f5dea23373 Mon Sep 17 00:00:00 2001 From: Oleksii Korshenko Date: Mon, 13 Jun 2016 17:33:53 -0500 Subject: [PATCH 316/345] MAGETWO-53121: [Email] "502 Bad Gateway" error when "New Account" email is initiated with custom templates --- .../Theme/Model/Design/Config/Validator.php | 109 ++++++++++++++++ .../Theme/Model/DesignConfigRepository.php | 26 ++++ .../Test/Unit/Model/Config/ValidatorTest.php | 123 ++++++++++++++++++ .../Model/Config/_files/template_fixture.html | 31 +++++ .../Unit/Model/DesignConfigRepositoryTest.php | 29 ++++- app/code/Magento/Theme/etc/adminhtml/di.xml | 8 ++ .../Email/Model/_files/email_template.php | 19 +++ .../Email/Model/_files/template_fixture.html | 29 +++++ .../Theme/Model/Config/ValidatorTest.php | 107 +++++++++++++++ 9 files changed, 477 insertions(+), 4 deletions(-) create mode 100644 app/code/Magento/Theme/Model/Design/Config/Validator.php create mode 100644 app/code/Magento/Theme/Test/Unit/Model/Config/ValidatorTest.php create mode 100644 app/code/Magento/Theme/Test/Unit/Model/Config/_files/template_fixture.html create mode 100644 dev/tests/integration/testsuite/Magento/Email/Model/_files/email_template.php create mode 100644 dev/tests/integration/testsuite/Magento/Email/Model/_files/template_fixture.html create mode 100644 dev/tests/integration/testsuite/Magento/Theme/Model/Config/ValidatorTest.php diff --git a/app/code/Magento/Theme/Model/Design/Config/Validator.php b/app/code/Magento/Theme/Model/Design/Config/Validator.php new file mode 100644 index 0000000000000..7f1b95670c8e6 --- /dev/null +++ b/app/code/Magento/Theme/Model/Design/Config/Validator.php @@ -0,0 +1,109 @@ +templateFactory = $templateFactory; + $this->fields = $fields; + } + + /** + * Validate if design configuration has recursive references + * + * @param DesignConfigInterface $designConfig + * + * @throws LocalizedException + * @return void + */ + public function validate(DesignConfigInterface $designConfig) + { + /** @var DesignConfigDataInterface[] $designConfigData */ + $designConfigData = $designConfig->getExtensionAttributes()->getDesignConfigData(); + $elements = []; + foreach ($designConfigData as $designElement) { + if (!in_array($designElement->getFieldConfig()['field'], $this->fields)) { + continue; + } + /* Save mapping between field names and config paths */ + $elements[$designElement->getFieldConfig()['field']] = [ + 'config_path' => $designElement->getPath(), + 'value' => $designElement->getValue() + ]; + } + + foreach ($elements as $name => $data) { + // Load template object by configured template id + $template = $this->templateFactory->create(); + $template->emulateDesign($designConfig->getScopeId()); + $templateId = $data['value']; + if (is_numeric($templateId)) { + $template->load($templateId); + } else { + $template->loadDefault($templateId); + } + $text = $template->getTemplateText(); + $template->revertDesign(); + // Check if template body has a reference to the same config path + if (preg_match_all(Template::CONSTRUCTION_TEMPLATE_PATTERN, $text, $constructions, PREG_SET_ORDER)) { + foreach ($constructions as $construction) { + $configPath = isset($construction[2]) ? $construction[2] : ''; + $params = $this->getParameters($configPath); + if (isset($params['config_path']) && $params['config_path'] == $data['config_path']) { + throw new LocalizedException( + __( + "Incorrect configuration for %templateName. Template body has a reference to itself", + ["templateName" => $name] + ) + ); + }; + } + } + } + } + + /** + * Return associative array of parameters. + * + * @param string $value raw parameters + * @return array + */ + private function getParameters($value) + { + $tokenizer = new ParameterTokenizer(); + $tokenizer->setString($value); + $params = $tokenizer->tokenize(); + return $params; + } +} diff --git a/app/code/Magento/Theme/Model/DesignConfigRepository.php b/app/code/Magento/Theme/Model/DesignConfigRepository.php index 8645b2b0ffbb4..afebd188d4a9c 100644 --- a/app/code/Magento/Theme/Model/DesignConfigRepository.php +++ b/app/code/Magento/Theme/Model/DesignConfigRepository.php @@ -24,6 +24,13 @@ class DesignConfigRepository implements DesignConfigRepositoryInterface /** @var ConfigStorage */ protected $configStorage; + /** + * Design config validator + * + * @var \Magento\Theme\Model\Design\Config\Validator + */ + private $validator; + /** * @param ConfigStorage $configStorage * @param ReinitableConfigInterface $reinitableConfig @@ -39,6 +46,23 @@ public function __construct( $this->configStorage = $configStorage; } + /** + * Get config validator + * + * @return Design\Config\Validator + * + * @deprecated + */ + private function getValidator() + { + if (null === $this->validator) { + $this->validator =\Magento\Framework\App\ObjectManager::getInstance()->get( + \Magento\Theme\Model\Design\Config\Validator::class + ); + } + return $this->validator; + } + /** * @inheritDoc */ @@ -58,6 +82,8 @@ public function save(DesignConfigInterface $designConfig) throw new LocalizedException(__('Can not save empty config')); } + $this->getValidator()->validate($designConfig); + $this->configStorage->save($designConfig); $this->reinitableConfig->reinit(); $this->reindexGrid(); diff --git a/app/code/Magento/Theme/Test/Unit/Model/Config/ValidatorTest.php b/app/code/Magento/Theme/Test/Unit/Model/Config/ValidatorTest.php new file mode 100644 index 0000000000000..2e58a5a2f10bd --- /dev/null +++ b/app/code/Magento/Theme/Test/Unit/Model/Config/ValidatorTest.php @@ -0,0 +1,123 @@ +templateFactoryMock = $this->getMockBuilder(\Magento\Framework\Mail\TemplateInterfaceFactory::class) + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + + $objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); + $this->model = $objectManagerHelper->getObject( + \Magento\Theme\Model\Design\Config\Validator::class, + [ + "templateFactory" => $this->templateFactoryMock, + "fields" => ["email_header_template", "no_reference"] + ] + ); + } + + /** + * @expectedException \Magento\Framework\Exception\LocalizedException + * @expectedExceptionMessage Incorrect configuration for email_header_template. Template body has a reference to + */ + public function testValidateHasRecursiveReference() + { + $fieldConfig = [ + 'path' => 'design/email/header_template', + 'fieldset' => 'other_settings/email', + 'field' => 'email_header_template' + ]; + + $designConfigMock = $this->getMockBuilder(\Magento\Theme\Api\Data\DesignConfigInterface::class) + ->getMock(); + $designConfigExtensionMock = + $this->getMockBuilder(\Magento\Theme\Api\Data\DesignConfigExtensionInterface::class) + ->setMethods(['getDesignConfigData']) + ->getMock(); + $designElementMock = $this->getMockBuilder(\Magento\Theme\Model\Data\Design\Config\Data::class) + ->disableOriginalConstructor() + ->getMock(); + + $designConfigMock->expects($this->once()) + ->method('getExtensionAttributes') + ->willReturn($designConfigExtensionMock); + $designConfigExtensionMock->expects($this->once()) + ->method('getDesignConfigData') + ->willReturn([$designElementMock]); + $designElementMock->expects($this->any())->method('getFieldConfig')->willReturn($fieldConfig); + $designElementMock->expects($this->once())->method('getPath')->willReturn($fieldConfig['path']); + $designElementMock->expects($this->once())->method('getValue')->willReturn($fieldConfig['field']); + + $templateMock = $this->getMockBuilder(\Magento\Email\Model\TemplateInterface::class) + ->setMethods(['getTemplateText', 'emulateDesign', 'loadDefault', 'revertDesign']) + ->getMock(); + + $this->templateFactoryMock->expects($this->once())->method('create')->willReturn($templateMock); + $templateMock->expects($this->once())->method('getTemplateText')->willReturn( + file_get_contents(__DIR__ . '/_files/template_fixture.html') + ); + + $this->model->validate($designConfigMock); + } + + public function testValidateNoRecursiveReference() + { + $fieldConfig = [ + 'path' => 'no/reference', + 'fieldset' => 'no/reference', + 'field' => 'no_reference' + ]; + + $designConfigMock = $this->getMockBuilder(\Magento\Theme\Api\Data\DesignConfigInterface::class) + ->getMock(); + $designConfigExtensionMock = + $this->getMockBuilder(\Magento\Theme\Api\Data\DesignConfigExtensionInterface::class) + ->setMethods(['getDesignConfigData']) + ->getMock(); + $designElementMock = $this->getMockBuilder(\Magento\Theme\Model\Data\Design\Config\Data::class) + ->disableOriginalConstructor() + ->getMock(); + + $designConfigMock->expects($this->once()) + ->method('getExtensionAttributes') + ->willReturn($designConfigExtensionMock); + $designConfigExtensionMock->expects($this->once()) + ->method('getDesignConfigData') + ->willReturn([$designElementMock]); + $designElementMock->expects($this->any())->method('getFieldConfig')->willReturn($fieldConfig); + $designElementMock->expects($this->once())->method('getPath')->willReturn($fieldConfig['path']); + $designElementMock->expects($this->once())->method('getValue')->willReturn($fieldConfig['field']); + + $templateMock = $this->getMockBuilder(\Magento\Email\Model\TemplateInterface::class) + ->setMethods(['getTemplateText', 'emulateDesign', 'loadDefault', 'revertDesign']) + ->getMock(); + + $this->templateFactoryMock->expects($this->once())->method('create')->willReturn($templateMock); + $templateMock->expects($this->once())->method('getTemplateText')->willReturn( + file_get_contents(__DIR__ . '/_files/template_fixture.html') + ); + + $this->model->validate($designConfigMock); + } +} diff --git a/app/code/Magento/Theme/Test/Unit/Model/Config/_files/template_fixture.html b/app/code/Magento/Theme/Test/Unit/Model/Config/_files/template_fixture.html new file mode 100644 index 0000000000000..b29ebf62b1f0a --- /dev/null +++ b/app/code/Magento/Theme/Test/Unit/Model/Config/_files/template_fixture.html @@ -0,0 +1,31 @@ +{{template config_path="design/email/header_template"}} + +

{{trans "%name," name=$customer.name}}

+

{{trans "Welcome to %store_name." store_name=$store.getFrontendName()}}

+

+ {{trans + 'To sign in to our site, use these credentials during checkout or on the My Account page:' + + customer_url=$this.getUrl($store,'customer/account/',[_nosid:1]) + |raw}} +

+
    +
  • {{trans "Email:"}} {{var customer.email}}
  • +
  • {{trans "Password:"}} {{trans "Password you set when creating account"}}
  • +
+

+ {{trans + 'Forgot your account password? Click here to reset it.' + + reset_url="$this.getUrl($store,'customer/account/createPassword/',[_query:[id:$customer.id,token:$customer.rp_token],_nosid:1])" + |raw}} +

+

{{trans "When you sign in to your account, you will be able to:"}}

+
    +
  • {{trans "Proceed through checkout faster"}}
  • +
  • {{trans "Check the status of orders"}}
  • +
  • {{trans "View past orders"}}
  • +
  • {{trans "Store alternative addresses (for shipping to multiple family members and friends)"}}
  • +
+ +{{template config_path="design/email/footer_template"}} diff --git a/app/code/Magento/Theme/Test/Unit/Model/DesignConfigRepositoryTest.php b/app/code/Magento/Theme/Test/Unit/Model/DesignConfigRepositoryTest.php index 09c533d56a091..9cd13fc30f989 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/DesignConfigRepositoryTest.php +++ b/app/code/Magento/Theme/Test/Unit/Model/DesignConfigRepositoryTest.php @@ -7,6 +7,7 @@ use Magento\Theme\Model\Data\Design\Config; use Magento\Theme\Model\DesignConfigRepository; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; class DesignConfigRepositoryTest extends \PHPUnit_Framework_TestCase { @@ -34,6 +35,11 @@ class DesignConfigRepositoryTest extends \PHPUnit_Framework_TestCase /** @var DesignConfigRepository */ protected $repository; + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $validator; + public function setUp() { $this->configStorage = $this->getMock('Magento\Theme\Model\Design\Config\Storage', [], [], '', false); @@ -71,10 +77,24 @@ public function setUp() '', false ); - $this->repository = new DesignConfigRepository( - $this->configStorage, - $this->reinitableConfig, - $this->indexerRegistry + + $this->validator = $this->getMock( + \Magento\Theme\Model\Design\Config\Validator::class, + [], + [], + '', + false, + false + ); + $objectManagerHelper = new ObjectManager($this); + $this->repository = $objectManagerHelper->getObject( + DesignConfigRepository::class, + [ + 'configStorage' => $this->configStorage, + 'reinitableConfig' => $this->reinitableConfig, + 'indexerRegistry' => $this->indexerRegistry, + 'validator' => $this->validator + ] ); } @@ -97,6 +117,7 @@ public function testSave() ->willReturn($this->indexer); $this->indexer->expects($this->once()) ->method('reindexAll'); + $this->validator->expects($this->once())->method('validate')->with($this->designConfig); $this->assertSame($this->designConfig, $this->repository->save($this->designConfig)); } diff --git a/app/code/Magento/Theme/etc/adminhtml/di.xml b/app/code/Magento/Theme/etc/adminhtml/di.xml index 0b03d146cb108..0c043c2e36bac 100644 --- a/app/code/Magento/Theme/etc/adminhtml/di.xml +++ b/app/code/Magento/Theme/etc/adminhtml/di.xml @@ -33,4 +33,12 @@
+ + + + email_header_template + email_footer_template + + +
diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/_files/email_template.php b/dev/tests/integration/testsuite/Magento/Email/Model/_files/email_template.php new file mode 100644 index 0000000000000..7b78046a4e307 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Email/Model/_files/email_template.php @@ -0,0 +1,19 @@ +create('Magento\Email\Model\Template'); +$template->setId(1); +$template->setOptions(['area' => 'test area', 'store' => 1]); +$template->setData( + [ + 'template_text' => + file_get_contents(__DIR__ . '/template_fixture.html') + ] +); +$template->setTemplateCode('fixture'); +$template->save(); diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/_files/template_fixture.html b/dev/tests/integration/testsuite/Magento/Email/Model/_files/template_fixture.html new file mode 100644 index 0000000000000..7259962619a33 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Email/Model/_files/template_fixture.html @@ -0,0 +1,29 @@ +{{template config_path="design/email/header_template"}} + +

{{trans "%name," name=$customer.name}}

+

{{trans "Welcome to %store_name." store_name=$store.getFrontendName()}}

+

+ {{trans + 'To sign in to our site, use these credentials during checkout or on the My Account page:' + + customer_url=$this.getUrl($store,'customer/account/',[_nosid:1]) + |raw}} +

+
    +
  • {{trans "Email:"}} {{var customer.email}}
  • +
  • {{trans "Password:"}} {{trans "Password you set when creating account"}}
  • +
+

+ {{trans + 'Forgot your account password? Click here to reset it.' + + reset_url="$this.getUrl($store,'customer/account/createPassword/',[_query:[id:$customer.id,token:$customer.rp_token],_nosid:1])" + |raw}} +

+

{{trans "When you sign in to your account, you will be able to:"}}

+
    +
  • {{trans "Proceed through checkout faster"}}
  • +
  • {{trans "Check the status of orders"}}
  • +
  • {{trans "View past orders"}}
  • +
  • {{trans "Store alternative addresses (for shipping to multiple family members and friends)"}}
  • +
diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/Config/ValidatorTest.php b/dev/tests/integration/testsuite/Magento/Theme/Model/Config/ValidatorTest.php new file mode 100644 index 0000000000000..669671bf0c7c5 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/Config/ValidatorTest.php @@ -0,0 +1,107 @@ +get('Magento\Framework\App\AreaList') + ->getArea(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE) + ->load(\Magento\Framework\App\Area::PART_CONFIG); + $objectManager->get('Magento\Framework\App\State') + ->setAreaCode(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE); + + $this->model = $objectManager->get('Magento\Theme\Model\Design\Config\Validator'); + } + + /** + * @magentoDataFixture Magento/Email/Model/_files/email_template.php + * @expectedException \Magento\Framework\Exception\LocalizedException + * @expectedExceptionMessage Incorrect configuration for email_header_template. Template body has a reference to + */ + public function testValidateHasRecursiveReference() + { + $fieldConfig = [ + 'path' => 'design/email/header_template', + 'fieldset' => 'other_settings/email', + 'field' => 'email_header_template' + ]; + + $designConfigMock = $this->getMockBuilder('Magento\Theme\Api\Data\DesignConfigInterface') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMock(); + $designConfigExtensionMock = $this->getMockBuilder('Magento\Theme\Api\Data\DesignConfigExtensionInterface') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMock(); + $designElementMock = $this->getMockBuilder('Magento\Theme\Model\Data\Design\Config\Data') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMock(); + + $designConfigMock->expects($this->once()) + ->method('getExtensionAttributes') + ->willReturn($designConfigExtensionMock); + $designConfigExtensionMock->expects($this->once()) + ->method('getDesignConfigData') + ->willReturn([$designElementMock]); + $designElementMock->expects($this->any())->method('getFieldConfig')->willReturn($fieldConfig); + $designElementMock->expects($this->once())->method('getPath')->willReturn($fieldConfig['path']); + $designElementMock->expects($this->once())->method('getValue')->willReturn(1); + + $this->model->validate($designConfigMock); + } + + /** + * @magentoDataFixture Magento/Email/Model/_files/email_template.php + */ + public function testValidateNoRecursiveReference() + { + $fieldConfig = [ + 'path' => 'design/email/footer_template', + 'fieldset' => 'other_settings/email', + 'field' => 'email_footer_template' + ]; + + $designConfigMock = $this->getMockBuilder('Magento\Theme\Api\Data\DesignConfigInterface') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMock(); + $designConfigExtensionMock = $this->getMockBuilder('Magento\Theme\Api\Data\DesignConfigExtensionInterface') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMock(); + $designElementMock = $this->getMockBuilder('Magento\Theme\Model\Data\Design\Config\Data') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMock(); + + $designConfigMock->expects($this->once()) + ->method('getExtensionAttributes') + ->willReturn($designConfigExtensionMock); + $designConfigExtensionMock->expects($this->once()) + ->method('getDesignConfigData') + ->willReturn([$designElementMock]); + $designElementMock->expects($this->any())->method('getFieldConfig')->willReturn($fieldConfig); + $designElementMock->expects($this->once())->method('getPath')->willReturn($fieldConfig['path']); + $designElementMock->expects($this->once())->method('getValue')->willReturn(1); + + $this->model->validate($designConfigMock); + } +} From a67daa387fe0c2c0c5a36b1b081681990c6ab8ed Mon Sep 17 00:00:00 2001 From: Ankur Kaneria Date: Mon, 13 Jun 2016 17:49:57 -0500 Subject: [PATCH 317/345] MAGETWO-54205: After Disable/Enable Magento modules via CLI all cache types become disabled --- .../Magento/Framework/Code/GeneratedFiles.php | 108 ++++-------------- .../Console/Command/UninstallCommand.php | 10 +- .../Setup/Console/Command/UpgradeCommand.php | 37 ++---- .../Console/Command/UninstallCommandTest.php | 9 +- .../Console/Command/UpgradeCommandTest.php | 11 +- 5 files changed, 47 insertions(+), 128 deletions(-) diff --git a/lib/internal/Magento/Framework/Code/GeneratedFiles.php b/lib/internal/Magento/Framework/Code/GeneratedFiles.php index ec4182df962cf..5ea189305cada 100644 --- a/lib/internal/Magento/Framework/Code/GeneratedFiles.php +++ b/lib/internal/Magento/Framework/Code/GeneratedFiles.php @@ -53,36 +53,9 @@ public function __construct(DirectoryList $directoryList, WriteFactory $writeFac */ public function regenerate() { - if ($this->write->isExist(self::REGENERATE_FLAG)) { - //TODO: to be removed in scope of MAGETWO-53476 - //clean cache - $deploymentConfig = $this->directoryList->getPath(DirectoryList::CONFIG); - $configPool = new ConfigFilePool(); - $envPath = $deploymentConfig . '/' . $configPool->getPath(ConfigFilePool::APP_ENV); - if ($this->write->isExist($this->write->getRelativePath($envPath))) { - $this->saveCacheStatus($envPath); - } - //TODO: Till here - $cachePath = $this->write->getRelativePath($this->directoryList->getPath(DirectoryList::CACHE)); - $generationPath = $this->write->getRelativePath($this->directoryList->getPath(DirectoryList::GENERATION)); - $diPath = $this->write->getRelativePath($this->directoryList->getPath(DirectoryList::DI)); - - if ($this->write->isDirectory($generationPath)) { - $this->write->delete($generationPath); - } - if ($this->write->isDirectory($diPath)) { - $this->write->delete($diPath); - } - if ($this->write->isDirectory($cachePath)) { - $this->write->delete($cachePath); - } - //add to queue - - $this->write->delete(self::REGENERATE_FLAG); - } + $this->cleanGeneratedFiles(); } - /** * Clean var/generation, var/di and var/cache * @@ -92,14 +65,14 @@ public function cleanGeneratedFiles() { if ($this->write->isExist(self::REGENERATE_FLAG)) { - $cacheStatus = []; + $enabledCacheTypes = []; //TODO: to be removed in scope of MAGETWO-53476 $deploymentConfig = $this->directoryList->getPath(DirectoryList::CONFIG); $configPool = new ConfigFilePool(); $envPath = $deploymentConfig . '/' . $configPool->getPath(ConfigFilePool::APP_ENV); if ($this->write->isExist($this->write->getRelativePath($envPath))) { - $cacheStatus = $this->getCacheStatus(); + $enabledCacheTypes = $this->getEnabledCacheTypes(); $this->disableAllCacheTypes(); } //TODO: Till here @@ -123,7 +96,7 @@ public function cleanGeneratedFiles() $this->write->delete($cachePath); } $this->write->delete(self::REGENERATE_FLAG); - $this->restoreCacheStatus($cacheStatus); + $this->enableCacheTypes($enabledCacheTypes); } } @@ -139,66 +112,25 @@ public function requestRegeneration() } /** - * Read Cache types from env.php and write to a json file. - * - * @param string $envPath - * @return void + * Reads Cache configuration from env.php and returns indexed array containing all the enabled cache types. * + * @return string [] */ - private function saveCacheStatus($envPath) + private function getEnabledCacheTypes() { - $cacheData = include $envPath; - - if (isset($cacheData['cache_types'])) { - $enabledCacheTypes = $cacheData['cache_types']; - $enabledCacheTypes = array_filter($enabledCacheTypes, function ($value) { - return $value; - }); - if (!empty($enabledCacheTypes)) { - $varDir = $this->directoryList->getPath(DirectoryList::VAR_DIR); - $this->write->writeFile( - $this->write->getRelativePath($varDir) . '/.cachestates.json', - json_encode($enabledCacheTypes) - ); - $cacheTypes = array_keys($cacheData['cache_types']); - - foreach ($cacheTypes as $cacheType) { - $cacheData['cache_types'][$cacheType] = 0; - } - - $formatter = new PhpFormatter(); - $contents = $formatter->format($cacheData); - - $this->write->writeFile($this->write->getRelativePath($envPath), $contents); - if (function_exists('opcache_invalidate')) { - opcache_invalidate( - $this->write->getAbsolutePath($envPath) - ); - } - } - } - } - - /** - * Reads Cache configuration from env.php and returns the 'cache_types' key data which is the current - * cache status. - * - * @return array - */ - private function getCacheStatus() - { - $cacheStatus = []; - if (empty($envPath)) { - $envPath = $this->getEnvPath(); - } - + $enabledCacheTypes = []; + $envPath = $this->getEnvPath(); if ($this->write->isReadable($this->write->getRelativePath($envPath))) { $envData = include $envPath; if (isset($envData['cache_types'])) { $cacheStatus = $envData['cache_types']; + $enabledCacheTypes = array_filter($cacheStatus, function ($value) { + return $value; + }); + $enabledCacheTypes = array_keys($enabledCacheTypes); } } - return $cacheStatus; + return $enabledCacheTypes; } @@ -246,24 +178,24 @@ private function disableAllCacheTypes() } /** - * restore the cacache setting in env.php + * Enables apppropriate cache types in app/etc/env.php based on the passed in $cacheTypes array * TODO: to be removed in scope of MAGETWO-53476 * - * @param array + * @param string [] * * @return void */ - private function restoreCacheStatus($cacheStatus) + private function enableCacheTypes($cacheTypes) { - if (empty($cacheStatus)) { + if (empty($cacheTypes)) { return; } $envPath = $this->getEnvPath(); if ($this->write->isReadable($this->write->getRelativePath($envPath))) { $envData = include $envPath; - foreach ($cacheStatus as $cacheType => $state) { + foreach ($cacheTypes as $cacheType) { if (isset($envData['cache_types'][$cacheType])) { - $envData['cache_types'][$cacheType] = $state; + $envData['cache_types'][$cacheType] = 1; } } diff --git a/setup/src/Magento/Setup/Console/Command/UninstallCommand.php b/setup/src/Magento/Setup/Console/Command/UninstallCommand.php index 27d1181bdc7fc..b4de82f66be41 100644 --- a/setup/src/Magento/Setup/Console/Command/UninstallCommand.php +++ b/setup/src/Magento/Setup/Console/Command/UninstallCommand.php @@ -11,6 +11,7 @@ use Symfony\Component\Console\Question\ConfirmationQuestion; use Magento\Setup\Model\InstallerFactory; use Magento\Framework\Setup\ConsoleLogger; +use Magento\Framework\Code\GeneratedFiles; class UninstallCommand extends AbstractSetupCommand { @@ -19,12 +20,18 @@ class UninstallCommand extends AbstractSetupCommand */ private $installerFactory; + /** + * @var GeneratedFiles + */ + private $generatedFiles; + /** * @param InstallerFactory $installerFactory */ - public function __construct(InstallerFactory $installerFactory) + public function __construct(InstallerFactory $installerFactory, GeneratedFiles $generatedFiles) { $this->installerFactory = $installerFactory; + $this->generatedFiles = $generatedFiles; parent::__construct(); } @@ -49,6 +56,7 @@ protected function execute(InputInterface $input, OutputInterface $output) if ($helper->ask($input, $output, $question) || !$input->isInteractive()) { $installer = $this->installerFactory->create(new ConsoleLogger($output)); $installer->uninstall(); + $this->generatedFiles->requestRegeneration(); } } } diff --git a/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php b/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php index 3d86c44e40493..577e787bdd5f2 100644 --- a/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php +++ b/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php @@ -8,11 +8,9 @@ use Magento\Framework\Setup\ConsoleLogger; use Magento\Setup\Model\InstallerFactory; use Magento\Setup\Model\ObjectManagerProvider; -use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -use Magento\Framework\Code\GeneratedFiles; /** * Command for updating installed application after the code base has changed @@ -32,14 +30,9 @@ class UpgradeCommand extends AbstractSetupCommand private $installerFactory; /** - * @var \Magento\Framework\ObjectManagerInterface + * @var \Magento\Setup\Model\ObjectManagerProvider; */ - private $objectManager; - - /** - * @var GeneratedFiles - */ - private $generatedFiles; + private $objectManagerProvider; /** * Constructor @@ -50,8 +43,7 @@ class UpgradeCommand extends AbstractSetupCommand public function __construct(InstallerFactory $installerFactory, ObjectManagerProvider $objectManagerProvider) { $this->installerFactory = $installerFactory; - /** @var \Magento\Framework\ObjectManagerInterface objectManager */ - $this->objectManager = $objectManagerProvider->get(); + $this->objectManagerProvider = $objectManagerProvider; parent::__construct(); } @@ -81,14 +73,15 @@ protected function configure() */ protected function execute(InputInterface $input, OutputInterface $output) { - $this->getGeneratedFiles()->requestRegeneration(); $areaCode = 'setup'; + /** @var \Magento\Framework\ObjectManagerInterface $objectManager */ + $objectManager = $this->objectManagerProvider->get(); /** @var \Magento\Framework\App\State $appState */ - $appState = $this->objectManager->get('Magento\Framework\App\State'); + $appState = $objectManager->get('Magento\Framework\App\State'); $appState->setAreaCode($areaCode); /** @var \Magento\Framework\ObjectManager\ConfigLoaderInterface $configLoader */ - $configLoader = $this->objectManager->get('Magento\Framework\ObjectManager\ConfigLoaderInterface'); - $this->objectManager->configure($configLoader->load($areaCode)); + $configLoader = $objectManager->get('Magento\Framework\ObjectManager\ConfigLoaderInterface'); + $objectManager->configure($configLoader->load($areaCode)); $keepGenerated = $input->getOption(self::INPUT_KEY_KEEP_GENERATED); $installer = $this->installerFactory->create(new ConsoleLogger($output)); @@ -101,18 +94,4 @@ protected function execute(InputInterface $input, OutputInterface $output) return \Magento\Framework\Console\Cli::RETURN_SUCCESS; } - - /** - * Get deployment config - * - * @return GeneratedFiles - * @deprecated - */ - private function getGeneratedFiles() - { - if (!($this->generatedFiles instanceof GeneratedFiles)) { - return $this->objectManager->get(GeneratedFiles::class); - } - return $this->generatedFiles; - } } diff --git a/setup/src/Magento/Setup/Test/Unit/Console/Command/UninstallCommandTest.php b/setup/src/Magento/Setup/Test/Unit/Console/Command/UninstallCommandTest.php index a3183950c8e59..cbe2da59cb6ab 100644 --- a/setup/src/Magento/Setup/Test/Unit/Console/Command/UninstallCommandTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Console/Command/UninstallCommandTest.php @@ -10,6 +10,7 @@ use Magento\Setup\Console\Command\UninstallCommand; use Symfony\Component\Console\Tester\CommandTester; use Magento\Setup\Model\Installer; +use Magento\Framework\Code\GeneratedFiles; class UninstallCommandTest extends \PHPUnit_Framework_TestCase { @@ -18,6 +19,11 @@ class UninstallCommandTest extends \PHPUnit_Framework_TestCase */ private $installerFactory; + /** + * @var GeneratedFiles|\PHPUnit_Framework_MockObject_MockObject + */ + private $generatedFiles; + /** * @var Installer|\PHPUnit_Framework_MockObject_MockObject */ @@ -31,8 +37,9 @@ class UninstallCommandTest extends \PHPUnit_Framework_TestCase public function setUp() { $this->installerFactory = $this->getMock('Magento\Setup\Model\InstallerFactory', [], [], '', false); + $this->generatedFiles = $this->getMock('Magento\Framework\Code\GeneratedFiles', [], [], '', false); $this->installer = $this->getMock('Magento\Setup\Model\Installer', [], [], '', false); - $this->command = new UninstallCommand($this->installerFactory); + $this->command = new UninstallCommand($this->installerFactory, $this->generatedFiles); } public function testExecuteInteractionYes() diff --git a/setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php b/setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php index 03fb1194316c5..17d78718e4bf4 100644 --- a/setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php @@ -27,19 +27,12 @@ public function testExecute() $installer->expects($this->at(1))->method('installSchema'); $installer->expects($this->at(2))->method('installDataFixtures'); $installerFactory->expects($this->once())->method('create')->willReturn($installer); - $writeFactory = $this->getMock('\Magento\Framework\Filesystem\Directory\WriteFactory', [], [], '', false); - $directoryList = $this->getMock('\Magento\Framework\App\Filesystem\DirectoryList', [], [], '', false); - $generatedFiles = $this->getMock('\Magento\Framework\Code\GeneratedFiles', [], [], '', false); - $generatedFiles->expects($this->once())->method('requestRegeneration'); - $objectManager->expects($this->exactly(3)) + $objectManager->expects($this->exactly(2)) ->method('get') ->will($this->returnValueMap([ ['Magento\Framework\App\State', $state], - ['Magento\Framework\ObjectManager\ConfigLoaderInterface', $configLoader], - ['Magento\Framework\Filesystem\Directory\WriteFactory', $writeFactory], - ['Magento\Framework\App\Filesystem\DirectoryList', $directoryList], - ['Magento\Framework\Code\GeneratedFiles', $generatedFiles] + ['Magento\Framework\ObjectManager\ConfigLoaderInterface', $configLoader] ])); $commandTester = new CommandTester(new UpgradeCommand($installerFactory, $objectManagerProvider)); From f2d9176411856fdddc7eef1249a630f99ae2e30d Mon Sep 17 00:00:00 2001 From: Ankur Kaneria Date: Mon, 13 Jun 2016 17:59:14 -0500 Subject: [PATCH 318/345] MAGETWO-54205: After Disable/Enable Magento modules via CLI all cache types become disabled --- .../Magento/Framework/Code/GeneratedFiles.php | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/lib/internal/Magento/Framework/Code/GeneratedFiles.php b/lib/internal/Magento/Framework/Code/GeneratedFiles.php index 5ea189305cada..f89ab86f1673d 100644 --- a/lib/internal/Magento/Framework/Code/GeneratedFiles.php +++ b/lib/internal/Magento/Framework/Code/GeneratedFiles.php @@ -156,23 +156,25 @@ private function getEnvPath() private function disableAllCacheTypes() { $envPath = $this->getEnvPath(); - $envData = include $envPath; + if ($this->write->isWritable($this->write->getRelativePath($envPath))) { + $envData = include $envPath; - if (isset($envData['cache_types'])) { - $cacheTypes = array_keys($envData['cache_types']); + if (isset($envData['cache_types'])) { + $cacheTypes = array_keys($envData['cache_types']); - foreach ($cacheTypes as $cacheType) { - $envData['cache_types'][$cacheType] = 0; - } + foreach ($cacheTypes as $cacheType) { + $envData['cache_types'][$cacheType] = 0; + } - $formatter = new PhpFormatter(); - $contents = $formatter->format($envData); + $formatter = new PhpFormatter(); + $contents = $formatter->format($envData); - $this->write->writeFile($this->write->getRelativePath($envPath), $contents); - if (function_exists('opcache_invalidate')) { - opcache_invalidate( - $this->write->getAbsolutePath($envPath) - ); + $this->write->writeFile($this->write->getRelativePath($envPath), $contents); + if (function_exists('opcache_invalidate')) { + opcache_invalidate( + $this->write->getAbsolutePath($envPath) + ); + } } } } From 33ab2f881ea9c1fe79e8048356cd9fb2e148daaf Mon Sep 17 00:00:00 2001 From: Andrii Kasian Date: Tue, 14 Jun 2016 09:52:06 +0300 Subject: [PATCH 319/345] MAGETWO-52124: Simple product special price lost if use it in grouped product --- .../Product/Link/RelationPersister.php | 79 +++++++++++++++ .../Product/Link/RelationPersisterTest.php | 96 +++++++++++++++++++ app/code/Magento/GroupedProduct/etc/di.xml | 3 + 3 files changed, 178 insertions(+) create mode 100644 app/code/Magento/GroupedProduct/Model/ResourceModel/Product/Link/RelationPersister.php create mode 100644 app/code/Magento/GroupedProduct/Test/Unit/Model/ResourceModel/Product/Link/RelationPersisterTest.php diff --git a/app/code/Magento/GroupedProduct/Model/ResourceModel/Product/Link/RelationPersister.php b/app/code/Magento/GroupedProduct/Model/ResourceModel/Product/Link/RelationPersister.php new file mode 100644 index 0000000000000..691f143838da9 --- /dev/null +++ b/app/code/Magento/GroupedProduct/Model/ResourceModel/Product/Link/RelationPersister.php @@ -0,0 +1,79 @@ +relationProcessor = $relationProcessor; + $this->linkFactory = $linkFactory; + } + + /** + * Save grouped products to product relation table + * + * @param Link $subject + * @param \Closure $proceed + * @param $parentId + * @param $data + * @param $typeId + * @return Link + */ + public function aroundSaveProductLinks(Link $subject, \Closure $proceed, $parentId, $data, $typeId) + { + $result = $proceed($parentId, $data, $typeId); + if ($typeId == \Magento\GroupedProduct\Model\ResourceModel\Product\Link::LINK_TYPE_GROUPED) { + foreach ($data as $linkData) { + $this->relationProcessor->addRelation( + $parentId, + $linkData['product_id'] + ); + } + } + return $result; + } + + /** + * Remove grouped products from product relation table + * + * @param Link $subject + * @param \Closure $proceed + * @param $linkId + * @return Link + */ + public function aroundDeleteProductLink(Link $subject, \Closure $proceed, $linkId) + { + /** @var \Magento\Catalog\Model\ProductLink\Link $link */ + $link = $this->linkFactory->create(); + $subject->load($link, $linkId, $subject->getIdFieldName()); + $result = $proceed($linkId); + if ($link->getLinkTypeId() == \Magento\GroupedProduct\Model\ResourceModel\Product\Link::LINK_TYPE_GROUPED) { + $this->relationProcessor->removeRelations( + $link->getProductId(), + $link->getLinkedProductId() + ); + } + return $result; + } +} diff --git a/app/code/Magento/GroupedProduct/Test/Unit/Model/ResourceModel/Product/Link/RelationPersisterTest.php b/app/code/Magento/GroupedProduct/Test/Unit/Model/ResourceModel/Product/Link/RelationPersisterTest.php new file mode 100644 index 0000000000000..d11539945b0e8 --- /dev/null +++ b/app/code/Magento/GroupedProduct/Test/Unit/Model/ResourceModel/Product/Link/RelationPersisterTest.php @@ -0,0 +1,96 @@ +getMockBuilder(LinkFactory::class) + ->setMethods(['create']) + ->disableOriginalConstructor() + ->getMock(); + + $this->relationProcessor = $this->getMockBuilder(Relation::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->link = $this->getMockBuilder(Link::class) + ->setMethods(['getLinkTypeId', 'getProductId', 'getLinkedProductId']) + ->disableOriginalConstructor() + ->getMock(); + + $linkFactory->expects($this->any())->method('create')->willReturn($this->link); + + $this->object = new RelationPersister( + $this->relationProcessor, + $linkFactory + ); + } + + public function testAroundSaveProductLinks() + { + $subject = $this->getMockBuilder(\Magento\Catalog\Model\ResourceModel\Product\Link::class) + ->disableOriginalConstructor() + ->getMock(); + $this->relationProcessor->expects($this->once())->method('addRelation')->with(2, 10); + $this->assertEquals($subject, $this->object->aroundSaveProductLinks( + $subject, + function() use ($subject) { return $subject; }, + 2, + [['product_id' => 10]], + 3 + )); + } + + public function testAroundDeleteProductLink() + { + $subject = $this->getMockBuilder(\Magento\Catalog\Model\ResourceModel\Product\Link::class) + ->disableOriginalConstructor() + ->getMock(); + $subject->expects($this->any())->method('getIdFieldName')->willReturn('id'); + $subject->expects($this->once())->method('load')->with($this->link, 155, 'id'); + + $this->link->expects($this->any()) + ->method('getLinkTypeId') + ->willReturn(\Magento\GroupedProduct\Model\ResourceModel\Product\Link::LINK_TYPE_GROUPED); + $this->link->expects($this->any()) + ->method('getProductId') + ->willReturn(12); + $this->link->expects($this->any()) + ->method('getLinkedProductId') + ->willReturn(13); + + $this->relationProcessor->expects($this->once())->method('removeRelations')->with(12, 13); + $this->assertEquals( + $subject, + $this->object->aroundDeleteProductLink( + $subject, + function() use ($subject) { return $subject; }, + 155 + ) + ); + + } +} diff --git a/app/code/Magento/GroupedProduct/etc/di.xml b/app/code/Magento/GroupedProduct/etc/di.xml index aa1fb0d98796a..459198a2bb338 100644 --- a/app/code/Magento/GroupedProduct/etc/di.xml +++ b/app/code/Magento/GroupedProduct/etc/di.xml @@ -77,6 +77,9 @@ + + + From 165dc272c31e4aa960fd995be8e812e181df695c Mon Sep 17 00:00:00 2001 From: Andrii Kasian Date: Tue, 14 Jun 2016 11:01:00 +0300 Subject: [PATCH 320/345] MAGETWO-52124: Simple product special price lost if use it in grouped product --- .../GroupedProduct/Setup/UpgradeData.php | 58 +++++++++++++++++++ .../Magento/GroupedProduct/etc/module.xml | 2 +- 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 app/code/Magento/GroupedProduct/Setup/UpgradeData.php diff --git a/app/code/Magento/GroupedProduct/Setup/UpgradeData.php b/app/code/Magento/GroupedProduct/Setup/UpgradeData.php new file mode 100644 index 0000000000000..83dab45c4287a --- /dev/null +++ b/app/code/Magento/GroupedProduct/Setup/UpgradeData.php @@ -0,0 +1,58 @@ +relationProcessor = $relationProcessor; + } + + /** + * {@inheritdoc} + */ + public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context) + { + $setup->startSetup(); + + if (version_compare($context->getVersion(), '2.0.1', '<')) { + $connection = $setup->getConnection(); + $select = $connection->select() + ->from( + $this->relationProcessor->getTable('catalog_product_link'), + ['product_id', 'linked_product_id'] + ) + ->where('link_type_id = ?', Link::LINK_TYPE_GROUPED); + + $connection->query( + $connection->insertFromSelect( + $select, $this->relationProcessor->getMainTable(), + ['parent_id', 'child_id'], + AdapterInterface::INSERT_IGNORE + ) + ); + } + + $setup->endSetup(); + } +} diff --git a/app/code/Magento/GroupedProduct/etc/module.xml b/app/code/Magento/GroupedProduct/etc/module.xml index ca5b06993a88a..5a03ee430ea1b 100644 --- a/app/code/Magento/GroupedProduct/etc/module.xml +++ b/app/code/Magento/GroupedProduct/etc/module.xml @@ -6,7 +6,7 @@ */ --> - + From bdbbaa8903a872430d657bf7abf82c81d3b3b54d Mon Sep 17 00:00:00 2001 From: Iryna Lagno Date: Tue, 14 Jun 2016 12:25:43 +0300 Subject: [PATCH 321/345] MAGETWO-54357: Product Preview doesn't work --- .../Catalog/Ui/DataProvider/Product/Form/Modifier/Websites.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Websites.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Websites.php index a4925b5306709..cdd913e074659 100644 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Websites.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Websites.php @@ -122,6 +122,7 @@ public function modifyMeta(array $meta) 'collapsible' => true, 'componentType' => Form\Fieldset::NAME, 'dataScope' => self::DATA_SCOPE_PRODUCT, + 'disabled' => false, 'sortOrder' => $this->getNextGroupSortOrder( $meta, 'search-engine-optimization', From 3b5260e8fd9a4f8a71c11195c5cb1ef7cca986bf Mon Sep 17 00:00:00 2001 From: Andrii Lugovyi Date: Tue, 14 Jun 2016 14:38:19 +0300 Subject: [PATCH 322/345] MAGETWO-54200: Wrong "gift_message_available" parameter exported --- app/code/Magento/CatalogImportExport/Model/Export/Product.php | 2 +- .../Magento/GiftMessage/Model/GiftMessageConfigProvider.php | 4 +++- app/code/Magento/GiftMessage/Setup/InstallData.php | 2 +- .../Ui/DataProvider/Product/Modifier/GiftMessage.php | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/CatalogImportExport/Model/Export/Product.php b/app/code/Magento/CatalogImportExport/Model/Export/Product.php index 4e78d6cf93085..441fb60f55ec4 100644 --- a/app/code/Magento/CatalogImportExport/Model/Export/Product.php +++ b/app/code/Magento/CatalogImportExport/Model/Export/Product.php @@ -84,7 +84,7 @@ class Product extends \Magento\ImportExport\Model\Export\Entity\AbstractEntity * @var string[] */ protected $_indexValueAttributes = [ - 'status' + 'status', ]; /** diff --git a/app/code/Magento/GiftMessage/Model/GiftMessageConfigProvider.php b/app/code/Magento/GiftMessage/Model/GiftMessageConfigProvider.php index c3ed51e45a1df..a01fcf86a3971 100644 --- a/app/code/Magento/GiftMessage/Model/GiftMessageConfigProvider.php +++ b/app/code/Magento/GiftMessage/Model/GiftMessageConfigProvider.php @@ -181,11 +181,13 @@ protected function getItemLevelGiftMessages() $itemLevelConfig[$itemId] = []; $isMessageAvailable = $item->getProduct()->getGiftMessageAvailable(); - if ($isMessageAvailable == Boolean::VALUE_USE_CONFIG || in_array($isMessageAvailable, [null, ''], true)) { + if ($isMessageAvailable == Boolean::VALUE_USE_CONFIG) { $itemLevelConfig[$itemId]['is_available'] = (bool)$this->scopeConfiguration->getValue( GiftMessageHelper::XPATH_CONFIG_GIFT_MESSAGE_ALLOW_ITEMS, ScopeInterface::SCOPE_STORE ); + } else { + $itemLevelConfig[$itemId]['is_available'] = (bool)$isMessageAvailable; } $message = $this->itemRepository->get($quote->getId(), $itemId); if ($message) { diff --git a/app/code/Magento/GiftMessage/Setup/InstallData.php b/app/code/Magento/GiftMessage/Setup/InstallData.php index baed68bf23483..26d356335f8c1 100644 --- a/app/code/Magento/GiftMessage/Setup/InstallData.php +++ b/app/code/Magento/GiftMessage/Setup/InstallData.php @@ -94,7 +94,7 @@ public function install(ModuleDataSetupInterface $setup, ModuleContextInterface 'label' => 'Allow Gift Message', 'input' => 'select', 'class' => '', - 'source' => 'Magento\Eav\Model\Entity\Attribute\Source\Boolean', + 'source' => 'Magento\Catalog\Model\Product\Attribute\Source\Boolean', 'global' => true, 'visible' => true, 'required' => false, diff --git a/app/code/Magento/GiftMessage/Ui/DataProvider/Product/Modifier/GiftMessage.php b/app/code/Magento/GiftMessage/Ui/DataProvider/Product/Modifier/GiftMessage.php index 0a0d5514accfc..ce5522c8f20da 100644 --- a/app/code/Magento/GiftMessage/Ui/DataProvider/Product/Modifier/GiftMessage.php +++ b/app/code/Magento/GiftMessage/Ui/DataProvider/Product/Modifier/GiftMessage.php @@ -58,13 +58,13 @@ public function __construct( public function modifyData(array $data) { $modelId = $this->locator->getProduct()->getId(); - $value = ''; + $value = Boolean::VALUE_USE_CONFIG; if (isset($data[$modelId][static::DATA_SOURCE_DEFAULT][static::FIELD_MESSAGE_AVAILABLE])) { $value = $data[$modelId][static::DATA_SOURCE_DEFAULT][static::FIELD_MESSAGE_AVAILABLE]; } - if ($value == Boolean::VALUE_USE_CONFIG || $value === '' || $value === null) { + if ($value == Boolean::VALUE_USE_CONFIG) { $data[$modelId][static::DATA_SOURCE_DEFAULT][static::FIELD_MESSAGE_AVAILABLE] = $this->getValueFromConfig(); $data[$modelId][static::DATA_SOURCE_DEFAULT]['use_config_' . static::FIELD_MESSAGE_AVAILABLE] = '1'; } From ec058d70c18c6fbfb64919c3c81cbc4481bc172f Mon Sep 17 00:00:00 2001 From: Andrii Lugovyi Date: Tue, 14 Jun 2016 16:07:05 +0300 Subject: [PATCH 323/345] MAGETWO-54200: Wrong "gift_message_available" parameter exported --- .../Model/GiftMessageConfigProvider.php | 15 ++++--------- .../Product/Modifier/GiftMessage.php | 22 +++++++++---------- 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/app/code/Magento/GiftMessage/Model/GiftMessageConfigProvider.php b/app/code/Magento/GiftMessage/Model/GiftMessageConfigProvider.php index a01fcf86a3971..08849921cbf87 100644 --- a/app/code/Magento/GiftMessage/Model/GiftMessageConfigProvider.php +++ b/app/code/Magento/GiftMessage/Model/GiftMessageConfigProvider.php @@ -12,8 +12,6 @@ use Magento\Framework\UrlInterface; use Magento\Framework\Locale\FormatInterface as LocaleFormat; use Magento\Framework\Data\Form\FormKey; -use Magento\Catalog\Model\Product\Attribute\Source\Boolean; -use Magento\Store\Model\ScopeInterface; /** * Configuration provider for GiftMessage rendering on "Checkout cart" page. @@ -96,11 +94,11 @@ public function getConfig() $configuration['giftMessage'] = []; $orderLevelGiftMessageConfiguration = (bool)$this->scopeConfiguration->getValue( GiftMessageHelper::XPATH_CONFIG_GIFT_MESSAGE_ALLOW_ORDER, - ScopeInterface::SCOPE_STORE + \Magento\Store\Model\ScopeInterface::SCOPE_STORE ); $itemLevelGiftMessageConfiguration = (bool)$this->scopeConfiguration->getValue( GiftMessageHelper::XPATH_CONFIG_GIFT_MESSAGE_ALLOW_ITEMS, - ScopeInterface::SCOPE_STORE + \Magento\Store\Model\ScopeInterface::SCOPE_STORE ); if ($orderLevelGiftMessageConfiguration) { $orderMessages = $this->getOrderLevelGiftMessages(); @@ -180,13 +178,8 @@ protected function getItemLevelGiftMessages() $itemId = $item->getId(); $itemLevelConfig[$itemId] = []; $isMessageAvailable = $item->getProduct()->getGiftMessageAvailable(); - - if ($isMessageAvailable == Boolean::VALUE_USE_CONFIG) { - $itemLevelConfig[$itemId]['is_available'] = (bool)$this->scopeConfiguration->getValue( - GiftMessageHelper::XPATH_CONFIG_GIFT_MESSAGE_ALLOW_ITEMS, - ScopeInterface::SCOPE_STORE - ); - } else { + // use gift message product setting if it is available + if ($isMessageAvailable !== null) { $itemLevelConfig[$itemId]['is_available'] = (bool)$isMessageAvailable; } $message = $this->itemRepository->get($quote->getId(), $itemId); diff --git a/app/code/Magento/GiftMessage/Ui/DataProvider/Product/Modifier/GiftMessage.php b/app/code/Magento/GiftMessage/Ui/DataProvider/Product/Modifier/GiftMessage.php index ce5522c8f20da..606687fe1da1e 100644 --- a/app/code/Magento/GiftMessage/Ui/DataProvider/Product/Modifier/GiftMessage.php +++ b/app/code/Magento/GiftMessage/Ui/DataProvider/Product/Modifier/GiftMessage.php @@ -13,7 +13,6 @@ use Magento\Store\Model\ScopeInterface; use Magento\Ui\Component\Form\Element\Checkbox; use Magento\Ui\Component\Form\Field; -use Magento\Catalog\Model\Product\Attribute\Source\Boolean; /** * Class GiftMessageDataProvider @@ -58,14 +57,15 @@ public function __construct( public function modifyData(array $data) { $modelId = $this->locator->getProduct()->getId(); - $value = Boolean::VALUE_USE_CONFIG; + $value = ''; if (isset($data[$modelId][static::DATA_SOURCE_DEFAULT][static::FIELD_MESSAGE_AVAILABLE])) { $value = $data[$modelId][static::DATA_SOURCE_DEFAULT][static::FIELD_MESSAGE_AVAILABLE]; } - if ($value == Boolean::VALUE_USE_CONFIG) { - $data[$modelId][static::DATA_SOURCE_DEFAULT][static::FIELD_MESSAGE_AVAILABLE] = $this->getValueFromConfig(); + if ('' === $value) { + $data[$modelId][static::DATA_SOURCE_DEFAULT][static::FIELD_MESSAGE_AVAILABLE] = + $this->getValueFromConfig(); $data[$modelId][static::DATA_SOURCE_DEFAULT]['use_config_' . static::FIELD_MESSAGE_AVAILABLE] = '1'; } @@ -129,8 +129,14 @@ protected function customizeAllowGiftMessageField(array $meta) 'data' => [ 'config' => [ 'dataScope' => static::FIELD_MESSAGE_AVAILABLE, - 'component' => 'Magento_Ui/js/form/element/single-checkbox-use-config', + 'imports' => [ + 'disabled' => + '${$.parentName}.use_config_' + . static::FIELD_MESSAGE_AVAILABLE + . ':checked', + ], 'additionalClasses' => 'admin__field-x-small', + 'formElement' => Checkbox::NAME, 'componentType' => Field::NAME, 'prefer' => 'toggle', 'valueMap' => [ @@ -154,12 +160,6 @@ protected function customizeAllowGiftMessageField(array $meta) 'false' => '0', 'true' => '1', ], - 'exports' => [ - 'checked' => '${$.parentName}.' . static::FIELD_MESSAGE_AVAILABLE . ':isUseConfig', - ], - 'imports' => [ - 'disabled' => '${$.parentName}.' . static::FIELD_MESSAGE_AVAILABLE . ':isUseDefault', - ], ], ], ], From dac45a7ffbd2f973750a968b6a7f5128b5ad092e Mon Sep 17 00:00:00 2001 From: Roman Ganin Date: Tue, 14 Jun 2016 16:43:33 +0300 Subject: [PATCH 324/345] MAGETWO-54211: Downloadable product has direct link in category after update applied --- ...ProductProcessUrlRewriteSavingObserver.php | 5 +- ...uctProcessUrlRewriteSavingObserverTest.php | 214 ++++++++++++++++++ 2 files changed, 216 insertions(+), 3 deletions(-) create mode 100644 app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductProcessUrlRewriteSavingObserverTest.php diff --git a/app/code/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserver.php b/app/code/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserver.php index 13dffac83d7ce..3929a4498ffa9 100644 --- a/app/code/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserver.php +++ b/app/code/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserver.php @@ -46,10 +46,9 @@ public function execute(\Magento\Framework\Event\Observer $observer) /** @var \Magento\Catalog\Model\Product $product */ $product = $observer->getEvent()->getProduct(); - $isChangedWebsites = $product->getIsChangedWebsites(); if ($product->dataHasChangedFor('url_key') || $product->getIsChangedCategories() - || $isChangedWebsites + || $product->getIsChangedWebsites() || $product->dataHasChangedFor('visibility') ) { $this->urlPersist->deleteByData([ @@ -57,7 +56,7 @@ public function execute(\Magento\Framework\Event\Observer $observer) UrlRewrite::ENTITY_TYPE => ProductUrlRewriteGenerator::ENTITY_TYPE, UrlRewrite::REDIRECT_TYPE => 0, ]); - if (in_array($product->getVisibility(), $product->getVisibleInSiteVisibilities())) { + if ($product->isVisibleInSiteVisibility()) { $this->urlPersist->replace($this->productUrlRewriteGenerator->generate($product)); } } diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductProcessUrlRewriteSavingObserverTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductProcessUrlRewriteSavingObserverTest.php new file mode 100644 index 0000000000000..3c2748c52a28c --- /dev/null +++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductProcessUrlRewriteSavingObserverTest.php @@ -0,0 +1,214 @@ +urlPersist = $this->getMock(\Magento\UrlRewrite\Model\UrlPersistInterface::class, [], [], '', false); + $this->product = $this->getMock( + \Magento\Catalog\Model\Product::class, + [ + 'getId', + 'dataHasChangedFor', + 'isVisibleInSiteVisibility', + 'getIsChangedWebsites', + 'getIsChangedCategories' + ], + [], + '', + false + ); + $this->product->expects($this->any())->method('getId')->will($this->returnValue(3)); + $this->event = $this->getMock(\Magento\Framework\Event::class, ['getProduct'], [], '', false); + $this->event->expects($this->any())->method('getProduct')->willReturn($this->product); + $this->observer = $this->getMock(\Magento\Framework\Event\Observer::class, ['getEvent'], [], '', false); + $this->observer->expects($this->any())->method('getEvent')->willReturn($this->event); + $this->productUrlRewriteGenerator = $this->getMock( + \Magento\CatalogUrlRewrite\Model\ProductUrlRewriteGenerator::class, + ['generate'], + [], + '', + false + ); + $this->productUrlRewriteGenerator->expects($this->any()) + ->method('generate') + ->will($this->returnValue([3 => 'rewrite'])); + $this->objectManager = new ObjectManager($this); + $this->model = $this->objectManager->getObject( + \Magento\CatalogUrlRewrite\Observer\ProductProcessUrlRewriteSavingObserver::class, + [ + 'productUrlRewriteGenerator' => $this->productUrlRewriteGenerator, + 'urlPersist' => $this->urlPersist + ] + ); + } + + /** + * Data provider + * + * @return array + */ + public function testUrlKeyDataProvider() + { + return [ + 'url changed' => [ + 'isChangedUrlKey' => true, + 'isChangedVisibility' => false, + 'isChangedWebsites' => false, + 'isChangedCategories' => false, + 'visibilityResult' => true, + 'expectedDeleteCount' => 1, + 'expectedReplaceCount' => 1 + ], + 'no chnages' => [ + 'isChangedUrlKey' => false, + 'isChangedVisibility' => false, + 'isChangedWebsites' => false, + 'isChangedCategories' => false, + 'visibilityResult' => true, + 'expectedDeleteCount' => 0, + 'expectedReplaceCount' => 0 + ], + 'visibility changed' => [ + 'isChangedUrlKey' => false, + 'isChangedVisibility' => true, + 'isChangedWebsites' => false, + 'isChangedCategories' => false, + 'visibilityResult' => true, + 'expectedDeleteCount' => 1, + 'expectedReplaceCount' => 1 + ], + 'websites changed' => [ + 'isChangedUrlKey' => false, + 'isChangedVisibility' => false, + 'isChangedWebsites' => true, + 'isChangedCategories' => false, + 'visibilityResult' => true, + 'expectedDeleteCount' => 1, + 'expectedReplaceCount' => 1 + ], + 'categories changed' => [ + 'isChangedUrlKey' => false, + 'isChangedVisibility' => false, + 'isChangedWebsites' => false, + 'isChangedCategories' => true, + 'visibilityResult' => true, + 'expectedDeleteCount' => 1, + 'expectedReplaceCount' => 1 + ], + 'url changed invisible' => [ + 'isChangedUrlKey' => true, + 'isChangedVisibility' => false, + 'isChangedWebsites' => false, + 'isChangedCategories' => false, + 'visibilityResult' => false, + 'expectedDeleteCount' => 1, + 'expectedReplaceCount' => 0 + ], + ]; + } + + /** + * @param bool $isChangedUrlKey + * @param bool $isChangedVisibility + * @param bool $isChangedWebsites + * @param bool $isChangedCategories + * @param bool $visibilityResult + * @param int $expectedDeleteCount + * @param int $expectedReplaceCount + * + * @dataProvider testUrlKeyDataProvider + */ + public function testExecuteUrlKey( + $isChangedUrlKey, + $isChangedVisibility, + $isChangedWebsites, + $isChangedCategories, + $visibilityResult, + $expectedDeleteCount, + $expectedReplaceCount + ) { + + $this->product->expects($this->any()) + ->method('dataHasChangedFor') + ->will($this->returnValueMap([ + ['visibility', $isChangedVisibility], + ['url_key', $isChangedUrlKey] + ]) + ); + + $this->product->expects($this->any()) + ->method('getIsChangedWebsites') + ->will($this->returnValue($isChangedWebsites)); + + $this->product->expects($this->any()) + ->method('getIsChangedCategories') + ->will($this->returnValue($isChangedCategories)); + + $this->urlPersist->expects($this->exactly($expectedDeleteCount))->method('deleteByData')->with([ + UrlRewrite::ENTITY_ID => $this->product->getId(), + UrlRewrite::ENTITY_TYPE => ProductUrlRewriteGenerator::ENTITY_TYPE, + UrlRewrite::REDIRECT_TYPE => 0, + ]); + $this->product->expects($this->any())->method('isVisibleInSiteVisibility')->will($this->returnValue($visibilityResult)); + $this->urlPersist->expects($this->exactly($expectedReplaceCount))->method('replace')->with([3 => 'rewrite']); + $this->model->execute($this->observer); + } +} From e0578673f14d4010061b9fc632d2d4916514ea26 Mon Sep 17 00:00:00 2001 From: Roman Ganin Date: Tue, 14 Jun 2016 16:55:57 +0300 Subject: [PATCH 325/345] MAGETWO-54211: Downloadable product has direct link in category after update applied --- ...uctProcessUrlRewriteSavingObserverTest.php | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductProcessUrlRewriteSavingObserverTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductProcessUrlRewriteSavingObserverTest.php index 3c2748c52a28c..26d1674ec59a0 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductProcessUrlRewriteSavingObserverTest.php +++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductProcessUrlRewriteSavingObserverTest.php @@ -1,5 +1,4 @@ product->expects($this->any()) ->method('dataHasChangedFor') - ->will($this->returnValueMap([ - ['visibility', $isChangedVisibility], - ['url_key', $isChangedUrlKey] - ]) - ); + ->will($this->returnValueMap( + [ + ['visibility', $isChangedVisibility], + ['url_key', $isChangedUrlKey] + ] + )); $this->product->expects($this->any()) ->method('getIsChangedWebsites') @@ -207,8 +207,15 @@ public function testExecuteUrlKey( UrlRewrite::ENTITY_TYPE => ProductUrlRewriteGenerator::ENTITY_TYPE, UrlRewrite::REDIRECT_TYPE => 0, ]); - $this->product->expects($this->any())->method('isVisibleInSiteVisibility')->will($this->returnValue($visibilityResult)); - $this->urlPersist->expects($this->exactly($expectedReplaceCount))->method('replace')->with([3 => 'rewrite']); + + $this->product->expects($this->any()) + ->method('isVisibleInSiteVisibility') + ->will($this->returnValue($visibilityResult)); + + $this->urlPersist->expects($this->exactly($expectedReplaceCount)) + ->method('replace') + ->with([3 => 'rewrite']); + $this->model->execute($this->observer); } } From 850eacec3133b051c95b951ebd3ff52820957e7c Mon Sep 17 00:00:00 2001 From: Andrii Kasian Date: Tue, 14 Jun 2016 17:33:42 +0300 Subject: [PATCH 326/345] MAGETWO-52124: Simple product special price lost if use it in grouped product --- .../Product/Link/RelationPersister.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/GroupedProduct/Model/ResourceModel/Product/Link/RelationPersister.php b/app/code/Magento/GroupedProduct/Model/ResourceModel/Product/Link/RelationPersister.php index 691f143838da9..f83b34ec3b30d 100644 --- a/app/code/Magento/GroupedProduct/Model/ResourceModel/Product/Link/RelationPersister.php +++ b/app/code/Magento/GroupedProduct/Model/ResourceModel/Product/Link/RelationPersister.php @@ -1,6 +1,6 @@ Date: Tue, 14 Jun 2016 17:38:44 +0300 Subject: [PATCH 327/345] MAGETWO-52124: Simple product special price lost if use it in grouped product --- .../Magento/GroupedProduct/Pricing/Price/FinalPriceTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/integration/testsuite/Magento/GroupedProduct/Pricing/Price/FinalPriceTest.php b/dev/tests/integration/testsuite/Magento/GroupedProduct/Pricing/Price/FinalPriceTest.php index 0fce2d53e1627..2b40b621c7180 100644 --- a/dev/tests/integration/testsuite/Magento/GroupedProduct/Pricing/Price/FinalPriceTest.php +++ b/dev/tests/integration/testsuite/Magento/GroupedProduct/Pricing/Price/FinalPriceTest.php @@ -1,6 +1,6 @@ Date: Tue, 14 Jun 2016 17:41:55 +0300 Subject: [PATCH 328/345] MAGETWO-54211: Downloadable product has direct link in category after update applied --- ...ProductProcessUrlRewriteSavingObserverTest.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductProcessUrlRewriteSavingObserverTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductProcessUrlRewriteSavingObserverTest.php index 26d1674ec59a0..823bbcc90bbdc 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductProcessUrlRewriteSavingObserverTest.php +++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductProcessUrlRewriteSavingObserverTest.php @@ -13,12 +13,12 @@ use Magento\UrlRewrite\Service\V1\Data\UrlRewrite; /** - * Class AfterImportDataObserverTest + * Class ProductProcessUrlRewriteSavingObserverTest * * @SuppressWarnings(PHPMD.TooManyFields) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class AfterImportDataObserverTest extends \PHPUnit_Framework_TestCase +class ProductProcessUrlRewriteSavingObserverTest extends \PHPUnit_Framework_TestCase { /** * @var \Magento\UrlRewrite\Model\UrlPersistInterface|\PHPUnit_Framework_MockObject_MockObject @@ -184,15 +184,14 @@ public function testExecuteUrlKey( $expectedDeleteCount, $expectedReplaceCount ) { - $this->product->expects($this->any()) ->method('dataHasChangedFor') ->will($this->returnValueMap( - [ - ['visibility', $isChangedVisibility], - ['url_key', $isChangedUrlKey] - ] - )); + [ + ['visibility', $isChangedVisibility], + ['url_key', $isChangedUrlKey] + ] + )); $this->product->expects($this->any()) ->method('getIsChangedWebsites') From ef2327b72ae005399807c2158566a8c3f2daceae Mon Sep 17 00:00:00 2001 From: Roman Ganin Date: Tue, 14 Jun 2016 18:15:26 +0300 Subject: [PATCH 329/345] MAGETWO-54184: Url rewrite do not use store view dependent data for product --- ...ProductProcessUrlRewriteSavingObserver.php | 9 ++++++-- ...uctProcessUrlRewriteSavingObserverTest.php | 22 +++++++++++++++++-- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserver.php b/app/code/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserver.php index 3929a4498ffa9..e0825c88f395b 100644 --- a/app/code/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserver.php +++ b/app/code/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserver.php @@ -55,9 +55,14 @@ public function execute(\Magento\Framework\Event\Observer $observer) UrlRewrite::ENTITY_ID => $product->getId(), UrlRewrite::ENTITY_TYPE => ProductUrlRewriteGenerator::ENTITY_TYPE, UrlRewrite::REDIRECT_TYPE => 0, + UrlRewrite::STORE_ID => $product->getStoreId() ]); - if ($product->isVisibleInSiteVisibility()) { - $this->urlPersist->replace($this->productUrlRewriteGenerator->generate($product)); + + $savedProduct = clone $product; + $savedProduct->load($product->getId()); + + if ($savedProduct->isVisibleInSiteVisibility()) { + $this->urlPersist->replace($this->productUrlRewriteGenerator->generate($savedProduct)); } } } diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductProcessUrlRewriteSavingObserverTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductProcessUrlRewriteSavingObserverTest.php index 823bbcc90bbdc..57ef40108a071 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductProcessUrlRewriteSavingObserverTest.php +++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductProcessUrlRewriteSavingObserverTest.php @@ -68,7 +68,9 @@ protected function setUp() 'dataHasChangedFor', 'isVisibleInSiteVisibility', 'getIsChangedWebsites', - 'getIsChangedCategories' + 'getIsChangedCategories', + 'load', + 'getStoreId' ], [], '', @@ -114,7 +116,9 @@ public function testUrlKeyDataProvider() 'isChangedCategories' => false, 'visibilityResult' => true, 'expectedDeleteCount' => 1, - 'expectedReplaceCount' => 1 + 'expectedProdLoadCount' => 1, + 'expectedReplaceCount' => 1, + ], 'no chnages' => [ 'isChangedUrlKey' => false, @@ -123,6 +127,7 @@ public function testUrlKeyDataProvider() 'isChangedCategories' => false, 'visibilityResult' => true, 'expectedDeleteCount' => 0, + 'expectedProdLoadCount' => 0, 'expectedReplaceCount' => 0 ], 'visibility changed' => [ @@ -132,6 +137,7 @@ public function testUrlKeyDataProvider() 'isChangedCategories' => false, 'visibilityResult' => true, 'expectedDeleteCount' => 1, + 'expectedProdLoadCount' => 1, 'expectedReplaceCount' => 1 ], 'websites changed' => [ @@ -141,6 +147,7 @@ public function testUrlKeyDataProvider() 'isChangedCategories' => false, 'visibilityResult' => true, 'expectedDeleteCount' => 1, + 'expectedProdLoadCount' => 1, 'expectedReplaceCount' => 1 ], 'categories changed' => [ @@ -150,6 +157,7 @@ public function testUrlKeyDataProvider() 'isChangedCategories' => true, 'visibilityResult' => true, 'expectedDeleteCount' => 1, + 'expectedProdLoadCount' => 1, 'expectedReplaceCount' => 1 ], 'url changed invisible' => [ @@ -159,6 +167,7 @@ public function testUrlKeyDataProvider() 'isChangedCategories' => false, 'visibilityResult' => false, 'expectedDeleteCount' => 1, + 'expectedProdLoadCount' => 1, 'expectedReplaceCount' => 0 ], ]; @@ -171,6 +180,7 @@ public function testUrlKeyDataProvider() * @param bool $isChangedCategories * @param bool $visibilityResult * @param int $expectedDeleteCount + * @param int $expectedProdLoadCount * @param int $expectedReplaceCount * * @dataProvider testUrlKeyDataProvider @@ -182,8 +192,15 @@ public function testExecuteUrlKey( $isChangedCategories, $visibilityResult, $expectedDeleteCount, + $expectedProdLoadCount, $expectedReplaceCount ) { + $this->product->expects($this->any())->method('getStoreId')->will($this->returnValue(12)); + + $this->product->expects($this->exactly($expectedProdLoadCount)) + ->method('load') + ->with($this->product->getId()); + $this->product->expects($this->any()) ->method('dataHasChangedFor') ->will($this->returnValueMap( @@ -205,6 +222,7 @@ public function testExecuteUrlKey( UrlRewrite::ENTITY_ID => $this->product->getId(), UrlRewrite::ENTITY_TYPE => ProductUrlRewriteGenerator::ENTITY_TYPE, UrlRewrite::REDIRECT_TYPE => 0, + UrlRewrite::STORE_ID => $this->product->getStoreId() ]); $this->product->expects($this->any()) From 215698b78c8dcab6af0f13e96e424c7ce3ae8077 Mon Sep 17 00:00:00 2001 From: Ankur Kaneria Date: Tue, 14 Jun 2016 11:32:39 -0500 Subject: [PATCH 330/345] MAGETWO-54205: After Disable/Enable Magento modules via CLI all cache types become disabled - reverting changes to uninstall command files. The regenerate flag will be created as part of magento-composer-installer --- .../Magento/Setup/Console/Command/UninstallCommand.php | 10 +--------- .../Test/Unit/Console/Command/UninstallCommandTest.php | 9 +-------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/setup/src/Magento/Setup/Console/Command/UninstallCommand.php b/setup/src/Magento/Setup/Console/Command/UninstallCommand.php index b4de82f66be41..27d1181bdc7fc 100644 --- a/setup/src/Magento/Setup/Console/Command/UninstallCommand.php +++ b/setup/src/Magento/Setup/Console/Command/UninstallCommand.php @@ -11,7 +11,6 @@ use Symfony\Component\Console\Question\ConfirmationQuestion; use Magento\Setup\Model\InstallerFactory; use Magento\Framework\Setup\ConsoleLogger; -use Magento\Framework\Code\GeneratedFiles; class UninstallCommand extends AbstractSetupCommand { @@ -20,18 +19,12 @@ class UninstallCommand extends AbstractSetupCommand */ private $installerFactory; - /** - * @var GeneratedFiles - */ - private $generatedFiles; - /** * @param InstallerFactory $installerFactory */ - public function __construct(InstallerFactory $installerFactory, GeneratedFiles $generatedFiles) + public function __construct(InstallerFactory $installerFactory) { $this->installerFactory = $installerFactory; - $this->generatedFiles = $generatedFiles; parent::__construct(); } @@ -56,7 +49,6 @@ protected function execute(InputInterface $input, OutputInterface $output) if ($helper->ask($input, $output, $question) || !$input->isInteractive()) { $installer = $this->installerFactory->create(new ConsoleLogger($output)); $installer->uninstall(); - $this->generatedFiles->requestRegeneration(); } } } diff --git a/setup/src/Magento/Setup/Test/Unit/Console/Command/UninstallCommandTest.php b/setup/src/Magento/Setup/Test/Unit/Console/Command/UninstallCommandTest.php index cbe2da59cb6ab..a3183950c8e59 100644 --- a/setup/src/Magento/Setup/Test/Unit/Console/Command/UninstallCommandTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Console/Command/UninstallCommandTest.php @@ -10,7 +10,6 @@ use Magento\Setup\Console\Command\UninstallCommand; use Symfony\Component\Console\Tester\CommandTester; use Magento\Setup\Model\Installer; -use Magento\Framework\Code\GeneratedFiles; class UninstallCommandTest extends \PHPUnit_Framework_TestCase { @@ -19,11 +18,6 @@ class UninstallCommandTest extends \PHPUnit_Framework_TestCase */ private $installerFactory; - /** - * @var GeneratedFiles|\PHPUnit_Framework_MockObject_MockObject - */ - private $generatedFiles; - /** * @var Installer|\PHPUnit_Framework_MockObject_MockObject */ @@ -37,9 +31,8 @@ class UninstallCommandTest extends \PHPUnit_Framework_TestCase public function setUp() { $this->installerFactory = $this->getMock('Magento\Setup\Model\InstallerFactory', [], [], '', false); - $this->generatedFiles = $this->getMock('Magento\Framework\Code\GeneratedFiles', [], [], '', false); $this->installer = $this->getMock('Magento\Setup\Model\Installer', [], [], '', false); - $this->command = new UninstallCommand($this->installerFactory, $this->generatedFiles); + $this->command = new UninstallCommand($this->installerFactory); } public function testExecuteInteractionYes() From fac5510f4320edc52568558128cd5b501b7205e1 Mon Sep 17 00:00:00 2001 From: Michail Slabko Date: Tue, 14 Jun 2016 20:17:03 +0300 Subject: [PATCH 331/345] MAGETWO-54283: ProductsList widget should implement IdentityInterface and return correct identities --- .../Block/Product/ProductsList.php | 20 +++++++------------ .../Unit/Block/Product/ProductsListTest.php | 18 ++++++++--------- 2 files changed, 15 insertions(+), 23 deletions(-) diff --git a/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php b/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php index d9a519857f5e7..4a78d80de48c4 100644 --- a/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php +++ b/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php @@ -81,9 +81,6 @@ class ProductsList extends \Magento\Catalog\Block\Product\AbstractProduct implem */ protected $conditionsHelper; - /** @var array */ - private $widgetIdentities; - /** * @param \Magento\Catalog\Block\Product\Context $context * @param \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory @@ -333,19 +330,16 @@ public function getPagerHtml() */ public function getIdentities() { - if ($this->widgetIdentities === null) { - $collection = $this->productCollectionFactory->create(); - $conditions = $this->getConditions(); - $conditions->collectValidatedAttributes($collection); - $this->sqlBuilder->attachConditionToCollection($collection, $conditions); - $this->widgetIdentities = []; - foreach ($collection as $product) { - $this->widgetIdentities[] = \Magento\Catalog\Model\Product::CACHE_TAG . '_' . $product->getId(); + $identities = []; + if ($this->getProductCollection()) { + foreach ($this->getProductCollection() as $product) { + if ($product instanceof IdentityInterface) { + $identities = array_merge($identities, $product->getIdentities()); + } } - $this->widgetIdentities = $this->widgetIdentities ?: [\Magento\Catalog\Model\Product::CACHE_TAG]; } - return $this->widgetIdentities; + return $identities?: [\Magento\Catalog\Model\Product::CACHE_TAG]; } /** diff --git a/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php b/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php index 9ca3bdab457cd..36c6553476b16 100644 --- a/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php +++ b/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php @@ -329,18 +329,16 @@ public function testGetIdentities() ])->disableOriginalConstructor() ->getMock(); - $this->collectionFactory->expects($this->once())->method('create')->willReturn($collection); - $this->productsList->setData('conditions_encoded', 'some_serialized_conditions'); - - $this->builder->expects($this->once())->method('attachConditionToCollection') - ->with($collection, $this->getConditionsForCollection($collection)) - ->willReturnSelf(); - $product = $this->getMock('Magento\Catalog\Api\ProductInterface', ['getId']); - $product->expects($this->once())->method('getId')->willReturn('product_id'); - $collection->expects($this->once())->method('getIterator')->willReturn(new \ArrayIterator([$product])); + $product = $this->getMock('Magento\Framework\DataObject\IdentityInterface', ['getIdentities']); + $notProduct = $this->getMock('NotProduct', ['getIdentities']); + $product->expects($this->once())->method('getIdentities')->willReturn(['product_identity']); + $collection->expects($this->once())->method('getIterator')->willReturn( + new \ArrayIterator([$product, $notProduct]) + ); + $this->productsList->setData('product_collection', $collection); $this->assertEquals( - [\Magento\Catalog\Model\Product::CACHE_TAG . '_' . 'product_id'], + ['product_identity'], $this->productsList->getIdentities() ); } From dd944cea55f70829da0878088c2806c2ff02fa46 Mon Sep 17 00:00:00 2001 From: Michail Slabko Date: Tue, 14 Jun 2016 20:29:48 +0300 Subject: [PATCH 332/345] MAGETWO-54283: ProductsList widget should implement IdentityInterface and return correct identities --- app/code/Magento/CatalogWidget/Block/Product/ProductsList.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php b/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php index 4a78d80de48c4..cf3e2ac4a5191 100644 --- a/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php +++ b/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php @@ -339,7 +339,7 @@ public function getIdentities() } } - return $identities?: [\Magento\Catalog\Model\Product::CACHE_TAG]; + return $identities ?: [\Magento\Catalog\Model\Product::CACHE_TAG]; } /** From 4993f09500399891e9cb3d9a68bce9ba31cc0812 Mon Sep 17 00:00:00 2001 From: Ankur Kaneria Date: Tue, 14 Jun 2016 13:12:03 -0500 Subject: [PATCH 333/345] MAGETWO-54205: After Disable/Enable Magento modules via CLI all cache types become disabled - minor formatting update --- lib/internal/Magento/Framework/Code/GeneratedFiles.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Code/GeneratedFiles.php b/lib/internal/Magento/Framework/Code/GeneratedFiles.php index f89ab86f1673d..757bafaf2a455 100644 --- a/lib/internal/Magento/Framework/Code/GeneratedFiles.php +++ b/lib/internal/Magento/Framework/Code/GeneratedFiles.php @@ -114,7 +114,7 @@ public function requestRegeneration() /** * Reads Cache configuration from env.php and returns indexed array containing all the enabled cache types. * - * @return string [] + * @return string[] */ private function getEnabledCacheTypes() { From 69644eaa6810ee191f2e3178f23bd574e1020251 Mon Sep 17 00:00:00 2001 From: Ankur Kaneria Date: Tue, 14 Jun 2016 13:47:27 -0500 Subject: [PATCH 334/345] MAGETWO-54205: After Disable/Enable Magento modules via CLI all cache types become disabled - Minor formatting update --- lib/internal/Magento/Framework/Code/GeneratedFiles.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Code/GeneratedFiles.php b/lib/internal/Magento/Framework/Code/GeneratedFiles.php index 757bafaf2a455..75d5ff4b4b73b 100644 --- a/lib/internal/Magento/Framework/Code/GeneratedFiles.php +++ b/lib/internal/Magento/Framework/Code/GeneratedFiles.php @@ -183,7 +183,7 @@ private function disableAllCacheTypes() * Enables apppropriate cache types in app/etc/env.php based on the passed in $cacheTypes array * TODO: to be removed in scope of MAGETWO-53476 * - * @param string [] + * @param string[] * * @return void */ From 237b3bbba3b0820b75c406c4a0fb7e1d2887525e Mon Sep 17 00:00:00 2001 From: Alexander Paliarush Date: Tue, 14 Jun 2016 17:31:27 -0500 Subject: [PATCH 335/345] MAGETWO-51753: During install over existing database, giving different admin email results in exception --- setup/config/di.config.php | 1 + .../pub/magento/setup/create-admin-account.js | 23 +++- .../src/Magento/Setup/Controller/Install.php | 126 +++--------------- .../Controller/ValidateAdminCredentials.php | 61 +++++++++ .../src/Magento/Setup/Model/AdminAccount.php | 10 +- .../Setup/Model/RequestDataConverter.php | 117 ++++++++++++++++ .../Test/Unit/Controller/InstallTest.php | 10 +- .../Validator/AdminCredentialsValidator.php | 87 ++++++++++++ .../magento/setup/create-admin-account.phtml | 21 ++- 9 files changed, 336 insertions(+), 120 deletions(-) create mode 100644 setup/src/Magento/Setup/Controller/ValidateAdminCredentials.php create mode 100644 setup/src/Magento/Setup/Model/RequestDataConverter.php create mode 100644 setup/src/Magento/Setup/Validator/AdminCredentialsValidator.php diff --git a/setup/config/di.config.php b/setup/config/di.config.php index 9c73aae475358..81ddbde7adb1e 100644 --- a/setup/config/di.config.php +++ b/setup/config/di.config.php @@ -21,6 +21,7 @@ 'Magento\Setup\Controller\Environment', 'Magento\Setup\Controller\DependencyCheck', 'Magento\Setup\Controller\DatabaseCheck', + 'Magento\Setup\Controller\ValidateAdminCredentials', 'Magento\Setup\Controller\AddDatabase', 'Magento\Setup\Controller\WebConfiguration', 'Magento\Setup\Controller\CustomizeYourStore', diff --git a/setup/pub/magento/setup/create-admin-account.js b/setup/pub/magento/setup/create-admin-account.js index ec9fdf9c6b248..dd8357dd9a568 100644 --- a/setup/pub/magento/setup/create-admin-account.js +++ b/setup/pub/magento/setup/create-admin-account.js @@ -5,14 +5,14 @@ 'use strict'; angular.module('create-admin-account', ['ngStorage']) - .controller('createAdminAccountController', ['$scope', '$state', '$localStorage', function ($scope, $state, $localStorage) { + .controller('createAdminAccountController', ['$scope', '$state', '$localStorage', '$http', function ($scope, $state, $localStorage, $http) { $scope.admin = { 'passwordStatus': { class: 'none', label: 'None' } }; - + $scope.passwordStatusChange = function () { if (angular.isUndefined($scope.admin.password)) { return; @@ -41,6 +41,25 @@ angular.module('create-admin-account', ['ngStorage']) $scope.admin = $localStorage.admin; } + $scope.validateCredentials = function () { + var data = { + 'db': $localStorage.db, + 'admin': $localStorage.admin, + 'store': $localStorage.store, + 'config': $localStorage.config + }; + $http.post('index.php/validate-admin-credentials', data) + .success(function (data) { + $scope.validateCredentials.result = data; + if ($scope.validateCredentials.result.success) { + $scope.nextState(); + } + }) + .error(function (data) { + $scope.validateCredentials.failed = data; + }); + }; + $scope.$on('nextState', function () { $localStorage.admin = $scope.admin; }); diff --git a/setup/src/Magento/Setup/Controller/Install.php b/setup/src/Magento/Setup/Controller/Install.php index 647ba4e59f7d0..5b3507911ef4e 100644 --- a/setup/src/Magento/Setup/Controller/Install.php +++ b/setup/src/Magento/Setup/Controller/Install.php @@ -6,21 +6,18 @@ namespace Magento\Setup\Controller; -use Magento\Setup\Model\AdminAccount; +use Magento\Framework\App\DeploymentConfig; use Magento\Framework\Config\ConfigOptionsListConstants as SetupConfigOptionsList; -use Magento\Backend\Setup\ConfigOptionsList as BackendConfigOptionsList; +use Magento\SampleData; use Magento\Setup\Model\Installer; use Magento\Setup\Model\Installer\ProgressFactory; use Magento\Setup\Model\InstallerFactory; -use Magento\Setup\Model\StoreConfigurationDataMapper as UserConfig; +use Magento\Setup\Model\RequestDataConverter; use Magento\Setup\Model\WebLogger; use Zend\Json\Json; use Zend\Mvc\Controller\AbstractActionController; use Zend\View\Model\JsonModel; use Zend\View\Model\ViewModel; -use Magento\Setup\Console\Command\InstallCommand; -use Magento\SampleData; -use Magento\Framework\App\DeploymentConfig; /** * Install controller @@ -54,6 +51,11 @@ class Install extends AbstractActionController */ private $deploymentConfig; + /** + * @var RequestDataConverter + */ + private $requestDataConverter; + /** * Default Constructor * @@ -62,19 +64,22 @@ class Install extends AbstractActionController * @param ProgressFactory $progressFactory * @param \Magento\Framework\Setup\SampleData\State $sampleDataState * @param \Magento\Framework\App\DeploymentConfig $deploymentConfig + * @param RequestDataConverter $requestDataConverter */ public function __construct( WebLogger $logger, InstallerFactory $installerFactory, ProgressFactory $progressFactory, \Magento\Framework\Setup\SampleData\State $sampleDataState, - DeploymentConfig $deploymentConfig + DeploymentConfig $deploymentConfig, + RequestDataConverter $requestDataConverter ) { $this->log = $logger; $this->installer = $installerFactory->create($logger); $this->progressFactory = $progressFactory; $this->sampleDataState = $sampleDataState; $this->deploymentConfig = $deploymentConfig; + $this->requestDataConverter = $requestDataConverter; } /** @@ -91,7 +96,6 @@ public function indexAction() * Index Action * * @return JsonModel - * @SuppressWarnings(PHPMD.NPathComplexity) */ public function startAction() { @@ -99,11 +103,9 @@ public function startAction() $json = new JsonModel; try { $this->checkForPriorInstall(); - $data = array_merge( - $this->importDeploymentConfigForm(), - $this->importUserConfigForm(), - $this->importAdminUserForm() - ); + $content = $this->getRequest()->getContent(); + $source = $content ? $source = Json::decode($content, Json::TYPE_ARRAY) : []; + $data = $this->requestDataConverter->convert($source); $this->installer->install($data); $json->setVariable( 'key', @@ -168,102 +170,4 @@ private function checkForPriorInstall() throw new \Magento\Setup\Exception('Magento application is already installed.'); } } - - /** - * Maps data from request to format of deployment config model - * - * @return array - * @SuppressWarnings(PHPMD.CyclomaticComplexity) - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - private function importDeploymentConfigForm() - { - $content = $this->getRequest()->getContent(); - $source = []; - if ($content) { - $source = Json::decode($content, Json::TYPE_ARRAY); - } - - $result = []; - $result[SetupConfigOptionsList::INPUT_KEY_DB_HOST] = isset($source['db']['host']) ? $source['db']['host'] : ''; - $result[SetupConfigOptionsList::INPUT_KEY_DB_NAME] = isset($source['db']['name']) ? $source['db']['name'] : ''; - $result[SetupConfigOptionsList::INPUT_KEY_DB_USER] = isset($source['db']['user']) ? $source['db']['user'] :''; - $result[SetupConfigOptionsList::INPUT_KEY_DB_PASSWORD] = - isset($source['db']['password']) ? $source['db']['password'] : ''; - $result[SetupConfigOptionsList::INPUT_KEY_DB_PREFIX] = - isset($source['db']['tablePrefix']) ? $source['db']['tablePrefix'] : ''; - $result[BackendConfigOptionsList::INPUT_KEY_BACKEND_FRONTNAME] = isset($source['config']['address']['admin']) - ? $source['config']['address']['admin'] : ''; - $result[SetupConfigOptionsList::INPUT_KEY_ENCRYPTION_KEY] = isset($source['config']['encrypt']['key']) - ? $source['config']['encrypt']['key'] : null; - $result[SetupConfigOptionsList::INPUT_KEY_SESSION_SAVE] = isset($source['config']['sessionSave']['type']) - ? $source['config']['sessionSave']['type'] : SetupConfigOptionsList::SESSION_SAVE_FILES; - $result[Installer::ENABLE_MODULES] = isset($source['store']['selectedModules']) - ? implode(',', $source['store']['selectedModules']) : ''; - $result[Installer::DISABLE_MODULES] = isset($source['store']['allModules']) - ? implode(',', array_diff($source['store']['allModules'], $source['store']['selectedModules'])) : ''; - return $result; - } - - /** - * Maps data from request to format of user config model - * - * @return array - * @SuppressWarnings(PHPMD.CyclomaticComplexity) - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - private function importUserConfigForm() - { - $result = []; - $source = []; - $content = $this->getRequest()->getContent(); - if ($content) { - $source = Json::decode($content, Json::TYPE_ARRAY); - } - if (isset($source['config']['address']['base_url']) && !empty($source['config']['address']['base_url'])) { - $result[UserConfig::KEY_BASE_URL] = $source['config']['address']['base_url']; - } - $result[UserConfig::KEY_USE_SEF_URL] = isset($source['config']['rewrites']['allowed']) - ? $source['config']['rewrites']['allowed'] : ''; - $result[UserConfig::KEY_IS_SECURE] = isset($source['config']['https']['front']) - ? $source['config']['https']['front'] : ''; - $result[UserConfig::KEY_IS_SECURE_ADMIN] = isset($source['config']['https']['admin']) - ? $source['config']['https']['admin'] : ''; - $result[UserConfig::KEY_BASE_URL_SECURE] = (isset($source['config']['https']['front']) - || isset($source['config']['https']['admin'])) - ? $source['config']['https']['text'] : ''; - $result[UserConfig::KEY_LANGUAGE] = isset($source['store']['language']) - ? $source['store']['language'] : ''; - $result[UserConfig::KEY_TIMEZONE] = isset($source['store']['timezone']) - ? $source['store']['timezone'] : ''; - $result[UserConfig::KEY_CURRENCY] = isset($source['store']['currency']) - ? $source['store']['currency'] : ''; - $result[InstallCommand::INPUT_KEY_USE_SAMPLE_DATA] = isset($source['store']['useSampleData']) - ? $source['store']['useSampleData'] : ''; - $result[InstallCommand::INPUT_KEY_CLEANUP_DB] = isset($source['store']['cleanUpDatabase']) - ? $source['store']['cleanUpDatabase'] : ''; - return $result; - } - - /** - * Maps data from request to format of admin account model - * - * @return array - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - private function importAdminUserForm() - { - $result = []; - $source = []; - $content = $this->getRequest()->getContent(); - if ($content) { - $source = Json::decode($content, Json::TYPE_ARRAY); - } - $result[AdminAccount::KEY_USER] = isset($source['admin']['username']) ? $source['admin']['username'] : ''; - $result[AdminAccount::KEY_PASSWORD] = isset($source['admin']['password']) ? $source['admin']['password'] : ''; - $result[AdminAccount::KEY_EMAIL] = isset($source['admin']['email']) ? $source['admin']['email'] : ''; - $result[AdminAccount::KEY_FIRST_NAME] = $result[AdminAccount::KEY_USER]; - $result[AdminAccount::KEY_LAST_NAME] = $result[AdminAccount::KEY_USER]; - return $result; - } } diff --git a/setup/src/Magento/Setup/Controller/ValidateAdminCredentials.php b/setup/src/Magento/Setup/Controller/ValidateAdminCredentials.php new file mode 100644 index 0000000000000..6833c1fba0c11 --- /dev/null +++ b/setup/src/Magento/Setup/Controller/ValidateAdminCredentials.php @@ -0,0 +1,61 @@ +adminCredentialsValidator = $adminCredentialsValidator; + $this->requestDataConverter = $requestDataConverter; + } + + /** + * Validate admin credentials. + * + * @return JsonModel + */ + public function indexAction() + { + try { + $content = $this->getRequest()->getContent(); + $source = $content ? $source = Json::decode($content, Json::TYPE_ARRAY) : []; + $data = $this->requestDataConverter->convert($source); + $this->adminCredentialsValidator->validate($data); + return new JsonModel(['success' => true]); + } catch (\Exception $e) { + return new JsonModel(['success' => false, 'error' => $e->getMessage()]); + } + } +} diff --git a/setup/src/Magento/Setup/Model/AdminAccount.php b/setup/src/Magento/Setup/Model/AdminAccount.php index cd9362f8a0d47..6605052cede1e 100644 --- a/setup/src/Magento/Setup/Model/AdminAccount.php +++ b/setup/src/Magento/Setup/Model/AdminAccount.php @@ -137,22 +137,22 @@ private function saveAdminUser() * @return void * @throws \Exception If the username and email do not both match data provided to install */ - private function validateUserMatches($username, $email) + public function validateUserMatches($username, $email) { if ((strcasecmp($email, $this->data[self::KEY_EMAIL]) == 0) && (strcasecmp($username, $this->data[self::KEY_USER]) != 0)) { // email matched but username did not throw new \Exception( - 'An existing user has the given email but different username. ' . self::KEY_USER . - ' and ' . self::KEY_EMAIL . ' both need to match an existing user or both be new.' + 'An existing user has the given email but different username. ' + . 'Username and email both need to match an existing user or both be new.' ); } if ((strcasecmp($username, $this->data[self::KEY_USER]) == 0) && (strcasecmp($email, $this->data[self::KEY_EMAIL]) != 0)) { // username matched but email did not throw new \Exception( - 'An existing user has the given username but different email. ' . self::KEY_USER . - ' and ' . self::KEY_EMAIL . ' both need to match an existing user or both be new.' + 'An existing user has the given username but different email. ' + . 'Username and email both need to match an existing user or both be new.' ); } } diff --git a/setup/src/Magento/Setup/Model/RequestDataConverter.php b/setup/src/Magento/Setup/Model/RequestDataConverter.php new file mode 100644 index 0000000000000..bd924c16f3da0 --- /dev/null +++ b/setup/src/Magento/Setup/Model/RequestDataConverter.php @@ -0,0 +1,117 @@ +convertDeploymentConfigForm($source), + $this->convertUserConfigForm($source), + $this->convertAdminUserForm($source) + ); + return $result; + } + + /** + * Convert data from request to format of deployment config model + * + * @param array $source + * @return array + * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @SuppressWarnings(PHPMD.NPathComplexity) + */ + private function convertDeploymentConfigForm(array $source) + { + $result = []; + $result[SetupConfigOptionsList::INPUT_KEY_DB_HOST] = isset($source['db']['host']) ? $source['db']['host'] : ''; + $result[SetupConfigOptionsList::INPUT_KEY_DB_NAME] = isset($source['db']['name']) ? $source['db']['name'] : ''; + $result[SetupConfigOptionsList::INPUT_KEY_DB_USER] = isset($source['db']['user']) ? $source['db']['user'] : ''; + $result[SetupConfigOptionsList::INPUT_KEY_DB_PASSWORD] = + isset($source['db']['password']) ? $source['db']['password'] : ''; + $result[SetupConfigOptionsList::INPUT_KEY_DB_PREFIX] = + isset($source['db']['tablePrefix']) ? $source['db']['tablePrefix'] : ''; + $result[BackendConfigOptionsList::INPUT_KEY_BACKEND_FRONTNAME] = isset($source['config']['address']['admin']) + ? $source['config']['address']['admin'] : ''; + $result[SetupConfigOptionsList::INPUT_KEY_ENCRYPTION_KEY] = isset($source['config']['encrypt']['key']) + ? $source['config']['encrypt']['key'] : null; + $result[SetupConfigOptionsList::INPUT_KEY_SESSION_SAVE] = isset($source['config']['sessionSave']['type']) + ? $source['config']['sessionSave']['type'] : SetupConfigOptionsList::SESSION_SAVE_FILES; + $result[Installer::ENABLE_MODULES] = isset($source['store']['selectedModules']) + ? implode(',', $source['store']['selectedModules']) : ''; + $result[Installer::DISABLE_MODULES] = isset($source['store']['allModules']) + ? implode(',', array_diff($source['store']['allModules'], $source['store']['selectedModules'])) : ''; + return $result; + } + + /** + * Convert data from request to format of user config model + * + * @param array $source + * @return array + * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @SuppressWarnings(PHPMD.NPathComplexity) + */ + private function convertUserConfigForm(array $source) + { + $result = []; + if (isset($source['config']['address']['base_url']) && !empty($source['config']['address']['base_url'])) { + $result[UserConfig::KEY_BASE_URL] = $source['config']['address']['base_url']; + } + $result[UserConfig::KEY_USE_SEF_URL] = isset($source['config']['rewrites']['allowed']) + ? $source['config']['rewrites']['allowed'] : ''; + $result[UserConfig::KEY_IS_SECURE] = isset($source['config']['https']['front']) + ? $source['config']['https']['front'] : ''; + $result[UserConfig::KEY_IS_SECURE_ADMIN] = isset($source['config']['https']['admin']) + ? $source['config']['https']['admin'] : ''; + $result[UserConfig::KEY_BASE_URL_SECURE] = (isset($source['config']['https']['front']) + || isset($source['config']['https']['admin'])) + ? $source['config']['https']['text'] : ''; + $result[UserConfig::KEY_LANGUAGE] = isset($source['store']['language']) + ? $source['store']['language'] : ''; + $result[UserConfig::KEY_TIMEZONE] = isset($source['store']['timezone']) + ? $source['store']['timezone'] : ''; + $result[UserConfig::KEY_CURRENCY] = isset($source['store']['currency']) + ? $source['store']['currency'] : ''; + $result[InstallCommand::INPUT_KEY_USE_SAMPLE_DATA] = isset($source['store']['useSampleData']) + ? $source['store']['useSampleData'] : ''; + $result[InstallCommand::INPUT_KEY_CLEANUP_DB] = isset($source['store']['cleanUpDatabase']) + ? $source['store']['cleanUpDatabase'] : ''; + return $result; + } + + /** + * Convert data from request to format of admin account model + * + * @param array $source + * @return array + */ + private function convertAdminUserForm(array $source) + { + $result = []; + $result[AdminAccount::KEY_USER] = isset($source['admin']['username']) ? $source['admin']['username'] : ''; + $result[AdminAccount::KEY_PASSWORD] = isset($source['admin']['password']) ? $source['admin']['password'] : ''; + $result[AdminAccount::KEY_EMAIL] = isset($source['admin']['email']) ? $source['admin']['email'] : ''; + $result[AdminAccount::KEY_FIRST_NAME] = $result[AdminAccount::KEY_USER]; + $result[AdminAccount::KEY_LAST_NAME] = $result[AdminAccount::KEY_USER]; + return $result; + } +} diff --git a/setup/src/Magento/Setup/Test/Unit/Controller/InstallTest.php b/setup/src/Magento/Setup/Test/Unit/Controller/InstallTest.php index 121621075a138..55666ffef059c 100644 --- a/setup/src/Magento/Setup/Test/Unit/Controller/InstallTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Controller/InstallTest.php @@ -7,6 +7,7 @@ namespace Magento\Setup\Test\Unit\Controller; use \Magento\Setup\Controller\Install; +use Magento\Setup\Model\RequestDataConverter; class InstallTest extends \PHPUnit_Framework_TestCase { @@ -25,6 +26,11 @@ class InstallTest extends \PHPUnit_Framework_TestCase */ private $progressFactory; + /** + * @var \PHPUnit_Framework_MockObject_MockObject|RequestDataConverter + */ + private $requestDataConverter; + /** * @var Install */ @@ -48,6 +54,7 @@ public function setUp() $this->progressFactory = $this->getMock('\Magento\Setup\Model\Installer\ProgressFactory', [], [], '', false); $this->sampleDataState = $this->getMock('\Magento\Framework\Setup\SampleData\State', [], [], '', false); $this->deploymentConfig = $this->getMock('\Magento\Framework\App\DeploymentConfig', [], [], '', false); + $this->requestDataConverter = $this->getMock(RequestDataConverter::class, [], [], '', false); $installerFactory->expects($this->once())->method('create')->with($this->webLogger) ->willReturn($this->installer); @@ -56,7 +63,8 @@ public function setUp() $installerFactory, $this->progressFactory, $this->sampleDataState, - $this->deploymentConfig + $this->deploymentConfig, + $this->requestDataConverter ); } diff --git a/setup/src/Magento/Setup/Validator/AdminCredentialsValidator.php b/setup/src/Magento/Setup/Validator/AdminCredentialsValidator.php new file mode 100644 index 0000000000000..b487e11a63fe1 --- /dev/null +++ b/setup/src/Magento/Setup/Validator/AdminCredentialsValidator.php @@ -0,0 +1,87 @@ +connectionFactory = $connectionFactory; + $this->adminAccountFactory = $adminAccountFactory; + $this->setupFactory = $setupFactory; + } + + /** + * Validate admin user name and email. + * + * @param array $data + * @return void + * @throws \Exception + */ + public function validate(array $data) + { + try { + $dbConnection = $this->connectionFactory->create([ + ConfigOption::KEY_NAME => $data[ConfigOption::INPUT_KEY_DB_NAME], + ConfigOption::KEY_HOST => $data[ConfigOption::INPUT_KEY_DB_HOST], + ConfigOption::KEY_USER => $data[ConfigOption::INPUT_KEY_DB_USER], + ConfigOption::KEY_PASSWORD => $data[ConfigOption::INPUT_KEY_DB_PASSWORD], + ConfigOption::KEY_PREFIX => $data[ConfigOption::INPUT_KEY_DB_PREFIX] + ]); + + $userName = $data[AdminAccount::KEY_USER]; + $userEmail = $data[AdminAccount::KEY_EMAIL]; + $userTable = $dbConnection->getTableName('admin_user'); + $result = $dbConnection->fetchRow( + "SELECT user_id, username, email FROM {$userTable} WHERE username = :username OR email = :email", + ['username' => $userName, 'email' => $userEmail] + ); + $setup = $this->setupFactory->create(); + $adminAccount = $this->adminAccountFactory->create( + $setup, + [AdminAccount::KEY_USER => $userName, AdminAccount::KEY_EMAIL => $userEmail] + ); + } catch (\Exception $e) { + return; + } + + if (!empty($result)) { + $adminAccount->validateUserMatches($result['username'], $result['email']); + } + } +} diff --git a/setup/view/magento/setup/create-admin-account.phtml b/setup/view/magento/setup/create-admin-account.phtml index 8c08d127aac65..35c0c911b184c 100644 --- a/setup/view/magento/setup/create-admin-account.phtml +++ b/setup/view/magento/setup/create-admin-account.phtml @@ -29,7 +29,7 @@ $passwordWizard = sprintf(
@@ -41,6 +41,25 @@ $passwordWizard = sprintf(

{{$state.current.header}}

+
+ Credentials validation successfully passed. +
+
+ {{validateCredentials.result.error}} +
+
+ {{validateCredentials.failed}} +
+

Create a new Admin account to manage your store.

From b89d115e182c4f7074c0c9d58a381516413c3348 Mon Sep 17 00:00:00 2001 From: Hayder Sharhan Date: Tue, 14 Jun 2016 21:17:10 -0500 Subject: [PATCH 336/345] MAGETWO-52615: [Github] Backup error after disabling module in Web Setup Wizard #3562 - Changed id for the grid and name for backups created via web setup wizard. --- app/code/Magento/Backup/Model/Fs/Collection.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Backup/Model/Fs/Collection.php b/app/code/Magento/Backup/Model/Fs/Collection.php index 888a072a57d66..4e5c009b7b0f9 100644 --- a/app/code/Magento/Backup/Model/Fs/Collection.php +++ b/app/code/Magento/Backup/Model/Fs/Collection.php @@ -110,7 +110,10 @@ protected function _generateRow($filename) $row[$key] = $value; } $row['size'] = $this->_varDirectory->stat($this->_varDirectory->getRelativePath($filename))['size']; - $row['id'] = $row['time'] . '_' . $row['type']; + if (isset($row['display_name']) && $row['display_name'] == '') { + $row['display_name'] = 'WebSetupWizard'; + } + $row['id'] = $row['time'] . '_' . $row['type'] . (isset($row['display_name']) ? $row['display_name'] : ''); return $row; } } From b904a3634a6a0de7ffbb4c18de7df680c3b9b600 Mon Sep 17 00:00:00 2001 From: Alexander Paliarush Date: Wed, 15 Jun 2016 00:15:24 -0500 Subject: [PATCH 337/345] MAGETWO-51753: During install over existing database, giving different admin email results in exception --- .../tests/app/Magento/Install/Test/Block/CreateAdmin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Block/CreateAdmin.php b/dev/tests/functional/tests/app/Magento/Install/Test/Block/CreateAdmin.php index d446cf9abe6e4..3205f17a63d8d 100644 --- a/dev/tests/functional/tests/app/Magento/Install/Test/Block/CreateAdmin.php +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/CreateAdmin.php @@ -21,7 +21,7 @@ class CreateAdmin extends Form * * @var string */ - protected $next = "[ng-click*='next']"; + protected $next = "[ng-click*='validateCredentials']"; /** * First field selector From b7c5930ff3bf2b2bc2d728e7f8ea42297279c859 Mon Sep 17 00:00:00 2001 From: Oleksii Korshenko Date: Wed, 15 Jun 2016 00:15:59 -0500 Subject: [PATCH 338/345] MAGETWO-54200: Wrong "gift_message_available" parameter exported --- app/code/Magento/GiftMessage/composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/GiftMessage/composer.json b/app/code/Magento/GiftMessage/composer.json index 4e6f44a608188..e24d985833eb5 100644 --- a/app/code/Magento/GiftMessage/composer.json +++ b/app/code/Magento/GiftMessage/composer.json @@ -9,7 +9,6 @@ "magento/module-sales": "100.1.*", "magento/module-backend": "100.1.*", "magento/module-customer": "100.1.*", - "magento/module-eav": "100.1.*", "magento/module-quote": "100.1.*", "magento/framework": "100.1.*", "magento/module-ui": "100.1.*" From 0d3e47f946caca4482d99825689fa5d0d7852d33 Mon Sep 17 00:00:00 2001 From: Roman Ganin Date: Wed, 15 Jun 2016 16:05:07 +0300 Subject: [PATCH 339/345] MAGETWO-54184: Url rewrite do not use store view dependent data for product --- ...ProductProcessUrlRewriteSavingObserver.php | 13 +++++------ ...uctProcessUrlRewriteSavingObserverTest.php | 5 ---- .../Eav/Model/ResourceModel/UpdateHandler.php | 23 ++++++++++++++++++- .../Operation/Update/UpdateAttributes.php | 2 +- 4 files changed, 29 insertions(+), 14 deletions(-) diff --git a/app/code/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserver.php b/app/code/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserver.php index e0825c88f395b..47a5fca398db5 100644 --- a/app/code/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserver.php +++ b/app/code/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserver.php @@ -5,8 +5,11 @@ */ namespace Magento\CatalogUrlRewrite\Observer; +use Magento\Catalog\Model\Product; use Magento\Catalog\Model\Product\Visibility; use Magento\CatalogUrlRewrite\Model\ProductUrlRewriteGenerator; +use Magento\Framework\EntityManager\HydratorPool; +use Magento\Store\Model\StoreScopeProvider; use Magento\UrlRewrite\Model\UrlPersistInterface; use Magento\UrlRewrite\Service\V1\Data\UrlRewrite; use Magento\Framework\Event\ObserverInterface; @@ -37,13 +40,12 @@ public function __construct( /** * Generate urls for UrlRewrite and save it in storage - * * @param \Magento\Framework\Event\Observer $observer * @return void */ public function execute(\Magento\Framework\Event\Observer $observer) { - /** @var \Magento\Catalog\Model\Product $product */ + /** @var Product $product */ $product = $observer->getEvent()->getProduct(); if ($product->dataHasChangedFor('url_key') @@ -58,11 +60,8 @@ public function execute(\Magento\Framework\Event\Observer $observer) UrlRewrite::STORE_ID => $product->getStoreId() ]); - $savedProduct = clone $product; - $savedProduct->load($product->getId()); - - if ($savedProduct->isVisibleInSiteVisibility()) { - $this->urlPersist->replace($this->productUrlRewriteGenerator->generate($savedProduct)); + if ($product->isVisibleInSiteVisibility()) { + $this->urlPersist->replace($this->productUrlRewriteGenerator->generate($product)); } } } diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductProcessUrlRewriteSavingObserverTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductProcessUrlRewriteSavingObserverTest.php index 57ef40108a071..c99ad5fcff9f1 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductProcessUrlRewriteSavingObserverTest.php +++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductProcessUrlRewriteSavingObserverTest.php @@ -69,7 +69,6 @@ protected function setUp() 'isVisibleInSiteVisibility', 'getIsChangedWebsites', 'getIsChangedCategories', - 'load', 'getStoreId' ], [], @@ -197,10 +196,6 @@ public function testExecuteUrlKey( ) { $this->product->expects($this->any())->method('getStoreId')->will($this->returnValue(12)); - $this->product->expects($this->exactly($expectedProdLoadCount)) - ->method('load') - ->with($this->product->getId()); - $this->product->expects($this->any()) ->method('dataHasChangedFor') ->will($this->returnValueMap( diff --git a/app/code/Magento/Eav/Model/ResourceModel/UpdateHandler.php b/app/code/Magento/Eav/Model/ResourceModel/UpdateHandler.php index 4d05b49a938cf..0f892a272fa1a 100644 --- a/app/code/Magento/Eav/Model/ResourceModel/UpdateHandler.php +++ b/app/code/Magento/Eav/Model/ResourceModel/UpdateHandler.php @@ -5,6 +5,7 @@ */ namespace Magento\Eav\Model\ResourceModel; +use Magento\Framework\App\ObjectManager; use Magento\Framework\EntityManager\MetadataPool; use Magento\Eav\Api\AttributeRepositoryInterface as AttributeRepository; use Magento\Framework\Api\SearchCriteriaBuilder; @@ -48,6 +49,11 @@ class UpdateHandler implements AttributeInterface */ private $scopeResolver; + /** + * @var ReadHandler + */ + private $readHandler; + /** * UpdateHandler constructor. * @param AttributeRepository $attributeRepository @@ -163,6 +169,21 @@ public function execute($entityType, $entityData, $arguments = []) } $this->attributePersistor->flush($entityType, $context); } - return $entityData; + return $this->getReadHandler()->execute($entityType, $entityData, $arguments); + } + + /** + * Get read handler + * + * @deprecated + * + * @return ReadHandler + */ + protected function getReadHandler() + { + if (!$this->readHandler) { + $this->readHandler = ObjectManager::getInstance()->get(ReadHandler::class); + } + return $this->readHandler; } } diff --git a/lib/internal/Magento/Framework/EntityManager/Operation/Update/UpdateAttributes.php b/lib/internal/Magento/Framework/EntityManager/Operation/Update/UpdateAttributes.php index 698d946406d55..e711d34a9e5ca 100644 --- a/lib/internal/Magento/Framework/EntityManager/Operation/Update/UpdateAttributes.php +++ b/lib/internal/Magento/Framework/EntityManager/Operation/Update/UpdateAttributes.php @@ -56,7 +56,7 @@ public function execute($entity, $arguments = []) $entityData = array_merge($hydrator->extract($entity), $arguments); $actions = $this->attributePool->getActions($entityType, 'update'); foreach ($actions as $action) { - $action->execute($entityType, $entityData, $arguments); + $entityData = $action->execute($entityType, $entityData, $arguments); } $entity = $hydrator->hydrate($entity, $entityData); return $entity; From 4c02e09b9bf97b8313aa0194a0414965e52001d5 Mon Sep 17 00:00:00 2001 From: Roman Ganin Date: Wed, 15 Jun 2016 16:07:03 +0300 Subject: [PATCH 340/345] MAGETWO-54184: Url rewrite do not use store view dependent data for product --- .../ProductProcessUrlRewriteSavingObserverTest.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductProcessUrlRewriteSavingObserverTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductProcessUrlRewriteSavingObserverTest.php index c99ad5fcff9f1..ac3ca2b2fceb6 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductProcessUrlRewriteSavingObserverTest.php +++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/ProductProcessUrlRewriteSavingObserverTest.php @@ -115,7 +115,6 @@ public function testUrlKeyDataProvider() 'isChangedCategories' => false, 'visibilityResult' => true, 'expectedDeleteCount' => 1, - 'expectedProdLoadCount' => 1, 'expectedReplaceCount' => 1, ], @@ -126,7 +125,6 @@ public function testUrlKeyDataProvider() 'isChangedCategories' => false, 'visibilityResult' => true, 'expectedDeleteCount' => 0, - 'expectedProdLoadCount' => 0, 'expectedReplaceCount' => 0 ], 'visibility changed' => [ @@ -136,7 +134,6 @@ public function testUrlKeyDataProvider() 'isChangedCategories' => false, 'visibilityResult' => true, 'expectedDeleteCount' => 1, - 'expectedProdLoadCount' => 1, 'expectedReplaceCount' => 1 ], 'websites changed' => [ @@ -146,7 +143,6 @@ public function testUrlKeyDataProvider() 'isChangedCategories' => false, 'visibilityResult' => true, 'expectedDeleteCount' => 1, - 'expectedProdLoadCount' => 1, 'expectedReplaceCount' => 1 ], 'categories changed' => [ @@ -156,7 +152,6 @@ public function testUrlKeyDataProvider() 'isChangedCategories' => true, 'visibilityResult' => true, 'expectedDeleteCount' => 1, - 'expectedProdLoadCount' => 1, 'expectedReplaceCount' => 1 ], 'url changed invisible' => [ @@ -166,7 +161,6 @@ public function testUrlKeyDataProvider() 'isChangedCategories' => false, 'visibilityResult' => false, 'expectedDeleteCount' => 1, - 'expectedProdLoadCount' => 1, 'expectedReplaceCount' => 0 ], ]; @@ -179,7 +173,6 @@ public function testUrlKeyDataProvider() * @param bool $isChangedCategories * @param bool $visibilityResult * @param int $expectedDeleteCount - * @param int $expectedProdLoadCount * @param int $expectedReplaceCount * * @dataProvider testUrlKeyDataProvider @@ -191,7 +184,6 @@ public function testExecuteUrlKey( $isChangedCategories, $visibilityResult, $expectedDeleteCount, - $expectedProdLoadCount, $expectedReplaceCount ) { $this->product->expects($this->any())->method('getStoreId')->will($this->returnValue(12)); From a7fbf5ba7574817ff42347995f4958515d9bfbe3 Mon Sep 17 00:00:00 2001 From: Roman Ganin Date: Wed, 15 Jun 2016 18:58:30 +0300 Subject: [PATCH 341/345] MAGETWO-54184: Url rewrite do not use store view dependent data for product --- .../Api/ProductAttributeMediaGalleryManagementInterfaceTest.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeMediaGalleryManagementInterfaceTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeMediaGalleryManagementInterfaceTest.php index 1087c3f48be03..1be468ef7e606 100644 --- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeMediaGalleryManagementInterfaceTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeMediaGalleryManagementInterfaceTest.php @@ -275,8 +275,6 @@ public function testUpdateWithNotDefaultStoreId() $targetProduct = $this->getTargetSimpleProduct(); $this->assertEquals('/m/a/magento_image.jpg', $targetProduct->getData('thumbnail')); - $this->assertNull($targetProduct->getData('image')); - $this->assertNull($targetProduct->getData('small_image')); $mediaGallery = $targetProduct->getData('media_gallery'); $this->assertCount(1, $mediaGallery['images']); $updatedImage = array_shift($mediaGallery['images']); From 2b5814b4cf687f2e8fe07b14236b9bdf11a8c1ed Mon Sep 17 00:00:00 2001 From: Roman Ganin Date: Thu, 16 Jun 2016 10:58:32 +0300 Subject: [PATCH 342/345] MAGETWO-54184: Url rewrite do not use store view dependent data for product - removed unused aliases --- .../Observer/ProductProcessUrlRewriteSavingObserver.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/code/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserver.php b/app/code/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserver.php index 47a5fca398db5..eb3a76e57c833 100644 --- a/app/code/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserver.php +++ b/app/code/Magento/CatalogUrlRewrite/Observer/ProductProcessUrlRewriteSavingObserver.php @@ -6,10 +6,7 @@ namespace Magento\CatalogUrlRewrite\Observer; use Magento\Catalog\Model\Product; -use Magento\Catalog\Model\Product\Visibility; use Magento\CatalogUrlRewrite\Model\ProductUrlRewriteGenerator; -use Magento\Framework\EntityManager\HydratorPool; -use Magento\Store\Model\StoreScopeProvider; use Magento\UrlRewrite\Model\UrlPersistInterface; use Magento\UrlRewrite\Service\V1\Data\UrlRewrite; use Magento\Framework\Event\ObserverInterface; From 45293b0214451a4f548ec58a325e026abcf5eb72 Mon Sep 17 00:00:00 2001 From: Vladyslav Shcherbyna Date: Thu, 16 Jun 2016 12:48:50 +0300 Subject: [PATCH 343/345] MAGETWO-53667: @api interfaces in 2.1 --- lib/internal/Magento/Framework/App/Action/Context.php | 3 +++ lib/internal/Magento/Framework/App/ActionFactory.php | 3 +++ lib/internal/Magento/Framework/App/ActionInterface.php | 3 +++ .../Framework/App/Area/FrontNameResolverFactory.php | 3 +++ .../Framework/App/Area/FrontNameResolverInterface.php | 2 +- lib/internal/Magento/Framework/App/Language/Dictionary.php | 2 ++ .../Framework/App/Request/DataPersistorInterface.php | 3 +++ .../Framework/App/Request/PathInfoProcessorInterface.php | 3 +++ lib/internal/Magento/Framework/App/RequestInterface.php | 3 +++ lib/internal/Magento/Framework/App/ResponseInterface.php | 3 +++ .../Magento/Framework/App/View/Asset/Publisher.php | 2 ++ lib/internal/Magento/Framework/AppInterface.php | 3 +++ lib/internal/Magento/Framework/AuthorizationInterface.php | 3 +++ .../Magento/Framework/Component/ComponentRegistrar.php | 2 ++ .../Magento/Framework/Controller/ResultInterface.php | 2 ++ lib/internal/Magento/Framework/CurrencyInterface.php | 3 +++ .../Framework/Data/Argument/InterpreterInterface.php | 2 ++ .../Magento/Framework/Data/Form/Filter/FilterInterface.php | 3 +++ .../Magento/Framework/Data/OptionSourceInterface.php | 2 ++ lib/internal/Magento/Framework/Event.php | 3 +++ lib/internal/Magento/Framework/Event/Observer.php | 3 +++ .../Magento/Framework/Exception/LocalizedException.php | 3 +++ lib/internal/Magento/Framework/Filesystem.php | 3 +++ .../Magento/Framework/Filesystem/DriverInterface.php | 2 ++ lib/internal/Magento/Framework/Indexer/ConfigInterface.php | 5 +++++ .../Magento/Framework/Indexer/IndexStructureInterface.php | 5 +++++ .../Magento/Framework/Indexer/IndexerInterface.php | 5 +++++ .../Framework/Indexer/SaveHandler/IndexerInterface.php | 5 +++++ lib/internal/Magento/Framework/Math/Calculator.php | 2 ++ lib/internal/Magento/Framework/Math/Division.php | 2 ++ lib/internal/Magento/Framework/Math/Random.php | 2 ++ lib/internal/Magento/Framework/Model/Context.php | 3 +++ lib/internal/Magento/Framework/ObjectManagerInterface.php | 3 +++ .../Magento/Framework/Phrase/RendererInterface.php | 5 +++++ lib/internal/Magento/Framework/Profiler.php | 3 +++ lib/internal/Magento/Framework/Registry.php | 2 ++ .../Magento/Framework/Setup/InstallDataInterface.php | 2 ++ .../Magento/Framework/Setup/InstallSchemaInterface.php | 2 ++ lib/internal/Magento/Framework/Setup/LoggerInterface.php | 2 ++ .../Magento/Framework/Setup/ModuleDataSetupInterface.php | 2 ++ lib/internal/Magento/Framework/Setup/SetupInterface.php | 2 ++ .../Magento/Framework/Setup/UninstallInterface.php | 2 ++ .../Magento/Framework/Setup/UpgradeDataInterface.php | 2 ++ .../Magento/Framework/Setup/UpgradeSchemaInterface.php | 2 ++ .../Magento/Framework/Shell/CommandRendererInterface.php | 5 +++++ lib/internal/Magento/Framework/Shell/README.md | 2 +- lib/internal/Magento/Framework/Stdlib/ArrayManager.php | 2 ++ lib/internal/Magento/Framework/Stdlib/ArrayUtils.php | 1 + lib/internal/Magento/Framework/Stdlib/BooleanUtils.php | 2 ++ .../Magento/Framework/Stdlib/CookieManagerInterface.php | 1 + lib/internal/Magento/Framework/Stdlib/DateTime.php | 2 ++ .../Framework/Stdlib/DateTime/TimezoneInterface.php | 4 ++++ lib/internal/Magento/Framework/Stdlib/StringUtils.php | 2 ++ lib/internal/Magento/Framework/UrlInterface.php | 3 +++ .../Magento/Framework/View/Asset/ConfigInterface.php | 2 ++ lib/internal/Magento/Framework/View/Asset/Repository.php | 2 ++ lib/internal/Magento/Framework/View/ConfigInterface.php | 1 + lib/internal/Magento/Framework/View/Context.php | 1 + .../Framework/View/Design/Theme/FileProviderInterface.php | 4 +++- .../Framework/View/Design/Theme/Label/ListInterface.php | 2 ++ .../Magento/Framework/View/Design/Theme/ListInterface.php | 2 ++ .../Magento/Framework/View/Element/BlockFactory.php | 2 ++ .../Magento/Framework/View/Element/BlockInterface.php | 2 ++ lib/internal/Magento/Framework/View/Element/Context.php | 2 ++ lib/internal/Magento/Framework/View/Element/FormKey.php | 3 +++ .../Magento/Framework/View/Element/RendererInterface.php | 2 ++ .../Magento/Framework/View/Element/RendererList.php | 3 +++ .../UiComponent/DataProvider/DataProviderInterface.php | 2 ++ .../View/Element/UiComponent/DataProvider/FilterPool.php | 2 ++ .../Magento/Framework/View/Element/UiComponentFactory.php | 2 ++ .../Magento/Framework/View/File/CollectorInterface.php | 2 ++ lib/internal/Magento/Framework/View/FileSystem.php | 2 ++ lib/internal/Magento/Framework/View/LayoutInterface.php | 1 + lib/internal/Magento/Framework/View/Page/Config.php | 2 ++ .../Magento/Framework/View/Page/FaviconInterface.php | 2 ++ lib/internal/Magento/Framework/View/Page/Title.php | 2 ++ .../Magento/Framework/View/Render/RenderFactory.php | 2 ++ lib/internal/Magento/Framework/View/RenderInterface.php | 2 ++ lib/internal/Magento/Framework/View/Result/Layout.php | 2 ++ .../Magento/Framework/View/Result/LayoutFactory.php | 3 +++ lib/internal/Magento/Framework/View/Result/Page.php | 2 ++ lib/internal/Magento/Framework/View/Result/PageFactory.php | 2 ++ .../Framework/View/Template/Html/MinifierInterface.php | 7 ++++++- .../Magento/Framework/View/Url/ConfigInterface.php | 1 + 84 files changed, 208 insertions(+), 4 deletions(-) diff --git a/lib/internal/Magento/Framework/App/Action/Context.php b/lib/internal/Magento/Framework/App/Action/Context.php index c725e0af6f71b..c1f648d933698 100644 --- a/lib/internal/Magento/Framework/App/Action/Context.php +++ b/lib/internal/Magento/Framework/App/Action/Context.php @@ -7,6 +7,9 @@ use Magento\Framework\Controller\ResultFactory; +/** + * @api + */ class Context implements \Magento\Framework\ObjectManager\ContextInterface { /** diff --git a/lib/internal/Magento/Framework/App/ActionFactory.php b/lib/internal/Magento/Framework/App/ActionFactory.php index 52cdefc971f92..943488cc12488 100644 --- a/lib/internal/Magento/Framework/App/ActionFactory.php +++ b/lib/internal/Magento/Framework/App/ActionFactory.php @@ -7,6 +7,9 @@ */ namespace Magento\Framework\App; +/** + * @api + */ class ActionFactory { /** diff --git a/lib/internal/Magento/Framework/App/ActionInterface.php b/lib/internal/Magento/Framework/App/ActionInterface.php index a54f75e09bf47..765e10a7c81cc 100644 --- a/lib/internal/Magento/Framework/App/ActionInterface.php +++ b/lib/internal/Magento/Framework/App/ActionInterface.php @@ -7,6 +7,9 @@ */ namespace Magento\Framework\App; +/** + * @api + */ interface ActionInterface { const FLAG_NO_DISPATCH = 'no-dispatch'; diff --git a/lib/internal/Magento/Framework/App/Area/FrontNameResolverFactory.php b/lib/internal/Magento/Framework/App/Area/FrontNameResolverFactory.php index 8f91eb9937fc6..e5be5fdd7c9bd 100644 --- a/lib/internal/Magento/Framework/App/Area/FrontNameResolverFactory.php +++ b/lib/internal/Magento/Framework/App/Area/FrontNameResolverFactory.php @@ -7,6 +7,9 @@ */ namespace Magento\Framework\App\Area; +/** + * @api + */ class FrontNameResolverFactory { /** diff --git a/lib/internal/Magento/Framework/App/Area/FrontNameResolverInterface.php b/lib/internal/Magento/Framework/App/Area/FrontNameResolverInterface.php index d107a97bbccd9..0ee442d560d07 100644 --- a/lib/internal/Magento/Framework/App/Area/FrontNameResolverInterface.php +++ b/lib/internal/Magento/Framework/App/Area/FrontNameResolverInterface.php @@ -16,7 +16,7 @@ interface FrontNameResolverInterface /** * Retrieve front name * - * @param bool if true, only return frontname if it is valid for the host + * @param bool $checkHost if true, return front name only if it is valid for the current host * @return string|bool */ public function getFrontName($checkHost = false); diff --git a/lib/internal/Magento/Framework/App/Language/Dictionary.php b/lib/internal/Magento/Framework/App/Language/Dictionary.php index 5e1413aecfe2d..603b0ac35779c 100644 --- a/lib/internal/Magento/Framework/App/Language/Dictionary.php +++ b/lib/internal/Magento/Framework/App/Language/Dictionary.php @@ -11,6 +11,8 @@ /** * A service for reading language package dictionaries + * + * @api */ class Dictionary { diff --git a/lib/internal/Magento/Framework/App/Request/DataPersistorInterface.php b/lib/internal/Magento/Framework/App/Request/DataPersistorInterface.php index 03dd4dbe8763d..6530e89264fdf 100644 --- a/lib/internal/Magento/Framework/App/Request/DataPersistorInterface.php +++ b/lib/internal/Magento/Framework/App/Request/DataPersistorInterface.php @@ -5,6 +5,9 @@ */ namespace Magento\Framework\App\Request; +/** + * @api + */ interface DataPersistorInterface { /** diff --git a/lib/internal/Magento/Framework/App/Request/PathInfoProcessorInterface.php b/lib/internal/Magento/Framework/App/Request/PathInfoProcessorInterface.php index 4293b809b718c..85140a9af28eb 100644 --- a/lib/internal/Magento/Framework/App/Request/PathInfoProcessorInterface.php +++ b/lib/internal/Magento/Framework/App/Request/PathInfoProcessorInterface.php @@ -7,6 +7,9 @@ */ namespace Magento\Framework\App\Request; +/** + * @api + */ interface PathInfoProcessorInterface { /** diff --git a/lib/internal/Magento/Framework/App/RequestInterface.php b/lib/internal/Magento/Framework/App/RequestInterface.php index 92a5d16ef957d..d2b4ae17a0584 100644 --- a/lib/internal/Magento/Framework/App/RequestInterface.php +++ b/lib/internal/Magento/Framework/App/RequestInterface.php @@ -7,6 +7,9 @@ */ namespace Magento\Framework\App; +/** + * @api + */ interface RequestInterface { /** diff --git a/lib/internal/Magento/Framework/App/ResponseInterface.php b/lib/internal/Magento/Framework/App/ResponseInterface.php index 67e67bdf011f5..423509ca96246 100644 --- a/lib/internal/Magento/Framework/App/ResponseInterface.php +++ b/lib/internal/Magento/Framework/App/ResponseInterface.php @@ -7,6 +7,9 @@ */ namespace Magento\Framework\App; +/** + * @api + */ interface ResponseInterface { /** diff --git a/lib/internal/Magento/Framework/App/View/Asset/Publisher.php b/lib/internal/Magento/Framework/App/View/Asset/Publisher.php index d998a322d0d8b..eddc71ce014f7 100644 --- a/lib/internal/Magento/Framework/App/View/Asset/Publisher.php +++ b/lib/internal/Magento/Framework/App/View/Asset/Publisher.php @@ -12,6 +12,8 @@ /** * A publishing service for view assets + * + * @api */ class Publisher { diff --git a/lib/internal/Magento/Framework/AppInterface.php b/lib/internal/Magento/Framework/AppInterface.php index 7c9c3c341aea3..d9a532b540142 100644 --- a/lib/internal/Magento/Framework/AppInterface.php +++ b/lib/internal/Magento/Framework/AppInterface.php @@ -7,6 +7,9 @@ */ namespace Magento\Framework; +/** + * @api + */ interface AppInterface { /** diff --git a/lib/internal/Magento/Framework/AuthorizationInterface.php b/lib/internal/Magento/Framework/AuthorizationInterface.php index c6e1c7f6925fb..d33145920c094 100644 --- a/lib/internal/Magento/Framework/AuthorizationInterface.php +++ b/lib/internal/Magento/Framework/AuthorizationInterface.php @@ -7,6 +7,9 @@ */ namespace Magento\Framework; +/** + * @api + */ interface AuthorizationInterface { /** diff --git a/lib/internal/Magento/Framework/Component/ComponentRegistrar.php b/lib/internal/Magento/Framework/Component/ComponentRegistrar.php index ba7ebdf49dc43..d7496971188df 100644 --- a/lib/internal/Magento/Framework/Component/ComponentRegistrar.php +++ b/lib/internal/Magento/Framework/Component/ComponentRegistrar.php @@ -9,6 +9,8 @@ * Provides ability to statically register components. * * @author Josh Di Fabio + * + * @api */ class ComponentRegistrar implements ComponentRegistrarInterface { diff --git a/lib/internal/Magento/Framework/Controller/ResultInterface.php b/lib/internal/Magento/Framework/Controller/ResultInterface.php index dd5271af432c0..4fec5445c9eb3 100644 --- a/lib/internal/Magento/Framework/Controller/ResultInterface.php +++ b/lib/internal/Magento/Framework/Controller/ResultInterface.php @@ -12,6 +12,8 @@ * An abstraction of result that controller actions must return * The point of this kind of object is to encapsulate all information/objects relevant to the result * and be able to set it to the HTTP response + * + * @api */ interface ResultInterface { diff --git a/lib/internal/Magento/Framework/CurrencyInterface.php b/lib/internal/Magento/Framework/CurrencyInterface.php index 148b8ed58d43f..ed3f1eb99eba3 100644 --- a/lib/internal/Magento/Framework/CurrencyInterface.php +++ b/lib/internal/Magento/Framework/CurrencyInterface.php @@ -5,6 +5,9 @@ */ namespace Magento\Framework; +/** + * @api + */ interface CurrencyInterface { /** diff --git a/lib/internal/Magento/Framework/Data/Argument/InterpreterInterface.php b/lib/internal/Magento/Framework/Data/Argument/InterpreterInterface.php index 65f579066d22f..b8332db9d352a 100644 --- a/lib/internal/Magento/Framework/Data/Argument/InterpreterInterface.php +++ b/lib/internal/Magento/Framework/Data/Argument/InterpreterInterface.php @@ -7,6 +7,8 @@ /** * Interface that encapsulates complexity of expression computation + * + * @api */ interface InterpreterInterface { diff --git a/lib/internal/Magento/Framework/Data/Form/Filter/FilterInterface.php b/lib/internal/Magento/Framework/Data/Form/Filter/FilterInterface.php index 55adc1008d5e2..8360d0431ba80 100644 --- a/lib/internal/Magento/Framework/Data/Form/Filter/FilterInterface.php +++ b/lib/internal/Magento/Framework/Data/Form/Filter/FilterInterface.php @@ -11,6 +11,9 @@ */ namespace Magento\Framework\Data\Form\Filter; +/** + * @api + */ interface FilterInterface { /** diff --git a/lib/internal/Magento/Framework/Data/OptionSourceInterface.php b/lib/internal/Magento/Framework/Data/OptionSourceInterface.php index dda53d7ac7f5b..ff3a3f1d7eafb 100644 --- a/lib/internal/Magento/Framework/Data/OptionSourceInterface.php +++ b/lib/internal/Magento/Framework/Data/OptionSourceInterface.php @@ -7,6 +7,8 @@ /** * Source of option values in a form of value-label pairs + * + * @api */ interface OptionSourceInterface { diff --git a/lib/internal/Magento/Framework/Event.php b/lib/internal/Magento/Framework/Event.php index 6aa85b1d365c3..275d4e0fc257d 100644 --- a/lib/internal/Magento/Framework/Event.php +++ b/lib/internal/Magento/Framework/Event.php @@ -11,6 +11,9 @@ */ namespace Magento\Framework; +/** + * @api + */ class Event extends \Magento\Framework\DataObject { /** diff --git a/lib/internal/Magento/Framework/Event/Observer.php b/lib/internal/Magento/Framework/Event/Observer.php index 5b2178ee54f98..222a28d03de3d 100644 --- a/lib/internal/Magento/Framework/Event/Observer.php +++ b/lib/internal/Magento/Framework/Event/Observer.php @@ -7,6 +7,9 @@ use Magento\Framework\Event; +/** + * @api + */ class Observer extends \Magento\Framework\DataObject { /** diff --git a/lib/internal/Magento/Framework/Exception/LocalizedException.php b/lib/internal/Magento/Framework/Exception/LocalizedException.php index 9906ca2b733b2..5208fd3cfb826 100644 --- a/lib/internal/Magento/Framework/Exception/LocalizedException.php +++ b/lib/internal/Magento/Framework/Exception/LocalizedException.php @@ -10,6 +10,9 @@ use Magento\Framework\Phrase; use Magento\Framework\Phrase\Renderer\Placeholder; +/** + * @api + */ class LocalizedException extends \Exception { /** diff --git a/lib/internal/Magento/Framework/Filesystem.php b/lib/internal/Magento/Framework/Filesystem.php index a61b201dedf11..d1b53b333f30e 100644 --- a/lib/internal/Magento/Framework/Filesystem.php +++ b/lib/internal/Magento/Framework/Filesystem.php @@ -9,6 +9,9 @@ use Magento\Framework\Filesystem\DriverPool; +/** + * @api + */ class Filesystem { /** diff --git a/lib/internal/Magento/Framework/Filesystem/DriverInterface.php b/lib/internal/Magento/Framework/Filesystem/DriverInterface.php index 5e297b237e242..8b30fe398f08c 100644 --- a/lib/internal/Magento/Framework/Filesystem/DriverInterface.php +++ b/lib/internal/Magento/Framework/Filesystem/DriverInterface.php @@ -11,6 +11,8 @@ /** * Class Driver + * + * @api */ interface DriverInterface { diff --git a/lib/internal/Magento/Framework/Indexer/ConfigInterface.php b/lib/internal/Magento/Framework/Indexer/ConfigInterface.php index 0aec18bd26d91..c49b5038da0fb 100644 --- a/lib/internal/Magento/Framework/Indexer/ConfigInterface.php +++ b/lib/internal/Magento/Framework/Indexer/ConfigInterface.php @@ -5,6 +5,11 @@ */ namespace Magento\Framework\Indexer; +/** + * Indexer(s) configuration + * + * @api + */ interface ConfigInterface { /** diff --git a/lib/internal/Magento/Framework/Indexer/IndexStructureInterface.php b/lib/internal/Magento/Framework/Indexer/IndexStructureInterface.php index 78d3233f98bf2..81bf133de805f 100644 --- a/lib/internal/Magento/Framework/Indexer/IndexStructureInterface.php +++ b/lib/internal/Magento/Framework/Indexer/IndexStructureInterface.php @@ -7,6 +7,11 @@ use Magento\Framework\Search\Request\Dimension; +/** + * Indexer structure (schema) handler + * + * @api + */ interface IndexStructureInterface { /** diff --git a/lib/internal/Magento/Framework/Indexer/IndexerInterface.php b/lib/internal/Magento/Framework/Indexer/IndexerInterface.php index 7085432a8249a..643d3cb4251f0 100644 --- a/lib/internal/Magento/Framework/Indexer/IndexerInterface.php +++ b/lib/internal/Magento/Framework/Indexer/IndexerInterface.php @@ -5,6 +5,11 @@ */ namespace Magento\Framework\Indexer; +/** + * Indexer + * + * @api + */ interface IndexerInterface { /** diff --git a/lib/internal/Magento/Framework/Indexer/SaveHandler/IndexerInterface.php b/lib/internal/Magento/Framework/Indexer/SaveHandler/IndexerInterface.php index faafbb28c19a9..11e4d827b824a 100644 --- a/lib/internal/Magento/Framework/Indexer/SaveHandler/IndexerInterface.php +++ b/lib/internal/Magento/Framework/Indexer/SaveHandler/IndexerInterface.php @@ -11,6 +11,11 @@ use Magento\Framework\Search\Request\Dimension; +/** + * Indexer persistence handler + * + * @api + */ interface IndexerInterface { /** diff --git a/lib/internal/Magento/Framework/Math/Calculator.php b/lib/internal/Magento/Framework/Math/Calculator.php index 3786e61ed20c4..a1705cdcfba82 100644 --- a/lib/internal/Magento/Framework/Math/Calculator.php +++ b/lib/internal/Magento/Framework/Math/Calculator.php @@ -7,6 +7,8 @@ /** * Calculations Library + * + * @api */ class Calculator { diff --git a/lib/internal/Magento/Framework/Math/Division.php b/lib/internal/Magento/Framework/Math/Division.php index cbe8232abcf58..49b7882f961ab 100644 --- a/lib/internal/Magento/Framework/Math/Division.php +++ b/lib/internal/Magento/Framework/Math/Division.php @@ -7,6 +7,8 @@ /** * Division library + * + * @api */ class Division { diff --git a/lib/internal/Magento/Framework/Math/Random.php b/lib/internal/Magento/Framework/Math/Random.php index 31b7728ed874b..473ef9d4a8701 100644 --- a/lib/internal/Magento/Framework/Math/Random.php +++ b/lib/internal/Magento/Framework/Math/Random.php @@ -7,6 +7,8 @@ /** * Random data generator + * + * @api */ class Random { diff --git a/lib/internal/Magento/Framework/Model/Context.php b/lib/internal/Magento/Framework/Model/Context.php index 5a74a58c8286a..b9a2349b57ed0 100644 --- a/lib/internal/Magento/Framework/Model/Context.php +++ b/lib/internal/Magento/Framework/Model/Context.php @@ -7,6 +7,9 @@ */ namespace Magento\Framework\Model; +/** + * @api + */ class Context implements \Magento\Framework\ObjectManager\ContextInterface { /** diff --git a/lib/internal/Magento/Framework/ObjectManagerInterface.php b/lib/internal/Magento/Framework/ObjectManagerInterface.php index 3da6e76eae2a4..e30b040866b74 100644 --- a/lib/internal/Magento/Framework/ObjectManagerInterface.php +++ b/lib/internal/Magento/Framework/ObjectManagerInterface.php @@ -5,6 +5,9 @@ */ namespace Magento\Framework; +/** + * @api + */ interface ObjectManagerInterface { /** diff --git a/lib/internal/Magento/Framework/Phrase/RendererInterface.php b/lib/internal/Magento/Framework/Phrase/RendererInterface.php index a18436c2a56e2..85ef3a39083b8 100644 --- a/lib/internal/Magento/Framework/Phrase/RendererInterface.php +++ b/lib/internal/Magento/Framework/Phrase/RendererInterface.php @@ -7,6 +7,11 @@ */ namespace Magento\Framework\Phrase; +/** + * Translated phrase renderer + * + * @api + */ interface RendererInterface { /** diff --git a/lib/internal/Magento/Framework/Profiler.php b/lib/internal/Magento/Framework/Profiler.php index 8607ba21f3e36..94db43d9a0219 100644 --- a/lib/internal/Magento/Framework/Profiler.php +++ b/lib/internal/Magento/Framework/Profiler.php @@ -10,6 +10,9 @@ use Magento\Framework\Profiler\Driver\Factory; use Magento\Framework\Profiler\DriverInterface; +/** + * @api + */ class Profiler { /** diff --git a/lib/internal/Magento/Framework/Registry.php b/lib/internal/Magento/Framework/Registry.php index ed9d54845d9d8..87d6868f78bd8 100644 --- a/lib/internal/Magento/Framework/Registry.php +++ b/lib/internal/Magento/Framework/Registry.php @@ -7,6 +7,8 @@ /** * Registry model. Used to manage values in registry + * + * @api */ class Registry { diff --git a/lib/internal/Magento/Framework/Setup/InstallDataInterface.php b/lib/internal/Magento/Framework/Setup/InstallDataInterface.php index 60c2c92d6444b..24f7a18ae6986 100644 --- a/lib/internal/Magento/Framework/Setup/InstallDataInterface.php +++ b/lib/internal/Magento/Framework/Setup/InstallDataInterface.php @@ -7,6 +7,8 @@ /** * Interface for data installs of a module + * + * @api */ interface InstallDataInterface { diff --git a/lib/internal/Magento/Framework/Setup/InstallSchemaInterface.php b/lib/internal/Magento/Framework/Setup/InstallSchemaInterface.php index c09cb3dc967bc..ae24333f65332 100644 --- a/lib/internal/Magento/Framework/Setup/InstallSchemaInterface.php +++ b/lib/internal/Magento/Framework/Setup/InstallSchemaInterface.php @@ -7,6 +7,8 @@ /** * Interface for DB schema installs of a module + * + * @api */ interface InstallSchemaInterface { diff --git a/lib/internal/Magento/Framework/Setup/LoggerInterface.php b/lib/internal/Magento/Framework/Setup/LoggerInterface.php index f3e2bec686e6d..0ed9648b9284e 100644 --- a/lib/internal/Magento/Framework/Setup/LoggerInterface.php +++ b/lib/internal/Magento/Framework/Setup/LoggerInterface.php @@ -8,6 +8,8 @@ /** * Interface to Log Message in Setup + * + * @api */ interface LoggerInterface { diff --git a/lib/internal/Magento/Framework/Setup/ModuleDataSetupInterface.php b/lib/internal/Magento/Framework/Setup/ModuleDataSetupInterface.php index 94e43b9d3b435..fead63b73c55e 100644 --- a/lib/internal/Magento/Framework/Setup/ModuleDataSetupInterface.php +++ b/lib/internal/Magento/Framework/Setup/ModuleDataSetupInterface.php @@ -7,6 +7,8 @@ /** * DB data resource interface for a module + * + * @api */ interface ModuleDataSetupInterface extends SetupInterface { diff --git a/lib/internal/Magento/Framework/Setup/SetupInterface.php b/lib/internal/Magento/Framework/Setup/SetupInterface.php index ac7b2af414643..a11eb95fa0dfc 100644 --- a/lib/internal/Magento/Framework/Setup/SetupInterface.php +++ b/lib/internal/Magento/Framework/Setup/SetupInterface.php @@ -7,6 +7,8 @@ /** * DB resource interface + * + * @api */ interface SetupInterface { diff --git a/lib/internal/Magento/Framework/Setup/UninstallInterface.php b/lib/internal/Magento/Framework/Setup/UninstallInterface.php index 7e8450f7b69b3..5eb91270bcf53 100644 --- a/lib/internal/Magento/Framework/Setup/UninstallInterface.php +++ b/lib/internal/Magento/Framework/Setup/UninstallInterface.php @@ -7,6 +7,8 @@ /** * Interface for handling data removal during module uninstall + * + * @api */ interface UninstallInterface { diff --git a/lib/internal/Magento/Framework/Setup/UpgradeDataInterface.php b/lib/internal/Magento/Framework/Setup/UpgradeDataInterface.php index c7e99709f6cbc..75b2ecc82faab 100644 --- a/lib/internal/Magento/Framework/Setup/UpgradeDataInterface.php +++ b/lib/internal/Magento/Framework/Setup/UpgradeDataInterface.php @@ -7,6 +7,8 @@ /** * Interface for data upgrades of a module + * + * @api */ interface UpgradeDataInterface { diff --git a/lib/internal/Magento/Framework/Setup/UpgradeSchemaInterface.php b/lib/internal/Magento/Framework/Setup/UpgradeSchemaInterface.php index 4a1e45dfa0075..9dfc7025f8631 100644 --- a/lib/internal/Magento/Framework/Setup/UpgradeSchemaInterface.php +++ b/lib/internal/Magento/Framework/Setup/UpgradeSchemaInterface.php @@ -7,6 +7,8 @@ /** * Interface for DB schema upgrades of a module + * + * @api */ interface UpgradeSchemaInterface { diff --git a/lib/internal/Magento/Framework/Shell/CommandRendererInterface.php b/lib/internal/Magento/Framework/Shell/CommandRendererInterface.php index 6296240d40e29..3e0575c251d54 100644 --- a/lib/internal/Magento/Framework/Shell/CommandRendererInterface.php +++ b/lib/internal/Magento/Framework/Shell/CommandRendererInterface.php @@ -5,6 +5,11 @@ */ namespace Magento\Framework\Shell; +/** + * Shell command renderer + * + * @api + */ interface CommandRendererInterface { /** diff --git a/lib/internal/Magento/Framework/Shell/README.md b/lib/internal/Magento/Framework/Shell/README.md index 5bfb194e6090c..d901fd4915e7e 100644 --- a/lib/internal/Magento/Framework/Shell/README.md +++ b/lib/internal/Magento/Framework/Shell/README.md @@ -1,3 +1,3 @@ -A library with object-oriented interface for executing shell commands. Provides an indirection layer that can be used for customizing or testing (mocking) `exec()` function. +A library with object-oriented interface for generation of shell commands. Provides an indirection layer that can be used for customizing or testing (mocking) `exec()` function. Implements placeholders for command arguments that are automatically escaped in format appropriate to the current OS. Provides ability for logging/capturing the commands and their output. diff --git a/lib/internal/Magento/Framework/Stdlib/ArrayManager.php b/lib/internal/Magento/Framework/Stdlib/ArrayManager.php index de20312fd3ab5..f8b758bb9d9df 100644 --- a/lib/internal/Magento/Framework/Stdlib/ArrayManager.php +++ b/lib/internal/Magento/Framework/Stdlib/ArrayManager.php @@ -7,6 +7,8 @@ /** * Provides methods for nested array manipulations + * + * @api */ class ArrayManager { diff --git a/lib/internal/Magento/Framework/Stdlib/ArrayUtils.php b/lib/internal/Magento/Framework/Stdlib/ArrayUtils.php index ae8b0689c5b4a..82935038c1187 100644 --- a/lib/internal/Magento/Framework/Stdlib/ArrayUtils.php +++ b/lib/internal/Magento/Framework/Stdlib/ArrayUtils.php @@ -8,6 +8,7 @@ /** * Class ArrayUtils * + * @api */ class ArrayUtils { diff --git a/lib/internal/Magento/Framework/Stdlib/BooleanUtils.php b/lib/internal/Magento/Framework/Stdlib/BooleanUtils.php index 37d8595c4a661..fc3d9baaf9fe8 100644 --- a/lib/internal/Magento/Framework/Stdlib/BooleanUtils.php +++ b/lib/internal/Magento/Framework/Stdlib/BooleanUtils.php @@ -7,6 +7,8 @@ /** * Utility methods for the boolean data type + * + * @api */ class BooleanUtils { diff --git a/lib/internal/Magento/Framework/Stdlib/CookieManagerInterface.php b/lib/internal/Magento/Framework/Stdlib/CookieManagerInterface.php index eb3383e6e6400..f4f2effec2dfa 100644 --- a/lib/internal/Magento/Framework/Stdlib/CookieManagerInterface.php +++ b/lib/internal/Magento/Framework/Stdlib/CookieManagerInterface.php @@ -20,6 +20,7 @@ * The cookie manager will make it possible for an application to indicate if a cookie contains sensitive data, * this will allow extra protection to be added to the contents of the cookie as well sending directives to the browser * about how the cookie should be stored and whether JavaScript can access the cookie. + * * @api */ interface CookieManagerInterface extends CookieReaderInterface diff --git a/lib/internal/Magento/Framework/Stdlib/DateTime.php b/lib/internal/Magento/Framework/Stdlib/DateTime.php index de831f6c676dc..35b6adc7e4a41 100644 --- a/lib/internal/Magento/Framework/Stdlib/DateTime.php +++ b/lib/internal/Magento/Framework/Stdlib/DateTime.php @@ -8,6 +8,8 @@ /** * Converter of date formats * Internal dates + * + * @api */ class DateTime { diff --git a/lib/internal/Magento/Framework/Stdlib/DateTime/TimezoneInterface.php b/lib/internal/Magento/Framework/Stdlib/DateTime/TimezoneInterface.php index 3fbf941005c9a..b5049edd721c7 100644 --- a/lib/internal/Magento/Framework/Stdlib/DateTime/TimezoneInterface.php +++ b/lib/internal/Magento/Framework/Stdlib/DateTime/TimezoneInterface.php @@ -8,6 +8,10 @@ namespace Magento\Framework\Stdlib\DateTime; +/** + * Timezone Interface + * @api + */ interface TimezoneInterface { /** diff --git a/lib/internal/Magento/Framework/Stdlib/StringUtils.php b/lib/internal/Magento/Framework/Stdlib/StringUtils.php index fbc19ed947bd9..ed980bd20eda1 100644 --- a/lib/internal/Magento/Framework/Stdlib/StringUtils.php +++ b/lib/internal/Magento/Framework/Stdlib/StringUtils.php @@ -7,6 +7,8 @@ /** * Magento methods to work with string + * + * @api */ class StringUtils { diff --git a/lib/internal/Magento/Framework/UrlInterface.php b/lib/internal/Magento/Framework/UrlInterface.php index b245ea4eface3..dd953e732b4c4 100644 --- a/lib/internal/Magento/Framework/UrlInterface.php +++ b/lib/internal/Magento/Framework/UrlInterface.php @@ -5,6 +5,9 @@ */ namespace Magento\Framework; +/** + * @api + */ interface UrlInterface { /**#@+ diff --git a/lib/internal/Magento/Framework/View/Asset/ConfigInterface.php b/lib/internal/Magento/Framework/View/Asset/ConfigInterface.php index 9b18247be24f5..2e0505cde7d91 100644 --- a/lib/internal/Magento/Framework/View/Asset/ConfigInterface.php +++ b/lib/internal/Magento/Framework/View/Asset/ConfigInterface.php @@ -7,6 +7,8 @@ /** * View asset configuration interface + * + * @api */ interface ConfigInterface { diff --git a/lib/internal/Magento/Framework/View/Asset/Repository.php b/lib/internal/Magento/Framework/View/Asset/Repository.php index c4171b153e089..072b3361cbefe 100644 --- a/lib/internal/Magento/Framework/View/Asset/Repository.php +++ b/lib/internal/Magento/Framework/View/Asset/Repository.php @@ -13,6 +13,8 @@ /** * A repository service for view assets * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * + * @api */ class Repository { diff --git a/lib/internal/Magento/Framework/View/ConfigInterface.php b/lib/internal/Magento/Framework/View/ConfigInterface.php index f414f62a15ca6..21cb20bc80815 100644 --- a/lib/internal/Magento/Framework/View/ConfigInterface.php +++ b/lib/internal/Magento/Framework/View/ConfigInterface.php @@ -7,6 +7,7 @@ /** * Config Interface + * @api */ interface ConfigInterface { diff --git a/lib/internal/Magento/Framework/View/Context.php b/lib/internal/Magento/Framework/View/Context.php index 17f850aa1ae5a..83215621d60a7 100644 --- a/lib/internal/Magento/Framework/View/Context.php +++ b/lib/internal/Magento/Framework/View/Context.php @@ -26,6 +26,7 @@ * * @SuppressWarnings(PHPMD.TooManyFields) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * @api */ class Context { diff --git a/lib/internal/Magento/Framework/View/Design/Theme/FileProviderInterface.php b/lib/internal/Magento/Framework/View/Design/Theme/FileProviderInterface.php index a2e8b2ff4841f..f20305fb9826a 100644 --- a/lib/internal/Magento/Framework/View/Design/Theme/FileProviderInterface.php +++ b/lib/internal/Magento/Framework/View/Design/Theme/FileProviderInterface.php @@ -6,7 +6,9 @@ namespace Magento\Framework\View\Design\Theme; /** - * Interface FileProviderInterface + * Theme files provider + * + * @api */ interface FileProviderInterface { diff --git a/lib/internal/Magento/Framework/View/Design/Theme/Label/ListInterface.php b/lib/internal/Magento/Framework/View/Design/Theme/Label/ListInterface.php index d42306a2cd033..d4530559d044d 100644 --- a/lib/internal/Magento/Framework/View/Design/Theme/Label/ListInterface.php +++ b/lib/internal/Magento/Framework/View/Design/Theme/Label/ListInterface.php @@ -7,6 +7,8 @@ /** * Label list interface + * + * @api */ interface ListInterface { diff --git a/lib/internal/Magento/Framework/View/Design/Theme/ListInterface.php b/lib/internal/Magento/Framework/View/Design/Theme/ListInterface.php index 2cc2a96d3e97f..5a243d30f6e54 100644 --- a/lib/internal/Magento/Framework/View/Design/Theme/ListInterface.php +++ b/lib/internal/Magento/Framework/View/Design/Theme/ListInterface.php @@ -7,6 +7,8 @@ /** * Theme list interface + * + * @api */ interface ListInterface { diff --git a/lib/internal/Magento/Framework/View/Element/BlockFactory.php b/lib/internal/Magento/Framework/View/Element/BlockFactory.php index 3244f4105405b..8c75a3136107a 100644 --- a/lib/internal/Magento/Framework/View/Element/BlockFactory.php +++ b/lib/internal/Magento/Framework/View/Element/BlockFactory.php @@ -9,6 +9,8 @@ /** * Class BlockFactory + * + * @api */ class BlockFactory { diff --git a/lib/internal/Magento/Framework/View/Element/BlockInterface.php b/lib/internal/Magento/Framework/View/Element/BlockInterface.php index 3e0b2946da52d..480d4361c4acd 100644 --- a/lib/internal/Magento/Framework/View/Element/BlockInterface.php +++ b/lib/internal/Magento/Framework/View/Element/BlockInterface.php @@ -9,6 +9,8 @@ * Magento Block * * Used to present information to user + * + * @api */ interface BlockInterface { diff --git a/lib/internal/Magento/Framework/View/Element/Context.php b/lib/internal/Magento/Framework/View/Element/Context.php index 26bb8caae9587..0b1f044bd6a75 100644 --- a/lib/internal/Magento/Framework/View/Element/Context.php +++ b/lib/internal/Magento/Framework/View/Element/Context.php @@ -13,6 +13,8 @@ * * @SuppressWarnings(PHPMD.TooManyFields) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * + * @api */ class Context implements \Magento\Framework\ObjectManager\ContextInterface { diff --git a/lib/internal/Magento/Framework/View/Element/FormKey.php b/lib/internal/Magento/Framework/View/Element/FormKey.php index 3030b3af17da5..0f64cf73cb51d 100644 --- a/lib/internal/Magento/Framework/View/Element/FormKey.php +++ b/lib/internal/Magento/Framework/View/Element/FormKey.php @@ -9,6 +9,9 @@ */ namespace Magento\Framework\View\Element; +/** + * @api + */ class FormKey extends \Magento\Framework\View\Element\AbstractBlock { /** diff --git a/lib/internal/Magento/Framework/View/Element/RendererInterface.php b/lib/internal/Magento/Framework/View/Element/RendererInterface.php index 55f5309fffe04..77a7dbecc408a 100644 --- a/lib/internal/Magento/Framework/View/Element/RendererInterface.php +++ b/lib/internal/Magento/Framework/View/Element/RendererInterface.php @@ -7,6 +7,8 @@ /** * Magento Block interface + * + * @api */ interface RendererInterface { diff --git a/lib/internal/Magento/Framework/View/Element/RendererList.php b/lib/internal/Magento/Framework/View/Element/RendererList.php index 0ca73a0c98971..7ab2dd745bb8f 100644 --- a/lib/internal/Magento/Framework/View/Element/RendererList.php +++ b/lib/internal/Magento/Framework/View/Element/RendererList.php @@ -5,6 +5,9 @@ */ namespace Magento\Framework\View\Element; +/** + * @api + */ class RendererList extends AbstractBlock { /** diff --git a/lib/internal/Magento/Framework/View/Element/UiComponent/DataProvider/DataProviderInterface.php b/lib/internal/Magento/Framework/View/Element/UiComponent/DataProvider/DataProviderInterface.php index 7475047f39914..05451d12003d3 100644 --- a/lib/internal/Magento/Framework/View/Element/UiComponent/DataProvider/DataProviderInterface.php +++ b/lib/internal/Magento/Framework/View/Element/UiComponent/DataProvider/DataProviderInterface.php @@ -9,6 +9,8 @@ /** * Interface DataProviderInterface + * + * @api */ interface DataProviderInterface { diff --git a/lib/internal/Magento/Framework/View/Element/UiComponent/DataProvider/FilterPool.php b/lib/internal/Magento/Framework/View/Element/UiComponent/DataProvider/FilterPool.php index cd5f7ab61456c..99e985587221a 100644 --- a/lib/internal/Magento/Framework/View/Element/UiComponent/DataProvider/FilterPool.php +++ b/lib/internal/Magento/Framework/View/Element/UiComponent/DataProvider/FilterPool.php @@ -11,6 +11,8 @@ /** * Class FilterPool + * + * @api */ class FilterPool { diff --git a/lib/internal/Magento/Framework/View/Element/UiComponentFactory.php b/lib/internal/Magento/Framework/View/Element/UiComponentFactory.php index 20501a4f35917..89066b67966f1 100755 --- a/lib/internal/Magento/Framework/View/Element/UiComponentFactory.php +++ b/lib/internal/Magento/Framework/View/Element/UiComponentFactory.php @@ -17,6 +17,8 @@ /** * Class UiComponentFactory + * + * @api */ class UiComponentFactory extends DataObject { diff --git a/lib/internal/Magento/Framework/View/File/CollectorInterface.php b/lib/internal/Magento/Framework/View/File/CollectorInterface.php index 6269b1f14bc59..d52b86808e300 100644 --- a/lib/internal/Magento/Framework/View/File/CollectorInterface.php +++ b/lib/internal/Magento/Framework/View/File/CollectorInterface.php @@ -9,6 +9,8 @@ /** * Interface of locating view files in the file system + * + * @api */ interface CollectorInterface { diff --git a/lib/internal/Magento/Framework/View/FileSystem.php b/lib/internal/Magento/Framework/View/FileSystem.php index b5597bd058ce8..8a4e70d42a5e7 100644 --- a/lib/internal/Magento/Framework/View/FileSystem.php +++ b/lib/internal/Magento/Framework/View/FileSystem.php @@ -7,6 +7,8 @@ /** * Model that finds file paths by their fileId + * + * @api */ class FileSystem { diff --git a/lib/internal/Magento/Framework/View/LayoutInterface.php b/lib/internal/Magento/Framework/View/LayoutInterface.php index 7b2157aaf17aa..7aab06bdd5db2 100644 --- a/lib/internal/Magento/Framework/View/LayoutInterface.php +++ b/lib/internal/Magento/Framework/View/LayoutInterface.php @@ -7,6 +7,7 @@ /** * Interface LayoutInterface + * @api */ interface LayoutInterface { diff --git a/lib/internal/Magento/Framework/View/Page/Config.php b/lib/internal/Magento/Framework/View/Page/Config.php index 29b264f4e3789..48ed2748a4ab2 100644 --- a/lib/internal/Magento/Framework/View/Page/Config.php +++ b/lib/internal/Magento/Framework/View/Page/Config.php @@ -21,6 +21,8 @@ * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @SuppressWarnings(PHPMD.TooManyFields) + * + * @api */ class Config { diff --git a/lib/internal/Magento/Framework/View/Page/FaviconInterface.php b/lib/internal/Magento/Framework/View/Page/FaviconInterface.php index bcc9c654eb393..20e8692a0fdf8 100644 --- a/lib/internal/Magento/Framework/View/Page/FaviconInterface.php +++ b/lib/internal/Magento/Framework/View/Page/FaviconInterface.php @@ -7,6 +7,8 @@ /** * Favicon interface + * + * @api */ interface FaviconInterface { diff --git a/lib/internal/Magento/Framework/View/Page/Title.php b/lib/internal/Magento/Framework/View/Page/Title.php index 0e5c6da5640ed..f27056f2a503a 100644 --- a/lib/internal/Magento/Framework/View/Page/Title.php +++ b/lib/internal/Magento/Framework/View/Page/Title.php @@ -10,6 +10,8 @@ /** * Page title + * + * @api */ class Title { diff --git a/lib/internal/Magento/Framework/View/Render/RenderFactory.php b/lib/internal/Magento/Framework/View/Render/RenderFactory.php index fb69f5bb2c86e..1b96a01e84451 100644 --- a/lib/internal/Magento/Framework/View/Render/RenderFactory.php +++ b/lib/internal/Magento/Framework/View/Render/RenderFactory.php @@ -10,6 +10,8 @@ /** * Class RenderFactory + * + * @api */ class RenderFactory { diff --git a/lib/internal/Magento/Framework/View/RenderInterface.php b/lib/internal/Magento/Framework/View/RenderInterface.php index c379df5e95a11..61abc093244e2 100644 --- a/lib/internal/Magento/Framework/View/RenderInterface.php +++ b/lib/internal/Magento/Framework/View/RenderInterface.php @@ -7,6 +7,8 @@ /** * Interface RenderInterface + * + * @api */ interface RenderInterface { diff --git a/lib/internal/Magento/Framework/View/Result/Layout.php b/lib/internal/Magento/Framework/View/Result/Layout.php index 677b34da7c82a..4bc015cc48d43 100644 --- a/lib/internal/Magento/Framework/View/Result/Layout.php +++ b/lib/internal/Magento/Framework/View/Result/Layout.php @@ -14,6 +14,8 @@ /** * A generic layout response can be used for rendering any kind of layout * So it comprises a response body from the layout elements it has and sets it to the HTTP response + * + * @api */ class Layout extends AbstractResult { diff --git a/lib/internal/Magento/Framework/View/Result/LayoutFactory.php b/lib/internal/Magento/Framework/View/Result/LayoutFactory.php index 22bca7c3f9dfc..426ce0a123334 100644 --- a/lib/internal/Magento/Framework/View/Result/LayoutFactory.php +++ b/lib/internal/Magento/Framework/View/Result/LayoutFactory.php @@ -8,6 +8,9 @@ use Magento\Framework\ObjectManagerInterface; +/** + * @api + */ class LayoutFactory { /** diff --git a/lib/internal/Magento/Framework/View/Result/Page.php b/lib/internal/Magento/Framework/View/Result/Page.php index fc5967d106a48..952dcabddc19e 100644 --- a/lib/internal/Magento/Framework/View/Result/Page.php +++ b/lib/internal/Magento/Framework/View/Result/Page.php @@ -23,6 +23,8 @@ * @SuppressWarnings(PHPMD.TooManyFields) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @SuppressWarnings(PHPMD.DepthOfInheritance) + * + * @api */ class Page extends Layout { diff --git a/lib/internal/Magento/Framework/View/Result/PageFactory.php b/lib/internal/Magento/Framework/View/Result/PageFactory.php index e82ef0cb66137..d7b4a49b120b8 100644 --- a/lib/internal/Magento/Framework/View/Result/PageFactory.php +++ b/lib/internal/Magento/Framework/View/Result/PageFactory.php @@ -12,6 +12,8 @@ * A factory that knows how to create a "page" result * Requires an instance of controller action in order to impose page type, * which is by convention is determined from the controller action class + * + * @api */ class PageFactory { diff --git a/lib/internal/Magento/Framework/View/Template/Html/MinifierInterface.php b/lib/internal/Magento/Framework/View/Template/Html/MinifierInterface.php index 0166a490dd372..c7219f8b74d34 100644 --- a/lib/internal/Magento/Framework/View/Template/Html/MinifierInterface.php +++ b/lib/internal/Magento/Framework/View/Template/Html/MinifierInterface.php @@ -6,6 +6,11 @@ namespace Magento\Framework\View\Template\Html; +/** + * HTML minifier + * + * @api + */ interface MinifierInterface { /** @@ -30,4 +35,4 @@ public function getPathToMinified($file); * @param string $file */ public function minify($file); -} \ No newline at end of file +} diff --git a/lib/internal/Magento/Framework/View/Url/ConfigInterface.php b/lib/internal/Magento/Framework/View/Url/ConfigInterface.php index b5c33ee21d962..5a540d96ac493 100644 --- a/lib/internal/Magento/Framework/View/Url/ConfigInterface.php +++ b/lib/internal/Magento/Framework/View/Url/ConfigInterface.php @@ -7,6 +7,7 @@ /** * Url Config Interface + * @api */ interface ConfigInterface { From b1a4f809fe4abe74ed10ab5adf2d4df3525718ef Mon Sep 17 00:00:00 2001 From: Dmytro Kvashnin Date: Thu, 16 Jun 2016 13:43:54 +0300 Subject: [PATCH 344/345] =?UTF-8?q?MAGETWO-54454:=20[GITHUB]#4867=20Fix=20?= =?UTF-8?q?=D0=A1ommandExecutor=20interface=20mismatch=20in=20Payment=20Ad?= =?UTF-8?q?apter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Covered two cases of command execution: with command executor and command pool --- .../Magento/Payment/Model/Method/Adapter.php | 3 +- .../Test/Unit/Model/Method/AdapterTest.php | 134 ++++++++++++++++++ 2 files changed, 136 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Payment/Model/Method/Adapter.php b/app/code/Magento/Payment/Model/Method/Adapter.php index e2d7229d7a747..1d693e11fe51f 100644 --- a/app/code/Magento/Payment/Model/Method/Adapter.php +++ b/app/code/Magento/Payment/Model/Method/Adapter.php @@ -507,8 +507,9 @@ private function executeCommand($commandCode, array $arguments = []) return null; } + /** @var InfoInterface|null $payment */ $payment = null; - if (isset($arguments['payment'])) { + if (isset($arguments['payment']) && $arguments['payment'] instanceof InfoInterface) { $payment = $arguments['payment']; $arguments['payment'] = $this->paymentDataObjectFactory->create($arguments['payment']); } diff --git a/app/code/Magento/Payment/Test/Unit/Model/Method/AdapterTest.php b/app/code/Magento/Payment/Test/Unit/Model/Method/AdapterTest.php index 6de6726db31ba..9489219ed7aa2 100644 --- a/app/code/Magento/Payment/Test/Unit/Model/Method/AdapterTest.php +++ b/app/code/Magento/Payment/Test/Unit/Model/Method/AdapterTest.php @@ -6,10 +6,15 @@ namespace Magento\Payment\Test\Unit\Model\Method; use Magento\Framework\Event\ManagerInterface; +use Magento\Payment\Gateway\Command\CommandManagerInterface; use Magento\Payment\Gateway\Command\CommandPoolInterface; +use Magento\Payment\Gateway\CommandInterface; +use Magento\Payment\Gateway\Config\ValueHandlerInterface; use Magento\Payment\Gateway\Config\ValueHandlerPoolInterface; use Magento\Payment\Gateway\Data\PaymentDataObjectFactory; +use Magento\Payment\Gateway\Data\PaymentDataObjectInterface; use Magento\Payment\Gateway\Validator\ValidatorPoolInterface; +use Magento\Payment\Model\InfoInterface; use Magento\Payment\Model\Method\Adapter; class AdapterTest extends \PHPUnit_Framework_TestCase @@ -158,4 +163,133 @@ public function testIsAvailableEmptyQuote() $this->adapter->setInfoInstance($paymentInfo); static::assertTrue($this->adapter->isAvailable(null)); } + + public function testExecuteCommandWithCommandExecutor() + { + /** @var ManagerInterface|\PHPUnit_Framework_MockObject_MockObject $eventManager */ + $eventManager = $this->getMock( + ManagerInterface::class + ); + + /** @var ValueHandlerPoolInterface|\PHPUnit_Framework_MockObject_MockObject $valueHandlerPool */ + $valueHandlerPool = $this->getMock( + ValueHandlerPoolInterface::class + ); + + /** @var CommandManagerInterface|\PHPUnit_Framework_MockObject_MockObject $commandManager */ + $commandManager = $this->getMock( + CommandManagerInterface::class + ); + + /** @var PaymentDataObjectFactory|\PHPUnit_Framework_MockObject_MockObject $paymentDataObjectFactory */ + $paymentDataObjectFactory = $this->getMockBuilder( + PaymentDataObjectFactory::class + ) + ->disableOriginalConstructor() + ->getMock(); + + $paymentInfo = $this->getMock(InfoInterface::class); + $paymentDO = $this->getMock(PaymentDataObjectInterface::class); + + $adapter = new Adapter( + $eventManager, + $valueHandlerPool, + $paymentDataObjectFactory, + 'CODE', + '\FormBlock', + '\InfoBlock', + null, + null, + $commandManager + ); + + $valueHandler = $this->getMock(ValueHandlerInterface::class); + + $valueHandlerPool->expects(static::once()) + ->method('get') + ->with('can_authorize') + ->willReturn($valueHandler); + $valueHandler->expects(static::once()) + ->method('handle') + ->with(['field' => 'can_authorize']) + ->willReturn(true); + + $paymentDataObjectFactory->expects(static::once()) + ->method('create') + ->with($paymentInfo) + ->willReturn($paymentDO); + + $commandManager->expects(static::once()) + ->method('executeByCode') + ->with('authorize', $paymentInfo, ['amount' => 10, 'payment' => $paymentDO]) + ->willReturn(null); + + $adapter->authorize($paymentInfo, 10); + } + + public function testExecuteCommandWithCommandPool() + { + /** @var ManagerInterface|\PHPUnit_Framework_MockObject_MockObject $eventManager */ + $eventManager = $this->getMock( + ManagerInterface::class + ); + + /** @var ValueHandlerPoolInterface|\PHPUnit_Framework_MockObject_MockObject $valueHandlerPool */ + $valueHandlerPool = $this->getMock( + ValueHandlerPoolInterface::class + ); + + /** @var CommandPoolInterface|\PHPUnit_Framework_MockObject_MockObject $commandPool */ + $commandPool = $this->getMock( + CommandPoolInterface::class + ); + + /** @var PaymentDataObjectFactory|\PHPUnit_Framework_MockObject_MockObject $paymentDataObjectFactory */ + $paymentDataObjectFactory = $this->getMockBuilder( + PaymentDataObjectFactory::class + ) + ->disableOriginalConstructor() + ->getMock(); + + $paymentInfo = $this->getMock(InfoInterface::class); + $paymentDO = $this->getMock(PaymentDataObjectInterface::class); + + $adapter = new Adapter( + $eventManager, + $valueHandlerPool, + $paymentDataObjectFactory, + 'CODE', + '\FormBlock', + '\InfoBlock', + $commandPool + ); + + $valueHandler = $this->getMock(ValueHandlerInterface::class); + $command = $this->getMock(CommandInterface::class); + + $valueHandlerPool->expects(static::once()) + ->method('get') + ->with('can_authorize') + ->willReturn($valueHandler); + $valueHandler->expects(static::once()) + ->method('handle') + ->with(['field' => 'can_authorize']) + ->willReturn(true); + + $paymentDataObjectFactory->expects(static::once()) + ->method('create') + ->with($paymentInfo) + ->willReturn($paymentDO); + + $commandPool->expects(static::once()) + ->method('get') + ->with('authorize') + ->willReturn($command); + $command->expects(static::once()) + ->method('execute') + ->with(['amount' => 10, 'payment' => $paymentDO]) + ->willReturn(null); + + $adapter->authorize($paymentInfo, 10); + } } From 3561b6614eeafb70cbcbf0dc0254359b857af3d4 Mon Sep 17 00:00:00 2001 From: mage2-team Date: Thu, 16 Jun 2016 16:20:59 +0000 Subject: [PATCH 345/345] MAGETWO-54330: Magento 2.1.0-rc3 Publication (build 2.1.0-rc3.011) --- .../Magento/AdminNotification/composer.json | 2 +- .../AdvancedPricingImportExport/composer.json | 2 +- app/code/Magento/Authorization/composer.json | 2 +- app/code/Magento/Authorizenet/composer.json | 2 +- app/code/Magento/Backend/composer.json | 2 +- app/code/Magento/Backup/composer.json | 2 +- app/code/Magento/Braintree/composer.json | 2 +- app/code/Magento/Bundle/composer.json | 2 +- .../Magento/BundleImportExport/composer.json | 2 +- .../Magento/CacheInvalidate/composer.json | 2 +- app/code/Magento/Captcha/composer.json | 2 +- app/code/Magento/Catalog/composer.json | 2 +- .../Magento/CatalogImportExport/composer.json | 2 +- .../Magento/CatalogInventory/composer.json | 2 +- app/code/Magento/CatalogRule/composer.json | 2 +- .../CatalogRuleConfigurable/composer.json | 2 +- app/code/Magento/CatalogSearch/composer.json | 2 +- .../Magento/CatalogUrlRewrite/composer.json | 2 +- app/code/Magento/CatalogWidget/composer.json | 2 +- app/code/Magento/Checkout/composer.json | 2 +- .../Magento/CheckoutAgreements/composer.json | 2 +- app/code/Magento/Cms/composer.json | 2 +- app/code/Magento/CmsUrlRewrite/composer.json | 2 +- app/code/Magento/Config/composer.json | 2 +- .../ConfigurableImportExport/composer.json | 2 +- .../Magento/ConfigurableProduct/composer.json | 2 +- app/code/Magento/Contact/composer.json | 2 +- app/code/Magento/Cookie/composer.json | 2 +- app/code/Magento/Cron/composer.json | 2 +- app/code/Magento/CurrencySymbol/composer.json | 2 +- app/code/Magento/Customer/composer.json | 2 +- .../CustomerImportExport/composer.json | 2 +- app/code/Magento/Deploy/composer.json | 2 +- app/code/Magento/Developer/composer.json | 2 +- app/code/Magento/Dhl/composer.json | 2 +- app/code/Magento/Directory/composer.json | 2 +- app/code/Magento/Downloadable/composer.json | 2 +- .../DownloadableImportExport/composer.json | 2 +- app/code/Magento/Eav/composer.json | 2 +- app/code/Magento/Email/composer.json | 2 +- app/code/Magento/EncryptionKey/composer.json | 2 +- app/code/Magento/Fedex/composer.json | 2 +- app/code/Magento/GiftMessage/composer.json | 2 +- app/code/Magento/GoogleAdwords/composer.json | 2 +- .../Magento/GoogleAnalytics/composer.json | 2 +- .../Magento/GoogleOptimizer/composer.json | 2 +- .../Magento/GroupedImportExport/composer.json | 2 +- app/code/Magento/GroupedProduct/composer.json | 2 +- app/code/Magento/ImportExport/composer.json | 2 +- app/code/Magento/Indexer/composer.json | 2 +- app/code/Magento/Integration/composer.json | 2 +- .../Magento/LayeredNavigation/composer.json | 2 +- app/code/Magento/Marketplace/composer.json | 2 +- app/code/Magento/MediaStorage/composer.json | 2 +- app/code/Magento/Msrp/composer.json | 2 +- app/code/Magento/Multishipping/composer.json | 2 +- .../Magento/NewRelicReporting/composer.json | 2 +- app/code/Magento/Newsletter/composer.json | 2 +- .../Magento/OfflinePayments/composer.json | 2 +- .../Magento/OfflineShipping/composer.json | 2 +- app/code/Magento/PageCache/composer.json | 2 +- app/code/Magento/Payment/composer.json | 2 +- app/code/Magento/Paypal/composer.json | 2 +- app/code/Magento/Persistent/composer.json | 2 +- app/code/Magento/ProductAlert/composer.json | 2 +- app/code/Magento/ProductVideo/composer.json | 2 +- app/code/Magento/Quote/composer.json | 2 +- app/code/Magento/Reports/composer.json | 2 +- app/code/Magento/RequireJs/composer.json | 2 +- app/code/Magento/Review/composer.json | 2 +- app/code/Magento/Rss/composer.json | 2 +- app/code/Magento/Rule/composer.json | 2 +- app/code/Magento/Sales/composer.json | 2 +- app/code/Magento/SalesRule/composer.json | 2 +- app/code/Magento/SalesSequence/composer.json | 2 +- app/code/Magento/SampleData/composer.json | 2 +- app/code/Magento/Search/composer.json | 2 +- app/code/Magento/Security/composer.json | 2 +- app/code/Magento/SendFriend/composer.json | 2 +- app/code/Magento/Shipping/composer.json | 2 +- app/code/Magento/Sitemap/composer.json | 2 +- app/code/Magento/Store/composer.json | 2 +- app/code/Magento/Swagger/composer.json | 2 +- app/code/Magento/Swatches/composer.json | 2 +- .../SwatchesLayeredNavigation/composer.json | 2 +- app/code/Magento/Tax/composer.json | 2 +- .../Magento/TaxImportExport/composer.json | 2 +- app/code/Magento/Theme/composer.json | 2 +- app/code/Magento/Translation/composer.json | 2 +- app/code/Magento/Ui/composer.json | 2 +- app/code/Magento/Ups/composer.json | 2 +- app/code/Magento/UrlRewrite/composer.json | 2 +- app/code/Magento/User/composer.json | 2 +- app/code/Magento/Usps/composer.json | 2 +- app/code/Magento/Variable/composer.json | 2 +- app/code/Magento/Vault/composer.json | 2 +- app/code/Magento/Version/composer.json | 2 +- app/code/Magento/Webapi/composer.json | 2 +- app/code/Magento/WebapiSecurity/composer.json | 2 +- app/code/Magento/Weee/composer.json | 2 +- app/code/Magento/Widget/composer.json | 2 +- app/code/Magento/Wishlist/composer.json | 2 +- .../adminhtml/Magento/backend/composer.json | 2 +- .../frontend/Magento/blank/composer.json | 2 +- .../frontend/Magento/luma/composer.json | 2 +- app/i18n/Magento/de_DE/composer.json | 2 +- app/i18n/Magento/en_US/composer.json | 2 +- app/i18n/Magento/es_ES/composer.json | 2 +- app/i18n/Magento/fr_FR/composer.json | 2 +- app/i18n/Magento/nl_NL/composer.json | 2 +- app/i18n/Magento/pt_BR/composer.json | 2 +- app/i18n/Magento/zh_Hans_CN/composer.json | 2 +- composer.json | 228 +++++++++--------- composer.lock | 26 +- lib/internal/Magento/Framework/composer.json | 2 +- 115 files changed, 240 insertions(+), 240 deletions(-) diff --git a/app/code/Magento/AdminNotification/composer.json b/app/code/Magento/AdminNotification/composer.json index 070d07a18ca2e..da3af598cbef9 100644 --- a/app/code/Magento/AdminNotification/composer.json +++ b/app/code/Magento/AdminNotification/composer.json @@ -10,7 +10,7 @@ "lib-libxml": "*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/AdvancedPricingImportExport/composer.json b/app/code/Magento/AdvancedPricingImportExport/composer.json index 697bcda1fb647..1ea83c278fb16 100644 --- a/app/code/Magento/AdvancedPricingImportExport/composer.json +++ b/app/code/Magento/AdvancedPricingImportExport/composer.json @@ -13,7 +13,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Authorization/composer.json b/app/code/Magento/Authorization/composer.json index cbd2fa4519cbb..27c4d0c1678ae 100644 --- a/app/code/Magento/Authorization/composer.json +++ b/app/code/Magento/Authorization/composer.json @@ -7,7 +7,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Authorizenet/composer.json b/app/code/Magento/Authorizenet/composer.json index c24f7b37c6574..711a0a28e9bbd 100644 --- a/app/code/Magento/Authorizenet/composer.json +++ b/app/code/Magento/Authorizenet/composer.json @@ -13,7 +13,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "proprietary" ], diff --git a/app/code/Magento/Backend/composer.json b/app/code/Magento/Backend/composer.json index a81ccb1cfa744..b30dafa376292 100644 --- a/app/code/Magento/Backend/composer.json +++ b/app/code/Magento/Backend/composer.json @@ -22,7 +22,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Backup/composer.json b/app/code/Magento/Backup/composer.json index 04aab3d4b40de..eb384a292b6be 100644 --- a/app/code/Magento/Backup/composer.json +++ b/app/code/Magento/Backup/composer.json @@ -9,7 +9,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Braintree/composer.json b/app/code/Magento/Braintree/composer.json index 6c74e5616dc07..8335eaa020fe1 100644 --- a/app/code/Magento/Braintree/composer.json +++ b/app/code/Magento/Braintree/composer.json @@ -23,7 +23,7 @@ "magento/module-checkout-agreements": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "proprietary" ], diff --git a/app/code/Magento/Bundle/composer.json b/app/code/Magento/Bundle/composer.json index d5f3b6d81ff25..1a638ef0945cb 100644 --- a/app/code/Magento/Bundle/composer.json +++ b/app/code/Magento/Bundle/composer.json @@ -25,7 +25,7 @@ "magento/module-bundle-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/BundleImportExport/composer.json b/app/code/Magento/BundleImportExport/composer.json index affa90b0e4e62..b6216f9a52a30 100644 --- a/app/code/Magento/BundleImportExport/composer.json +++ b/app/code/Magento/BundleImportExport/composer.json @@ -11,7 +11,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CacheInvalidate/composer.json b/app/code/Magento/CacheInvalidate/composer.json index 8b48cc51a3dd7..f555ce973808f 100644 --- a/app/code/Magento/CacheInvalidate/composer.json +++ b/app/code/Magento/CacheInvalidate/composer.json @@ -7,7 +7,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Captcha/composer.json b/app/code/Magento/Captcha/composer.json index 307696a7a1e38..9ed43851cc639 100644 --- a/app/code/Magento/Captcha/composer.json +++ b/app/code/Magento/Captcha/composer.json @@ -10,7 +10,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Catalog/composer.json b/app/code/Magento/Catalog/composer.json index 08a8c262d3286..c2d675e329c4a 100644 --- a/app/code/Magento/Catalog/composer.json +++ b/app/code/Magento/Catalog/composer.json @@ -33,7 +33,7 @@ "magento/module-catalog-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "101.0.0-rc2", + "version": "101.0.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CatalogImportExport/composer.json b/app/code/Magento/CatalogImportExport/composer.json index 15fa527a9369e..1da0421dcd5db 100644 --- a/app/code/Magento/CatalogImportExport/composer.json +++ b/app/code/Magento/CatalogImportExport/composer.json @@ -16,7 +16,7 @@ "ext-ctype": "*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CatalogInventory/composer.json b/app/code/Magento/CatalogInventory/composer.json index 05ad2bb3c441b..b8ed65fdc7697 100644 --- a/app/code/Magento/CatalogInventory/composer.json +++ b/app/code/Magento/CatalogInventory/composer.json @@ -13,7 +13,7 @@ "magento/module-ui": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CatalogRule/composer.json b/app/code/Magento/CatalogRule/composer.json index 8bbb51080924c..5d05a1fd08554 100644 --- a/app/code/Magento/CatalogRule/composer.json +++ b/app/code/Magento/CatalogRule/composer.json @@ -17,7 +17,7 @@ "magento/module-catalog-rule-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CatalogRuleConfigurable/composer.json b/app/code/Magento/CatalogRuleConfigurable/composer.json index 235d4c17f713e..7d64cec97960e 100644 --- a/app/code/Magento/CatalogRuleConfigurable/composer.json +++ b/app/code/Magento/CatalogRuleConfigurable/composer.json @@ -11,7 +11,7 @@ "magento/module-catalog-rule": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CatalogSearch/composer.json b/app/code/Magento/CatalogSearch/composer.json index 2b6cb71023c70..ba5166b91fb5a 100644 --- a/app/code/Magento/CatalogSearch/composer.json +++ b/app/code/Magento/CatalogSearch/composer.json @@ -15,7 +15,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CatalogUrlRewrite/composer.json b/app/code/Magento/CatalogUrlRewrite/composer.json index 4d5a496221f7d..ec7e6ee7e5c94 100644 --- a/app/code/Magento/CatalogUrlRewrite/composer.json +++ b/app/code/Magento/CatalogUrlRewrite/composer.json @@ -14,7 +14,7 @@ "magento/module-ui": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CatalogWidget/composer.json b/app/code/Magento/CatalogWidget/composer.json index 9c38a1afdac11..5ee4d326db49e 100644 --- a/app/code/Magento/CatalogWidget/composer.json +++ b/app/code/Magento/CatalogWidget/composer.json @@ -14,7 +14,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Checkout/composer.json b/app/code/Magento/Checkout/composer.json index 9708bab4a67ed..3ab661d5e6ddd 100644 --- a/app/code/Magento/Checkout/composer.json +++ b/app/code/Magento/Checkout/composer.json @@ -27,7 +27,7 @@ "magento/module-cookie": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CheckoutAgreements/composer.json b/app/code/Magento/CheckoutAgreements/composer.json index db78dec7bb826..a7accef3375b5 100644 --- a/app/code/Magento/CheckoutAgreements/composer.json +++ b/app/code/Magento/CheckoutAgreements/composer.json @@ -10,7 +10,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Cms/composer.json b/app/code/Magento/Cms/composer.json index b00f42c477cf6..69f7a777c494e 100644 --- a/app/code/Magento/Cms/composer.json +++ b/app/code/Magento/Cms/composer.json @@ -18,7 +18,7 @@ "magento/module-cms-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "101.0.0-rc2", + "version": "101.0.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CmsUrlRewrite/composer.json b/app/code/Magento/CmsUrlRewrite/composer.json index c118452faa000..8411c7506b104 100644 --- a/app/code/Magento/CmsUrlRewrite/composer.json +++ b/app/code/Magento/CmsUrlRewrite/composer.json @@ -9,7 +9,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Config/composer.json b/app/code/Magento/Config/composer.json index 4034d7f5d9060..cb87aebcf8c34 100644 --- a/app/code/Magento/Config/composer.json +++ b/app/code/Magento/Config/composer.json @@ -12,7 +12,7 @@ "magento/module-media-storage": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/ConfigurableImportExport/composer.json b/app/code/Magento/ConfigurableImportExport/composer.json index 8538d43b8bbdd..eaa3b817394cb 100644 --- a/app/code/Magento/ConfigurableImportExport/composer.json +++ b/app/code/Magento/ConfigurableImportExport/composer.json @@ -11,7 +11,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/ConfigurableProduct/composer.json b/app/code/Magento/ConfigurableProduct/composer.json index 9b98ea69919ab..d0e7a7857c719 100644 --- a/app/code/Magento/ConfigurableProduct/composer.json +++ b/app/code/Magento/ConfigurableProduct/composer.json @@ -23,7 +23,7 @@ "magento/module-product-links-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Contact/composer.json b/app/code/Magento/Contact/composer.json index 95e40aae651c3..9a03ef0cb9570 100644 --- a/app/code/Magento/Contact/composer.json +++ b/app/code/Magento/Contact/composer.json @@ -10,7 +10,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Cookie/composer.json b/app/code/Magento/Cookie/composer.json index 9dd0afe8e8716..80bbbe6b1c7cb 100644 --- a/app/code/Magento/Cookie/composer.json +++ b/app/code/Magento/Cookie/composer.json @@ -10,7 +10,7 @@ "magento/module-backend": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Cron/composer.json b/app/code/Magento/Cron/composer.json index fe98bca8a6d6f..6d1b83c2c8965 100644 --- a/app/code/Magento/Cron/composer.json +++ b/app/code/Magento/Cron/composer.json @@ -10,7 +10,7 @@ "magento/module-config": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CurrencySymbol/composer.json b/app/code/Magento/CurrencySymbol/composer.json index 2ea7f2b261695..0c5591f4315ce 100644 --- a/app/code/Magento/CurrencySymbol/composer.json +++ b/app/code/Magento/CurrencySymbol/composer.json @@ -11,7 +11,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Customer/composer.json b/app/code/Magento/Customer/composer.json index e59e64201fb84..be4ebfbf1b895 100644 --- a/app/code/Magento/Customer/composer.json +++ b/app/code/Magento/Customer/composer.json @@ -29,7 +29,7 @@ "magento/module-customer-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CustomerImportExport/composer.json b/app/code/Magento/CustomerImportExport/composer.json index 511159711c652..7047c15c26aa8 100644 --- a/app/code/Magento/CustomerImportExport/composer.json +++ b/app/code/Magento/CustomerImportExport/composer.json @@ -12,7 +12,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Deploy/composer.json b/app/code/Magento/Deploy/composer.json index 4e698f4a54f4b..339facf4404c9 100644 --- a/app/code/Magento/Deploy/composer.json +++ b/app/code/Magento/Deploy/composer.json @@ -10,7 +10,7 @@ "magento/module-user": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Developer/composer.json b/app/code/Magento/Developer/composer.json index 5dc17136f5360..2cb45a4c7acd3 100644 --- a/app/code/Magento/Developer/composer.json +++ b/app/code/Magento/Developer/composer.json @@ -7,7 +7,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Dhl/composer.json b/app/code/Magento/Dhl/composer.json index 28d835ec36e24..b2d106f3f2846 100644 --- a/app/code/Magento/Dhl/composer.json +++ b/app/code/Magento/Dhl/composer.json @@ -19,7 +19,7 @@ "magento/module-checkout": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Directory/composer.json b/app/code/Magento/Directory/composer.json index 054c7c4f92210..edc6e5cb72074 100644 --- a/app/code/Magento/Directory/composer.json +++ b/app/code/Magento/Directory/composer.json @@ -10,7 +10,7 @@ "lib-libxml": "*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Downloadable/composer.json b/app/code/Magento/Downloadable/composer.json index 05bc61a23683c..45c861e1f1de6 100644 --- a/app/code/Magento/Downloadable/composer.json +++ b/app/code/Magento/Downloadable/composer.json @@ -25,7 +25,7 @@ "magento/module-downloadable-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/DownloadableImportExport/composer.json b/app/code/Magento/DownloadableImportExport/composer.json index 033c128e8592e..7a40c258372e4 100644 --- a/app/code/Magento/DownloadableImportExport/composer.json +++ b/app/code/Magento/DownloadableImportExport/composer.json @@ -12,7 +12,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Eav/composer.json b/app/code/Magento/Eav/composer.json index a21b9b5ada1db..53af16ecea876 100644 --- a/app/code/Magento/Eav/composer.json +++ b/app/code/Magento/Eav/composer.json @@ -11,7 +11,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Email/composer.json b/app/code/Magento/Email/composer.json index 916c02fa0f5db..1a1b8a0a11779 100644 --- a/app/code/Magento/Email/composer.json +++ b/app/code/Magento/Email/composer.json @@ -11,7 +11,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/EncryptionKey/composer.json b/app/code/Magento/EncryptionKey/composer.json index 256e9fb17aa92..545f239feef3c 100644 --- a/app/code/Magento/EncryptionKey/composer.json +++ b/app/code/Magento/EncryptionKey/composer.json @@ -8,7 +8,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "proprietary" ], diff --git a/app/code/Magento/Fedex/composer.json b/app/code/Magento/Fedex/composer.json index 72b58f59db344..de17ea9da1300 100644 --- a/app/code/Magento/Fedex/composer.json +++ b/app/code/Magento/Fedex/composer.json @@ -15,7 +15,7 @@ "lib-libxml": "*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GiftMessage/composer.json b/app/code/Magento/GiftMessage/composer.json index e24d985833eb5..8658f9aca1c6d 100644 --- a/app/code/Magento/GiftMessage/composer.json +++ b/app/code/Magento/GiftMessage/composer.json @@ -17,7 +17,7 @@ "magento/module-multishipping": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GoogleAdwords/composer.json b/app/code/Magento/GoogleAdwords/composer.json index 6cba9380c8e0a..155aca7421635 100644 --- a/app/code/Magento/GoogleAdwords/composer.json +++ b/app/code/Magento/GoogleAdwords/composer.json @@ -8,7 +8,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GoogleAnalytics/composer.json b/app/code/Magento/GoogleAnalytics/composer.json index 1a6adfe147c89..b22d0f05b099c 100644 --- a/app/code/Magento/GoogleAnalytics/composer.json +++ b/app/code/Magento/GoogleAnalytics/composer.json @@ -9,7 +9,7 @@ "magento/module-cookie": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GoogleOptimizer/composer.json b/app/code/Magento/GoogleOptimizer/composer.json index 48392de36b1fd..3f955e55c972f 100644 --- a/app/code/Magento/GoogleOptimizer/composer.json +++ b/app/code/Magento/GoogleOptimizer/composer.json @@ -12,7 +12,7 @@ "magento/module-ui": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GroupedImportExport/composer.json b/app/code/Magento/GroupedImportExport/composer.json index 553d3a6760bad..115a375638001 100644 --- a/app/code/Magento/GroupedImportExport/composer.json +++ b/app/code/Magento/GroupedImportExport/composer.json @@ -11,7 +11,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GroupedProduct/composer.json b/app/code/Magento/GroupedProduct/composer.json index 31a687aeb456d..97d90a27f0baf 100644 --- a/app/code/Magento/GroupedProduct/composer.json +++ b/app/code/Magento/GroupedProduct/composer.json @@ -21,7 +21,7 @@ "magento/module-grouped-product-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/ImportExport/composer.json b/app/code/Magento/ImportExport/composer.json index 74d7e1a3e1e2b..1a1dd40751e0d 100644 --- a/app/code/Magento/ImportExport/composer.json +++ b/app/code/Magento/ImportExport/composer.json @@ -11,7 +11,7 @@ "ext-ctype": "*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Indexer/composer.json b/app/code/Magento/Indexer/composer.json index 4cf31f76c4cab..fce9b8707a824 100644 --- a/app/code/Magento/Indexer/composer.json +++ b/app/code/Magento/Indexer/composer.json @@ -7,7 +7,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Integration/composer.json b/app/code/Magento/Integration/composer.json index d07eb5d534cd0..3124129615965 100644 --- a/app/code/Magento/Integration/composer.json +++ b/app/code/Magento/Integration/composer.json @@ -12,7 +12,7 @@ "magento/module-authorization": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/LayeredNavigation/composer.json b/app/code/Magento/LayeredNavigation/composer.json index 0af8641518dae..b3944c1bf4db9 100644 --- a/app/code/Magento/LayeredNavigation/composer.json +++ b/app/code/Magento/LayeredNavigation/composer.json @@ -8,7 +8,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Marketplace/composer.json b/app/code/Magento/Marketplace/composer.json index 6596be3e2bba3..9774717133a0a 100644 --- a/app/code/Magento/Marketplace/composer.json +++ b/app/code/Magento/Marketplace/composer.json @@ -7,7 +7,7 @@ "magento/module-backend": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/MediaStorage/composer.json b/app/code/Magento/MediaStorage/composer.json index 3cb93349ed147..76479193889dc 100644 --- a/app/code/Magento/MediaStorage/composer.json +++ b/app/code/Magento/MediaStorage/composer.json @@ -9,7 +9,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Msrp/composer.json b/app/code/Magento/Msrp/composer.json index a82511b6a560d..79d3921cb21b9 100644 --- a/app/code/Magento/Msrp/composer.json +++ b/app/code/Magento/Msrp/composer.json @@ -16,7 +16,7 @@ "magento/module-msrp-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Multishipping/composer.json b/app/code/Magento/Multishipping/composer.json index 6275986675999..414383d5f67ae 100644 --- a/app/code/Magento/Multishipping/composer.json +++ b/app/code/Magento/Multishipping/composer.json @@ -14,7 +14,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/NewRelicReporting/composer.json b/app/code/Magento/NewRelicReporting/composer.json index 12e96865ff882..f565ab76fcbee 100644 --- a/app/code/Magento/NewRelicReporting/composer.json +++ b/app/code/Magento/NewRelicReporting/composer.json @@ -13,7 +13,7 @@ "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Newsletter/composer.json b/app/code/Magento/Newsletter/composer.json index ac8734adcade8..b57e43f75820f 100644 --- a/app/code/Magento/Newsletter/composer.json +++ b/app/code/Magento/Newsletter/composer.json @@ -15,7 +15,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/OfflinePayments/composer.json b/app/code/Magento/OfflinePayments/composer.json index d847481d8e12b..0de67e7861733 100644 --- a/app/code/Magento/OfflinePayments/composer.json +++ b/app/code/Magento/OfflinePayments/composer.json @@ -8,7 +8,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/OfflineShipping/composer.json b/app/code/Magento/OfflineShipping/composer.json index 25fe175e76a03..67fab5cdfd443 100644 --- a/app/code/Magento/OfflineShipping/composer.json +++ b/app/code/Magento/OfflineShipping/composer.json @@ -19,7 +19,7 @@ "magento/module-offline-shipping-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/PageCache/composer.json b/app/code/Magento/PageCache/composer.json index 87673dfab2113..f234c1741d9d1 100644 --- a/app/code/Magento/PageCache/composer.json +++ b/app/code/Magento/PageCache/composer.json @@ -9,7 +9,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Payment/composer.json b/app/code/Magento/Payment/composer.json index ac1f2de925279..4163c197a9f9c 100644 --- a/app/code/Magento/Payment/composer.json +++ b/app/code/Magento/Payment/composer.json @@ -12,7 +12,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Paypal/composer.json b/app/code/Magento/Paypal/composer.json index d8e1e0cdd101b..dd18c846f06ac 100644 --- a/app/code/Magento/Paypal/composer.json +++ b/app/code/Magento/Paypal/composer.json @@ -25,7 +25,7 @@ "magento/module-checkout-agreements": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "proprietary" ], diff --git a/app/code/Magento/Persistent/composer.json b/app/code/Magento/Persistent/composer.json index dc7f0db426e85..3abf890dec0d0 100644 --- a/app/code/Magento/Persistent/composer.json +++ b/app/code/Magento/Persistent/composer.json @@ -12,7 +12,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/ProductAlert/composer.json b/app/code/Magento/ProductAlert/composer.json index a183e4786a051..a93e8bdf3a117 100644 --- a/app/code/Magento/ProductAlert/composer.json +++ b/app/code/Magento/ProductAlert/composer.json @@ -10,7 +10,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/ProductVideo/composer.json b/app/code/Magento/ProductVideo/composer.json index 4c7a164bd433d..520d49447bda6 100644 --- a/app/code/Magento/ProductVideo/composer.json +++ b/app/code/Magento/ProductVideo/composer.json @@ -15,7 +15,7 @@ "magento/module-customer": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "proprietary" ], diff --git a/app/code/Magento/Quote/composer.json b/app/code/Magento/Quote/composer.json index cb4183ac26c15..f6156c070108d 100644 --- a/app/code/Magento/Quote/composer.json +++ b/app/code/Magento/Quote/composer.json @@ -20,7 +20,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Reports/composer.json b/app/code/Magento/Reports/composer.json index f34ab7d49a032..8a2a7c4113343 100644 --- a/app/code/Magento/Reports/composer.json +++ b/app/code/Magento/Reports/composer.json @@ -22,7 +22,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/RequireJs/composer.json b/app/code/Magento/RequireJs/composer.json index bbc6b38b47bff..44010ad5e9b56 100644 --- a/app/code/Magento/RequireJs/composer.json +++ b/app/code/Magento/RequireJs/composer.json @@ -6,7 +6,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Review/composer.json b/app/code/Magento/Review/composer.json index d5c7a4ac24437..dfb768ca9c5be 100644 --- a/app/code/Magento/Review/composer.json +++ b/app/code/Magento/Review/composer.json @@ -18,7 +18,7 @@ "magento/module-review-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Rss/composer.json b/app/code/Magento/Rss/composer.json index a53753ff06015..3ab149d273769 100644 --- a/app/code/Magento/Rss/composer.json +++ b/app/code/Magento/Rss/composer.json @@ -9,7 +9,7 @@ "magento/module-customer": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Rule/composer.json b/app/code/Magento/Rule/composer.json index 1587da684bdb5..5276bd45a6f8b 100644 --- a/app/code/Magento/Rule/composer.json +++ b/app/code/Magento/Rule/composer.json @@ -11,7 +11,7 @@ "lib-libxml": "*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Sales/composer.json b/app/code/Magento/Sales/composer.json index 45bb7e9961c1c..9a3142fb7a8e3 100644 --- a/app/code/Magento/Sales/composer.json +++ b/app/code/Magento/Sales/composer.json @@ -32,7 +32,7 @@ "magento/module-sales-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/SalesRule/composer.json b/app/code/Magento/SalesRule/composer.json index 9450bc0bb7f9d..86113b670157d 100644 --- a/app/code/Magento/SalesRule/composer.json +++ b/app/code/Magento/SalesRule/composer.json @@ -25,7 +25,7 @@ "magento/module-sales-rule-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/SalesSequence/composer.json b/app/code/Magento/SalesSequence/composer.json index 0967c2aa97230..c3de4d69849b3 100644 --- a/app/code/Magento/SalesSequence/composer.json +++ b/app/code/Magento/SalesSequence/composer.json @@ -6,7 +6,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/SampleData/composer.json b/app/code/Magento/SampleData/composer.json index 715a5acd2ecb0..117a02e8dea72 100644 --- a/app/code/Magento/SampleData/composer.json +++ b/app/code/Magento/SampleData/composer.json @@ -9,7 +9,7 @@ "magento/sample-data-media": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Search/composer.json b/app/code/Magento/Search/composer.json index e6ccc86ed527d..e484e76907967 100644 --- a/app/code/Magento/Search/composer.json +++ b/app/code/Magento/Search/composer.json @@ -11,7 +11,7 @@ "magento/module-ui": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Security/composer.json b/app/code/Magento/Security/composer.json index 7d1cf019e69e9..2dbe22ef8a1f6 100644 --- a/app/code/Magento/Security/composer.json +++ b/app/code/Magento/Security/composer.json @@ -11,7 +11,7 @@ "magento/module-customer": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/SendFriend/composer.json b/app/code/Magento/SendFriend/composer.json index 7e6b3a279a84a..bf4d2e5a71006 100644 --- a/app/code/Magento/SendFriend/composer.json +++ b/app/code/Magento/SendFriend/composer.json @@ -10,7 +10,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Shipping/composer.json b/app/code/Magento/Shipping/composer.json index 5f7207672e22d..22d7ddec9ae5a 100644 --- a/app/code/Magento/Shipping/composer.json +++ b/app/code/Magento/Shipping/composer.json @@ -24,7 +24,7 @@ "magento/module-ups": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Sitemap/composer.json b/app/code/Magento/Sitemap/composer.json index 0df8d8028b9fc..44d8a9e019f27 100644 --- a/app/code/Magento/Sitemap/composer.json +++ b/app/code/Magento/Sitemap/composer.json @@ -13,7 +13,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Store/composer.json b/app/code/Magento/Store/composer.json index 0dec1eb25e1ca..e200c861518bb 100644 --- a/app/code/Magento/Store/composer.json +++ b/app/code/Magento/Store/composer.json @@ -11,7 +11,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Swagger/composer.json b/app/code/Magento/Swagger/composer.json index fdfc69eb52e03..f7a23b19624c4 100644 --- a/app/code/Magento/Swagger/composer.json +++ b/app/code/Magento/Swagger/composer.json @@ -6,7 +6,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Swatches/composer.json b/app/code/Magento/Swatches/composer.json index 510ec4146b207..39043080d631f 100644 --- a/app/code/Magento/Swatches/composer.json +++ b/app/code/Magento/Swatches/composer.json @@ -19,7 +19,7 @@ "magento/module-swatches-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "proprietary" ], diff --git a/app/code/Magento/SwatchesLayeredNavigation/composer.json b/app/code/Magento/SwatchesLayeredNavigation/composer.json index f36ca50c707b5..bed83949d290a 100644 --- a/app/code/Magento/SwatchesLayeredNavigation/composer.json +++ b/app/code/Magento/SwatchesLayeredNavigation/composer.json @@ -7,7 +7,7 @@ "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Tax/composer.json b/app/code/Magento/Tax/composer.json index abda1fcc6dd2b..b8443f4660fca 100644 --- a/app/code/Magento/Tax/composer.json +++ b/app/code/Magento/Tax/composer.json @@ -22,7 +22,7 @@ "magento/module-tax-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/TaxImportExport/composer.json b/app/code/Magento/TaxImportExport/composer.json index 9547df428c0c4..06e8bdeda96a3 100644 --- a/app/code/Magento/TaxImportExport/composer.json +++ b/app/code/Magento/TaxImportExport/composer.json @@ -10,7 +10,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Theme/composer.json b/app/code/Magento/Theme/composer.json index 0585d2af124aa..5488593f81721 100644 --- a/app/code/Magento/Theme/composer.json +++ b/app/code/Magento/Theme/composer.json @@ -21,7 +21,7 @@ "magento/module-theme-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Translation/composer.json b/app/code/Magento/Translation/composer.json index 660c42ece68e4..565fe3ac105de 100644 --- a/app/code/Magento/Translation/composer.json +++ b/app/code/Magento/Translation/composer.json @@ -10,7 +10,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Ui/composer.json b/app/code/Magento/Ui/composer.json index adaac86313c83..0ae95a27fc2df 100644 --- a/app/code/Magento/Ui/composer.json +++ b/app/code/Magento/Ui/composer.json @@ -10,7 +10,7 @@ "magento/module-user": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Ups/composer.json b/app/code/Magento/Ups/composer.json index f1e353acdd19d..468eb4517e6a8 100644 --- a/app/code/Magento/Ups/composer.json +++ b/app/code/Magento/Ups/composer.json @@ -13,7 +13,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/UrlRewrite/composer.json b/app/code/Magento/UrlRewrite/composer.json index 5b3ff66a05bf5..4b7c4b7179e98 100644 --- a/app/code/Magento/UrlRewrite/composer.json +++ b/app/code/Magento/UrlRewrite/composer.json @@ -12,7 +12,7 @@ "magento/module-cms-url-rewrite": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/User/composer.json b/app/code/Magento/User/composer.json index 8904621c6abc6..0abd709a28191 100644 --- a/app/code/Magento/User/composer.json +++ b/app/code/Magento/User/composer.json @@ -12,7 +12,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Usps/composer.json b/app/code/Magento/Usps/composer.json index 5a58d96524e8d..595cf8e07764d 100644 --- a/app/code/Magento/Usps/composer.json +++ b/app/code/Magento/Usps/composer.json @@ -15,7 +15,7 @@ "lib-libxml": "*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Variable/composer.json b/app/code/Magento/Variable/composer.json index b1352dcd57184..3dd799e458ca4 100644 --- a/app/code/Magento/Variable/composer.json +++ b/app/code/Magento/Variable/composer.json @@ -9,7 +9,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Vault/composer.json b/app/code/Magento/Vault/composer.json index 1ee9ebf1b2bcb..41c6e2372d4ea 100644 --- a/app/code/Magento/Vault/composer.json +++ b/app/code/Magento/Vault/composer.json @@ -13,7 +13,7 @@ "magento/module-theme": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "proprietary" ], diff --git a/app/code/Magento/Version/composer.json b/app/code/Magento/Version/composer.json index 4ffb25010748f..de0e167e3c684 100644 --- a/app/code/Magento/Version/composer.json +++ b/app/code/Magento/Version/composer.json @@ -6,7 +6,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Webapi/composer.json b/app/code/Magento/Webapi/composer.json index 8694979c9f6e3..4e1745319699d 100644 --- a/app/code/Magento/Webapi/composer.json +++ b/app/code/Magento/Webapi/composer.json @@ -13,7 +13,7 @@ "magento/module-user": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/WebapiSecurity/composer.json b/app/code/Magento/WebapiSecurity/composer.json index 31c6a1693f41e..4e7eebc07bf02 100644 --- a/app/code/Magento/WebapiSecurity/composer.json +++ b/app/code/Magento/WebapiSecurity/composer.json @@ -7,7 +7,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Weee/composer.json b/app/code/Magento/Weee/composer.json index bd4e0ec706736..fdb0643a75161 100644 --- a/app/code/Magento/Weee/composer.json +++ b/app/code/Magento/Weee/composer.json @@ -18,7 +18,7 @@ "magento/module-ui": "100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Widget/composer.json b/app/code/Magento/Widget/composer.json index 5530c938889a3..e26e2a682b88d 100644 --- a/app/code/Magento/Widget/composer.json +++ b/app/code/Magento/Widget/composer.json @@ -16,7 +16,7 @@ "magento/module-widget-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Wishlist/composer.json b/app/code/Magento/Wishlist/composer.json index acd436b4980cc..07da9dae4ac00 100644 --- a/app/code/Magento/Wishlist/composer.json +++ b/app/code/Magento/Wishlist/composer.json @@ -24,7 +24,7 @@ "magento/module-wishlist-sample-data": "Sample Data version:100.1.*" }, "type": "magento2-module", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/design/adminhtml/Magento/backend/composer.json b/app/design/adminhtml/Magento/backend/composer.json index 54d99e039be98..687f10da0f3c3 100644 --- a/app/design/adminhtml/Magento/backend/composer.json +++ b/app/design/adminhtml/Magento/backend/composer.json @@ -6,7 +6,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-theme", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/design/frontend/Magento/blank/composer.json b/app/design/frontend/Magento/blank/composer.json index fed7cca6146ce..52f1d3a18c0ff 100644 --- a/app/design/frontend/Magento/blank/composer.json +++ b/app/design/frontend/Magento/blank/composer.json @@ -6,7 +6,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-theme", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/design/frontend/Magento/luma/composer.json b/app/design/frontend/Magento/luma/composer.json index 57caf813b7821..1ce17ea3ce40d 100644 --- a/app/design/frontend/Magento/luma/composer.json +++ b/app/design/frontend/Magento/luma/composer.json @@ -7,7 +7,7 @@ "magento/framework": "100.1.*" }, "type": "magento2-theme", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/i18n/Magento/de_DE/composer.json b/app/i18n/Magento/de_DE/composer.json index ee969e5402925..d825d401ba4db 100644 --- a/app/i18n/Magento/de_DE/composer.json +++ b/app/i18n/Magento/de_DE/composer.json @@ -1,7 +1,7 @@ { "name": "magento/language-de_de", "description": "German (Germany) language", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/i18n/Magento/en_US/composer.json b/app/i18n/Magento/en_US/composer.json index 8329fc1dc9861..690d13a96839d 100644 --- a/app/i18n/Magento/en_US/composer.json +++ b/app/i18n/Magento/en_US/composer.json @@ -1,7 +1,7 @@ { "name": "magento/language-en_us", "description": "English (United States) language", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/i18n/Magento/es_ES/composer.json b/app/i18n/Magento/es_ES/composer.json index 3e8b1aa125692..ac591deb80702 100644 --- a/app/i18n/Magento/es_ES/composer.json +++ b/app/i18n/Magento/es_ES/composer.json @@ -1,7 +1,7 @@ { "name": "magento/language-es_es", "description": "Spanish (Spain) language", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/i18n/Magento/fr_FR/composer.json b/app/i18n/Magento/fr_FR/composer.json index d2f8c03440f67..ffa28551a3e5c 100644 --- a/app/i18n/Magento/fr_FR/composer.json +++ b/app/i18n/Magento/fr_FR/composer.json @@ -1,7 +1,7 @@ { "name": "magento/language-fr_fr", "description": "French (France) language", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/i18n/Magento/nl_NL/composer.json b/app/i18n/Magento/nl_NL/composer.json index e322b7fcf23a3..a982cd57ba310 100644 --- a/app/i18n/Magento/nl_NL/composer.json +++ b/app/i18n/Magento/nl_NL/composer.json @@ -1,7 +1,7 @@ { "name": "magento/language-nl_nl", "description": "Dutch (Netherlands) language", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/i18n/Magento/pt_BR/composer.json b/app/i18n/Magento/pt_BR/composer.json index 40d903e957683..5237281b65faa 100644 --- a/app/i18n/Magento/pt_BR/composer.json +++ b/app/i18n/Magento/pt_BR/composer.json @@ -1,7 +1,7 @@ { "name": "magento/language-pt_br", "description": "Portuguese (Brazil) language", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/i18n/Magento/zh_Hans_CN/composer.json b/app/i18n/Magento/zh_Hans_CN/composer.json index 24f1c220c20ff..742ff62e717ba 100644 --- a/app/i18n/Magento/zh_Hans_CN/composer.json +++ b/app/i18n/Magento/zh_Hans_CN/composer.json @@ -1,7 +1,7 @@ { "name": "magento/language-zh_hans_cn", "description": "Chinese (China) language", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/composer.json b/composer.json index 708f4089454a7..99ca06cfcc36f 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "magento/magento2ce", "description": "Magento 2 (Community Edition)", "type": "project", - "version": "2.1.0-rc2", + "version": "2.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0" @@ -76,119 +76,119 @@ "sebastian/phpcpd": "2.0.0" }, "replace": { - "magento/module-marketplace": "100.1.0-rc2", - "magento/module-admin-notification": "100.1.0-rc2", - "magento/module-advanced-pricing-import-export": "100.1.0-rc2", - "magento/module-authorization": "100.1.0-rc2", - "magento/module-authorizenet": "100.1.0-rc2", - "magento/module-backend": "100.1.0-rc2", - "magento/module-backup": "100.1.0-rc2", - "magento/module-braintree": "100.1.0-rc2", - "magento/module-bundle": "100.1.0-rc2", - "magento/module-bundle-import-export": "100.1.0-rc2", - "magento/module-cache-invalidate": "100.1.0-rc2", - "magento/module-captcha": "100.1.0-rc2", - "magento/module-catalog": "101.0.0-rc2", - "magento/module-catalog-import-export": "100.1.0-rc2", - "magento/module-catalog-inventory": "100.1.0-rc2", - "magento/module-catalog-rule": "100.1.0-rc2", - "magento/module-catalog-rule-configurable": "100.1.0-rc2", - "magento/module-catalog-search": "100.1.0-rc2", - "magento/module-catalog-url-rewrite": "100.1.0-rc2", - "magento/module-catalog-widget": "100.1.0-rc2", - "magento/module-checkout": "100.1.0-rc2", - "magento/module-checkout-agreements": "100.1.0-rc2", - "magento/module-cms": "101.0.0-rc2", - "magento/module-cms-url-rewrite": "100.1.0-rc2", - "magento/module-config": "100.1.0-rc2", - "magento/module-configurable-import-export": "100.1.0-rc2", - "magento/module-configurable-product": "100.1.0-rc2", - "magento/module-contact": "100.1.0-rc2", - "magento/module-cookie": "100.1.0-rc2", - "magento/module-cron": "100.1.0-rc2", - "magento/module-currency-symbol": "100.1.0-rc2", - "magento/module-customer": "100.1.0-rc2", - "magento/module-customer-import-export": "100.1.0-rc2", - "magento/module-deploy": "100.1.0-rc2", - "magento/module-developer": "100.1.0-rc2", - "magento/module-dhl": "100.1.0-rc2", - "magento/module-directory": "100.1.0-rc2", - "magento/module-downloadable": "100.1.0-rc2", - "magento/module-downloadable-import-export": "100.1.0-rc2", - "magento/module-eav": "100.1.0-rc2", - "magento/module-email": "100.1.0-rc2", - "magento/module-encryption-key": "100.1.0-rc2", - "magento/module-fedex": "100.1.0-rc2", - "magento/module-gift-message": "100.1.0-rc2", - "magento/module-google-adwords": "100.1.0-rc2", - "magento/module-google-analytics": "100.1.0-rc2", - "magento/module-google-optimizer": "100.1.0-rc2", - "magento/module-grouped-import-export": "100.1.0-rc2", - "magento/module-grouped-product": "100.1.0-rc2", - "magento/module-import-export": "100.1.0-rc2", - "magento/module-indexer": "100.1.0-rc2", - "magento/module-integration": "100.1.0-rc2", - "magento/module-layered-navigation": "100.1.0-rc2", - "magento/module-media-storage": "100.1.0-rc2", - "magento/module-msrp": "100.1.0-rc2", - "magento/module-multishipping": "100.1.0-rc2", - "magento/module-new-relic-reporting": "100.1.0-rc2", - "magento/module-newsletter": "100.1.0-rc2", - "magento/module-offline-payments": "100.1.0-rc2", - "magento/module-offline-shipping": "100.1.0-rc2", - "magento/module-page-cache": "100.1.0-rc2", - "magento/module-payment": "100.1.0-rc2", - "magento/module-paypal": "100.1.0-rc2", - "magento/module-persistent": "100.1.0-rc2", - "magento/module-product-alert": "100.1.0-rc2", - "magento/module-product-video": "100.1.0-rc2", - "magento/module-quote": "100.1.0-rc2", - "magento/module-reports": "100.1.0-rc2", - "magento/module-require-js": "100.1.0-rc2", - "magento/module-review": "100.1.0-rc2", - "magento/module-rss": "100.1.0-rc2", - "magento/module-rule": "100.1.0-rc2", - "magento/module-sales": "100.1.0-rc2", - "magento/module-sales-rule": "100.1.0-rc2", - "magento/module-sales-sequence": "100.1.0-rc2", - "magento/module-sample-data": "100.1.0-rc2", - "magento/module-search": "100.1.0-rc2", - "magento/module-security": "100.1.0-rc2", - "magento/module-send-friend": "100.1.0-rc2", - "magento/module-shipping": "100.1.0-rc2", - "magento/module-sitemap": "100.1.0-rc2", - "magento/module-store": "100.1.0-rc2", - "magento/module-swagger": "100.1.0-rc2", - "magento/module-swatches": "100.1.0-rc2", - "magento/module-swatches-layered-navigation": "100.1.0-rc2", - "magento/module-tax": "100.1.0-rc2", - "magento/module-tax-import-export": "100.1.0-rc2", - "magento/module-theme": "100.1.0-rc2", - "magento/module-translation": "100.1.0-rc2", - "magento/module-ui": "100.1.0-rc2", - "magento/module-ups": "100.1.0-rc2", - "magento/module-url-rewrite": "100.1.0-rc2", - "magento/module-user": "100.1.0-rc2", - "magento/module-usps": "100.1.0-rc2", - "magento/module-variable": "100.1.0-rc2", - "magento/module-vault": "100.1.0-rc2", - "magento/module-version": "100.1.0-rc2", - "magento/module-webapi": "100.1.0-rc2", - "magento/module-webapi-security": "100.1.0-rc2", - "magento/module-weee": "100.1.0-rc2", - "magento/module-widget": "100.1.0-rc2", - "magento/module-wishlist": "100.1.0-rc2", - "magento/theme-adminhtml-backend": "100.1.0-rc2", - "magento/theme-frontend-blank": "100.1.0-rc2", - "magento/theme-frontend-luma": "100.1.0-rc2", - "magento/language-de_de": "100.1.0-rc2", - "magento/language-en_us": "100.1.0-rc2", - "magento/language-es_es": "100.1.0-rc2", - "magento/language-fr_fr": "100.1.0-rc2", - "magento/language-nl_nl": "100.1.0-rc2", - "magento/language-pt_br": "100.1.0-rc2", - "magento/language-zh_hans_cn": "100.1.0-rc2", - "magento/framework": "100.1.0-rc2", + "magento/module-marketplace": "100.1.0-rc3", + "magento/module-admin-notification": "100.1.0-rc3", + "magento/module-advanced-pricing-import-export": "100.1.0-rc3", + "magento/module-authorization": "100.1.0-rc3", + "magento/module-authorizenet": "100.1.0-rc3", + "magento/module-backend": "100.1.0-rc3", + "magento/module-backup": "100.1.0-rc3", + "magento/module-braintree": "100.1.0-rc3", + "magento/module-bundle": "100.1.0-rc3", + "magento/module-bundle-import-export": "100.1.0-rc3", + "magento/module-cache-invalidate": "100.1.0-rc3", + "magento/module-captcha": "100.1.0-rc3", + "magento/module-catalog": "101.0.0-rc3", + "magento/module-catalog-import-export": "100.1.0-rc3", + "magento/module-catalog-inventory": "100.1.0-rc3", + "magento/module-catalog-rule": "100.1.0-rc3", + "magento/module-catalog-rule-configurable": "100.1.0-rc3", + "magento/module-catalog-search": "100.1.0-rc3", + "magento/module-catalog-url-rewrite": "100.1.0-rc3", + "magento/module-catalog-widget": "100.1.0-rc3", + "magento/module-checkout": "100.1.0-rc3", + "magento/module-checkout-agreements": "100.1.0-rc3", + "magento/module-cms": "101.0.0-rc3", + "magento/module-cms-url-rewrite": "100.1.0-rc3", + "magento/module-config": "100.1.0-rc3", + "magento/module-configurable-import-export": "100.1.0-rc3", + "magento/module-configurable-product": "100.1.0-rc3", + "magento/module-contact": "100.1.0-rc3", + "magento/module-cookie": "100.1.0-rc3", + "magento/module-cron": "100.1.0-rc3", + "magento/module-currency-symbol": "100.1.0-rc3", + "magento/module-customer": "100.1.0-rc3", + "magento/module-customer-import-export": "100.1.0-rc3", + "magento/module-deploy": "100.1.0-rc3", + "magento/module-developer": "100.1.0-rc3", + "magento/module-dhl": "100.1.0-rc3", + "magento/module-directory": "100.1.0-rc3", + "magento/module-downloadable": "100.1.0-rc3", + "magento/module-downloadable-import-export": "100.1.0-rc3", + "magento/module-eav": "100.1.0-rc3", + "magento/module-email": "100.1.0-rc3", + "magento/module-encryption-key": "100.1.0-rc3", + "magento/module-fedex": "100.1.0-rc3", + "magento/module-gift-message": "100.1.0-rc3", + "magento/module-google-adwords": "100.1.0-rc3", + "magento/module-google-analytics": "100.1.0-rc3", + "magento/module-google-optimizer": "100.1.0-rc3", + "magento/module-grouped-import-export": "100.1.0-rc3", + "magento/module-grouped-product": "100.1.0-rc3", + "magento/module-import-export": "100.1.0-rc3", + "magento/module-indexer": "100.1.0-rc3", + "magento/module-integration": "100.1.0-rc3", + "magento/module-layered-navigation": "100.1.0-rc3", + "magento/module-media-storage": "100.1.0-rc3", + "magento/module-msrp": "100.1.0-rc3", + "magento/module-multishipping": "100.1.0-rc3", + "magento/module-new-relic-reporting": "100.1.0-rc3", + "magento/module-newsletter": "100.1.0-rc3", + "magento/module-offline-payments": "100.1.0-rc3", + "magento/module-offline-shipping": "100.1.0-rc3", + "magento/module-page-cache": "100.1.0-rc3", + "magento/module-payment": "100.1.0-rc3", + "magento/module-paypal": "100.1.0-rc3", + "magento/module-persistent": "100.1.0-rc3", + "magento/module-product-alert": "100.1.0-rc3", + "magento/module-product-video": "100.1.0-rc3", + "magento/module-quote": "100.1.0-rc3", + "magento/module-reports": "100.1.0-rc3", + "magento/module-require-js": "100.1.0-rc3", + "magento/module-review": "100.1.0-rc3", + "magento/module-rss": "100.1.0-rc3", + "magento/module-rule": "100.1.0-rc3", + "magento/module-sales": "100.1.0-rc3", + "magento/module-sales-rule": "100.1.0-rc3", + "magento/module-sales-sequence": "100.1.0-rc3", + "magento/module-sample-data": "100.1.0-rc3", + "magento/module-search": "100.1.0-rc3", + "magento/module-security": "100.1.0-rc3", + "magento/module-send-friend": "100.1.0-rc3", + "magento/module-shipping": "100.1.0-rc3", + "magento/module-sitemap": "100.1.0-rc3", + "magento/module-store": "100.1.0-rc3", + "magento/module-swagger": "100.1.0-rc3", + "magento/module-swatches": "100.1.0-rc3", + "magento/module-swatches-layered-navigation": "100.1.0-rc3", + "magento/module-tax": "100.1.0-rc3", + "magento/module-tax-import-export": "100.1.0-rc3", + "magento/module-theme": "100.1.0-rc3", + "magento/module-translation": "100.1.0-rc3", + "magento/module-ui": "100.1.0-rc3", + "magento/module-ups": "100.1.0-rc3", + "magento/module-url-rewrite": "100.1.0-rc3", + "magento/module-user": "100.1.0-rc3", + "magento/module-usps": "100.1.0-rc3", + "magento/module-variable": "100.1.0-rc3", + "magento/module-vault": "100.1.0-rc3", + "magento/module-version": "100.1.0-rc3", + "magento/module-webapi": "100.1.0-rc3", + "magento/module-webapi-security": "100.1.0-rc3", + "magento/module-weee": "100.1.0-rc3", + "magento/module-widget": "100.1.0-rc3", + "magento/module-wishlist": "100.1.0-rc3", + "magento/theme-adminhtml-backend": "100.1.0-rc3", + "magento/theme-frontend-blank": "100.1.0-rc3", + "magento/theme-frontend-luma": "100.1.0-rc3", + "magento/language-de_de": "100.1.0-rc3", + "magento/language-en_us": "100.1.0-rc3", + "magento/language-es_es": "100.1.0-rc3", + "magento/language-fr_fr": "100.1.0-rc3", + "magento/language-nl_nl": "100.1.0-rc3", + "magento/language-pt_br": "100.1.0-rc3", + "magento/language-zh_hans_cn": "100.1.0-rc3", + "magento/framework": "100.1.0-rc3", "trentrichardson/jquery-timepicker-addon": "1.4.3", "components/jquery": "1.11.0", "blueimp/jquery-file-upload": "5.6.14", diff --git a/composer.lock b/composer.lock index 7831e25162f52..2e8152cead3d4 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "4aadd259bcd32c913113b3d9e5002543", - "content-hash": "cdd9bfe776bcf1291c819122d3cbc6b1", + "hash": "8114045a50044c8b4874d3921e3efb90", + "content-hash": "bc7a9b24a0ff7c6684734a215a73c0b3", "packages": [ { "name": "braintree/braintree_php", @@ -554,16 +554,16 @@ }, { "name": "magento/magento-composer-installer", - "version": "0.1.10", + "version": "0.1.11", "source": { "type": "git", "url": "https://github.com/magento/magento-composer-installer.git", - "reference": "29df8c84494e3592cf999d9cbadf15220a003ff1" + "reference": "a12b9577cd9859af67d2365ae38d23ddfc57cf4d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/magento/magento-composer-installer/zipball/29df8c84494e3592cf999d9cbadf15220a003ff1", - "reference": "29df8c84494e3592cf999d9cbadf15220a003ff1", + "url": "https://api.github.com/repos/magento/magento-composer-installer/zipball/a12b9577cd9859af67d2365ae38d23ddfc57cf4d", + "reference": "a12b9577cd9859af67d2365ae38d23ddfc57cf4d", "shasum": "" }, "require": { @@ -629,7 +629,7 @@ "composer-installer", "magento" ], - "time": "2016-06-10 16:59:12" + "time": "2016-06-15 04:02:25" }, { "name": "magento/zendframework1", @@ -1362,7 +1362,7 @@ }, { "name": "symfony/finder", - "version": "v3.1.0", + "version": "v3.1.1", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", @@ -4304,16 +4304,16 @@ }, { "name": "symfony/stopwatch", - "version": "v3.1.0", + "version": "v3.1.1", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "4670f122fa32a4900003a6802f6b8575f3f0b17e" + "reference": "e7238f98c90b99e9b53f3674a91757228663b04d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/4670f122fa32a4900003a6802f6b8575f3f0b17e", - "reference": "4670f122fa32a4900003a6802f6b8575f3f0b17e", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/e7238f98c90b99e9b53f3674a91757228663b04d", + "reference": "e7238f98c90b99e9b53f3674a91757228663b04d", "shasum": "" }, "require": { @@ -4349,7 +4349,7 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2016-03-04 07:56:56" + "time": "2016-06-06 11:42:41" }, { "name": "symfony/yaml", diff --git a/lib/internal/Magento/Framework/composer.json b/lib/internal/Magento/Framework/composer.json index 1d87d92819420..76eca4b9744b5 100644 --- a/lib/internal/Magento/Framework/composer.json +++ b/lib/internal/Magento/Framework/composer.json @@ -2,7 +2,7 @@ "name": "magento/framework", "description": "N/A", "type": "magento2-library", - "version": "100.1.0-rc2", + "version": "100.1.0-rc3", "license": [ "OSL-3.0", "AFL-3.0"