diff --git a/README.md b/README.md index 1dd81a7eed27250fcebe0720c3a5ebdf3994ab8e..c72357db26d16847c5fff1cfb7c6c93af44eae29 100644 --- a/README.md +++ b/README.md @@ -5,13 +5,13 @@ Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a cutting edge, feature-rich eCommerce solution that gets results. ## Magento system requirements -[Magento system requirements](http://devdocs.magento.com/magento-system-requirements.html) +[Magento system requirements](http://devdocs.magento.com/guides/v2.2/install-gde/system-requirements2.html) ## Install Magento To install Magento, see either: * [Magento DevBox](https://magento.com/tech-resources/download), the easiest way to get started with Magento. -* [Installation guide](http://devdocs.magento.com/guides/v2.0/install-gde/bk-install-guide.html) +* [Installation guide](http://devdocs.magento.com/guides/v2.2/install-gde/bk-install-guide.html) <h2>Contributing to the Magento 2 code base</h2> Contributions can take the form of new components or features, changes to existing features, tests, documentation (such as developer guides, user guides, examples, or specifications), bug fixes, optimizations, or just good suggestions. @@ -22,8 +22,8 @@ To learn about issues, click [here][2]. To open an issue, click [here][3]. To suggest documentation improvements, click [here][4]. -[1]: <http://devdocs.magento.com/guides/v2.0/contributor-guide/contributing.html> -[2]: <http://devdocs.magento.com/guides/v2.0/contributor-guide/contributing.html#report> +[1]: <http://devdocs.magento.com/guides/v2.2/contributor-guide/contributing.html> +[2]: <http://devdocs.magento.com/guides/v2.2/contributor-guide/contributing.html#report> [3]: <https://github.com/magento/magento2/issues> [4]: <http://devdocs.magento.com> diff --git a/app/code/Magento/Backup/Model/Db.php b/app/code/Magento/Backup/Model/Db.php index 98b04149cc7ead396c968b09168a6a319402846b..8fbd5da1c98425a59fd9336e30a731f9786bce8e 100644 --- a/app/code/Magento/Backup/Model/Db.php +++ b/app/code/Magento/Backup/Model/Db.php @@ -154,7 +154,7 @@ class Db implements \Magento\Framework\Backup\Db\BackupDbInterface if ($tableStatus->getDataLength() > self::BUFFER_LENGTH) { if ($tableStatus->getAvgRowLength() < self::BUFFER_LENGTH) { - $limit = floor(self::BUFFER_LENGTH / $tableStatus->getAvgRowLength()); + $limit = floor(self::BUFFER_LENGTH / max($tableStatus->getAvgRowLength(), 1)); $multiRowsLength = ceil($tableStatus->getRows() / $limit); } else { $limit = 1; diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php index 6f8a45c6ac7ed75a13026f6a5d9dc0696cf1cedd..a5b6b34d324f7ea0fe4d3648cec5521ec5e1d6e1 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php @@ -228,7 +228,7 @@ class Tree extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory public function getLoadTreeUrl($expanded = null) { $params = ['_current' => true, 'id' => null, 'store' => null]; - if (is_null($expanded) && $this->_backendSession->getIsTreeWasExpanded() || $expanded == true) { + if ($expanded === null && $this->_backendSession->getIsTreeWasExpanded() || $expanded == true) { $params['expand_all'] = true; } return $this->getUrl('*/*/categoriesJson', $params); diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Option.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Option.php index 64856a5c69dc7392146dc72acc27b35942cd07e0..339239ea491e091504e9ba8604ecd5b0e9468af1 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Option.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Option.php @@ -313,9 +313,9 @@ class Option extends Widget $value['checkboxScopeTitle'] = $this->getCheckboxScopeHtml( $option->getOptionId(), 'title', - is_null($option->getStoreTitle()) + $option->getStoreTitle() === null ); - $value['scopeTitleDisabled'] = is_null($option->getStoreTitle()) ? 'disabled' : null; + $value['scopeTitleDisabled'] = $option->getStoreTitle() === null ? 'disabled' : null; } if ($option->getGroupByType() == ProductCustomOptionInterface::OPTION_GROUP_SELECT) { @@ -341,22 +341,22 @@ class Option extends Widget $value['optionValues'][$i]['checkboxScopeTitle'] = $this->getCheckboxScopeHtml( $_value->getOptionId(), 'title', - is_null($_value->getStoreTitle()), + $_value->getStoreTitle() === null, $_value->getOptionTypeId() ); - $value['optionValues'][$i]['scopeTitleDisabled'] = is_null( - $_value->getStoreTitle() + $value['optionValues'][$i]['scopeTitleDisabled'] = ( + $_value->getStoreTitle() === null ) ? 'disabled' : null; if ($scope == \Magento\Store\Model\Store::PRICE_SCOPE_WEBSITE) { $value['optionValues'][$i]['checkboxScopePrice'] = $this->getCheckboxScopeHtml( $_value->getOptionId(), 'price', - is_null($_value->getstorePrice()), + $_value->getstorePrice() === null, $_value->getOptionTypeId(), ['$(this).up(1).previous()'] ); - $value['optionValues'][$i]['scopePriceDisabled'] = is_null( - $_value->getStorePrice() + $value['optionValues'][$i]['scopePriceDisabled'] = ( + $_value->getStorePrice() === null ) ? 'disabled' : null; } } @@ -379,9 +379,9 @@ class Option extends Widget $value['checkboxScopePrice'] = $this->getCheckboxScopeHtml( $option->getOptionId(), 'price', - is_null($option->getStorePrice()) + $option->getStorePrice() === null ); - $value['scopePriceDisabled'] = is_null($option->getStorePrice()) ? 'disabled' : null; + $value['scopePriceDisabled'] = $option->getStorePrice() === null ? 'disabled' : null; } } $values[] = new \Magento\Framework\DataObject($value); diff --git a/app/code/Magento/Catalog/Block/Product/ProductList/Related.php b/app/code/Magento/Catalog/Block/Product/ProductList/Related.php index 95d9b1ae612088146de159c28e769af4e75fbd17..3f9dac98033aa1a631cc63f279fb89df9cbbcab0 100644 --- a/app/code/Magento/Catalog/Block/Product/ProductList/Related.php +++ b/app/code/Magento/Catalog/Block/Product/ProductList/Related.php @@ -121,7 +121,7 @@ class Related extends \Magento\Catalog\Block\Product\AbstractProduct implements * getIdentities() depends on _itemCollection populated, but it can be empty if the block is hidden * @see https://github.com/magento/magento2/issues/5897 */ - if (is_null($this->_itemCollection)) { + if ($this->_itemCollection === null) { $this->_prepareData(); } return $this->_itemCollection; diff --git a/app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php b/app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php index f97d1a788dafb8909804178af162ba81873d9395..40afd443052629290b523a085be3ca8b5896f005 100644 --- a/app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php +++ b/app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php @@ -140,7 +140,7 @@ class Upsell extends \Magento\Catalog\Block\Product\AbstractProduct implements \ * getIdentities() depends on _itemCollection populated, but it can be empty if the block is hidden * @see https://github.com/magento/magento2/issues/5897 */ - if (is_null($this->_itemCollection)) { + if ($this->_itemCollection === null) { $this->_prepareData(); } return $this->_itemCollection; @@ -151,7 +151,7 @@ class Upsell extends \Magento\Catalog\Block\Product\AbstractProduct implements \ */ public function getItems() { - if (is_null($this->_items)) { + if ($this->_items === null) { $this->_items = $this->getItemCollection()->getItems(); } return $this->_items; diff --git a/app/code/Magento/Catalog/Helper/Product/View.php b/app/code/Magento/Catalog/Helper/Product/View.php index 46ac05168715b9644add204d151e22b6b3559648..ae948a362ab5a92fa67034d905dbbdc4e4dffd57 100644 --- a/app/code/Magento/Catalog/Helper/Product/View.php +++ b/app/code/Magento/Catalog/Helper/Product/View.php @@ -122,18 +122,18 @@ class View extends \Magento\Framework\App\Helper\AbstractHelper // Load default page handles and page configurations if ($params && $params->getBeforeHandles()) { foreach ($params->getBeforeHandles() as $handle) { - $resultPage->addPageLayoutHandles(['id' => $product->getId(), 'sku' => $urlSafeSku], $handle); $resultPage->addPageLayoutHandles(['type' => $product->getTypeId()], $handle, false); + $resultPage->addPageLayoutHandles(['id' => $product->getId(), 'sku' => $urlSafeSku], $handle); } } - - $resultPage->addPageLayoutHandles(['id' => $product->getId(), 'sku' => $urlSafeSku]); + $resultPage->addPageLayoutHandles(['type' => $product->getTypeId()], null, false); + $resultPage->addPageLayoutHandles(['id' => $product->getId(), 'sku' => $urlSafeSku]); if ($params && $params->getAfterHandles()) { foreach ($params->getAfterHandles() as $handle) { - $resultPage->addPageLayoutHandles(['id' => $product->getId(), 'sku' => $urlSafeSku], $handle); $resultPage->addPageLayoutHandles(['type' => $product->getTypeId()], $handle, false); + $resultPage->addPageLayoutHandles(['id' => $product->getId(), 'sku' => $urlSafeSku], $handle); } } diff --git a/app/code/Magento/Catalog/Model/Config.php b/app/code/Magento/Catalog/Model/Config.php index 227821463b7f055e9541d00b91926135c3b0dd14..b3b5204887ea10fb2e4aaa08d517067e712a823b 100644 --- a/app/code/Magento/Catalog/Model/Config.php +++ b/app/code/Magento/Catalog/Model/Config.php @@ -407,7 +407,7 @@ class Config extends \Magento\Eav\Model\Config */ public function getProductAttributes() { - if (is_null($this->_productAttributes)) { + if ($this->_productAttributes === null) { $this->_productAttributes = array_keys($this->getAttributesUsedInProductListing()); } return $this->_productAttributes; @@ -430,7 +430,7 @@ class Config extends \Magento\Eav\Model\Config */ public function getAttributesUsedInProductListing() { - if (is_null($this->_usedInProductListing)) { + if ($this->_usedInProductListing === null) { $this->_usedInProductListing = []; $entityType = \Magento\Catalog\Model\Product::ENTITY; $attributesData = $this->_getResource()->setStoreId($this->getStoreId())->getAttributesUsedInListing(); @@ -453,7 +453,7 @@ class Config extends \Magento\Eav\Model\Config */ public function getAttributesUsedForSortBy() { - if (is_null($this->_usedForSortBy)) { + if ($this->_usedForSortBy === null) { $this->_usedForSortBy = []; $entityType = \Magento\Catalog\Model\Product::ENTITY; $attributesData = $this->_getResource()->getAttributesUsedForSortBy(); diff --git a/app/code/Magento/Catalog/Model/Layer/Filter/Price.php b/app/code/Magento/Catalog/Model/Layer/Filter/Price.php index ec5e2bff81ab36e0fdb75e398f4bbc52b0745036..68ef96c0f36a1eed800128180de34ba22f963200 100644 --- a/app/code/Magento/Catalog/Model/Layer/Filter/Price.php +++ b/app/code/Magento/Catalog/Model/Layer/Filter/Price.php @@ -150,7 +150,7 @@ class Price extends \Magento\Catalog\Model\Layer\Filter\AbstractFilter public function getCustomerGroupId() { $customerGroupId = $this->_getData('customer_group_id'); - if (is_null($customerGroupId)) { + if ($customerGroupId === null) { $customerGroupId = $this->_customerSession->getCustomerGroupId(); } @@ -176,7 +176,7 @@ class Price extends \Magento\Catalog\Model\Layer\Filter\AbstractFilter public function getCurrencyRate() { $rate = $this->_getData('currency_rate'); - if (is_null($rate)) { + if ($rate === null) { $rate = $this->_storeManager->getStore($this->getStoreId()) ->getCurrentCurrencyRate(); } diff --git a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/GroupPrice/AbstractGroupPrice.php b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/GroupPrice/AbstractGroupPrice.php index cd686c05908ce724cb2c61f59cc3e0694e47dd83..84770a4a93ed41461eb55ad8b2358be1a4ae05dc 100644 --- a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/GroupPrice/AbstractGroupPrice.php +++ b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/GroupPrice/AbstractGroupPrice.php @@ -91,7 +91,7 @@ abstract class AbstractGroupPrice extends Price */ protected function _getWebsiteCurrencyRates() { - if (is_null($this->_rates)) { + if ($this->_rates === null) { $this->_rates = []; $baseCurrency = $this->_config->getValue( \Magento\Directory\Model\Currency::XML_PATH_CURRENCY_BASE, diff --git a/app/code/Magento/Catalog/Model/Product/Option/Value.php b/app/code/Magento/Catalog/Model/Product/Option/Value.php index d92646769b13b2dfba439393f852e2540b14bcb9..10aae63ed349ce51bcbf94cd1185c4676c068d76 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Value.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Value.php @@ -179,7 +179,7 @@ class Value extends AbstractModel implements \Magento\Catalog\Api\Data\ProductCu */ public function getProduct() { - if (is_null($this->_product)) { + if ($this->_product === null) { $this->_product = $this->getOption()->getProduct(); } return $this->_product; diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php index 58e8424663c83cf226ccc7d1a0c8fa5b200f25b3..925c9fe60855d247fef190d9b4bce3322eb0cafb 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php @@ -1092,7 +1092,7 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Collection\Abstrac protected function _getSelectCountSql($select = null, $resetLeftJoins = true) { $this->_renderFilters(); - $countSelect = is_null($select) ? $this->_getClearSelect() : $this->_buildClearSelect($select); + $countSelect = $select === null ? $this->_getClearSelect() : $this->_buildClearSelect($select); $countSelect->columns('COUNT(DISTINCT e.entity_id)'); if ($resetLeftJoins) { $countSelect->resetJoinLeft(); @@ -1435,7 +1435,7 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Collection\Abstrac $ids = $this->_allIdsCache; } - if (is_null($ids)) { + if ($ids === null) { $ids = $this->getAllIds(); $this->setAllIdsCache($ids); } @@ -1466,17 +1466,17 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Collection\Abstrac { $this->_productLimitationFilters->setUsePriceIndex(true); - if (!isset($this->_productLimitationFilters['customer_group_id']) && is_null($customerGroupId)) { + if (!isset($this->_productLimitationFilters['customer_group_id']) && $customerGroupId === null) { $customerGroupId = $this->_customerSession->getCustomerGroupId(); } - if (!isset($this->_productLimitationFilters['website_id']) && is_null($websiteId)) { + if (!isset($this->_productLimitationFilters['website_id']) && $websiteId === null) { $websiteId = $this->_storeManager->getStore($this->getStoreId())->getWebsiteId(); } - if (!is_null($customerGroupId)) { + if ($customerGroupId !== null) { $this->_productLimitationFilters['customer_group_id'] = $customerGroupId; } - if (!is_null($websiteId)) { + if ($websiteId !== null) { $this->_productLimitationFilters['website_id'] = $websiteId; } @@ -2347,7 +2347,7 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Collection\Abstrac */ public function getMaxPrice() { - if (is_null($this->_maxPrice)) { + if ($this->_maxPrice === null) { $this->_prepareStatisticsData(); } @@ -2361,7 +2361,7 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Collection\Abstrac */ public function getMinPrice() { - if (is_null($this->_minPrice)) { + if ($this->_minPrice === null) { $this->_prepareStatisticsData(); } @@ -2375,7 +2375,7 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Collection\Abstrac */ public function getPriceStandardDeviation() { - if (is_null($this->_priceStandardDeviation)) { + if ($this->_priceStandardDeviation === null) { $this->_prepareStatisticsData(); } @@ -2389,7 +2389,7 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Collection\Abstrac */ public function getPricesCount() { - if (is_null($this->_pricesCount)) { + if ($this->_pricesCount === null) { $this->_prepareStatisticsData(); } diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/LinkedProductSelectBuilderByIndexPrice.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/LinkedProductSelectBuilderByIndexPrice.php index b4f7e43387d0efd50604054cc69bbb8ea74748d8..ee1df8f23424d7fc14b65da13fa461b3304e10e4 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/LinkedProductSelectBuilderByIndexPrice.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/LinkedProductSelectBuilderByIndexPrice.php @@ -87,6 +87,7 @@ class LinkedProductSelectBuilderByIndexPrice implements LinkedProductSelectBuild ->where('t.website_id = ?', $this->storeManager->getStore()->getWebsiteId()) ->where('t.customer_group_id = ?', $this->customerSession->getCustomerGroupId()) ->order('t.min_price ' . Select::SQL_ASC) + ->order(BaseSelectProcessorInterface::PRODUCT_TABLE_ALIAS . '.' . $linkField . ' ' . Select::SQL_ASC) ->limit(1); $priceSelect = $this->baseSelectProcessor->process($priceSelect); diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/LinkedProductSelectBuilderByBasePrice.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/LinkedProductSelectBuilderByBasePrice.php index f018e2b148f156a01006f187a8595345a8a2b9f3..8841b6059c46ff2b024edd9b90d4e431ce7f0466 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/LinkedProductSelectBuilderByBasePrice.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/LinkedProductSelectBuilderByBasePrice.php @@ -95,6 +95,7 @@ class LinkedProductSelectBuilderByBasePrice implements LinkedProductSelectBuilde ->where('t.attribute_id = ?', $priceAttribute->getAttributeId()) ->where('t.value IS NOT NULL') ->order('t.value ' . Select::SQL_ASC) + ->order(BaseSelectProcessorInterface::PRODUCT_TABLE_ALIAS . '.' . $linkField . ' ' . Select::SQL_ASC) ->limit(1); $priceSelect = $this->baseSelectProcessor->process($priceSelect); diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/LinkedProductSelectBuilderBySpecialPrice.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/LinkedProductSelectBuilderBySpecialPrice.php index b4459cd1eea078e65aa3d3b7a20f58096c1ec39b..5c47185a85bf407d2c13215c379611f2d144cb0d 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/LinkedProductSelectBuilderBySpecialPrice.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/LinkedProductSelectBuilderBySpecialPrice.php @@ -139,6 +139,7 @@ class LinkedProductSelectBuilderBySpecialPrice implements LinkedProductSelectBui 'special_to.value IS NULL OR ' . $connection->getDatePartSql('special_to.value') .' >= ?', $currentDate )->order('t.value ' . Select::SQL_ASC) + ->order(BaseSelectProcessorInterface::PRODUCT_TABLE_ALIAS . '.' . $linkField . ' ' . Select::SQL_ASC) ->limit(1); $specialPrice = $this->baseSelectProcessor->process($specialPrice); diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/LinkedProductSelectBuilderByTierPrice.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/LinkedProductSelectBuilderByTierPrice.php index 79323e57b033e36c6ede529e66b1d52cab9ef656..37281193d6a1b3509779bd18ec8a2008b14c0305 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/LinkedProductSelectBuilderByTierPrice.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/LinkedProductSelectBuilderByTierPrice.php @@ -97,6 +97,7 @@ class LinkedProductSelectBuilderByTierPrice implements LinkedProductSelectBuilde ->where('t.all_groups = 1 OR customer_group_id = ?', $this->customerSession->getCustomerGroupId()) ->where('t.qty = ?', 1) ->order('t.value ' . Select::SQL_ASC) + ->order(BaseSelectProcessorInterface::PRODUCT_TABLE_ALIAS . '.' . $linkField . ' ' . Select::SQL_ASC) ->limit(1); $priceSelect = $this->baseSelectProcessor->process($priceSelect); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/Indexer/LinkedProductSelectBuilderByIndexPriceTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/Indexer/LinkedProductSelectBuilderByIndexPriceTest.php index 6b908d317aa5b815e36f608f376a8d970b9a7d75..cec862ee9661f0aac6ca7d23c9ca17a1338a8b7c 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/Indexer/LinkedProductSelectBuilderByIndexPriceTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/Indexer/LinkedProductSelectBuilderByIndexPriceTest.php @@ -84,7 +84,7 @@ class LinkedProductSelectBuilderByIndexPriceTest extends \PHPUnit\Framework\Test $select->expects($this->any())->method('from')->willReturnSelf(); $select->expects($this->any())->method('joinInner')->willReturnSelf(); $select->expects($this->any())->method('where')->willReturnSelf(); - $select->expects($this->once())->method('order')->willReturnSelf(); + $select->expects($this->exactly(2))->method('order')->willReturnSelf(); $select->expects($this->once())->method('limit')->willReturnSelf(); $this->resourceMock->expects($this->any())->method('getConnection')->willReturn($connection); $this->metadataPoolMock->expects($this->once())->method('getMetadata')->willReturn($metadata); diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml index fc0967ca60d2d0c0701a74ecd421585bc09f38fc..862375503691caba52f6c33432f9210ffcf2e06e 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml @@ -146,8 +146,8 @@ switch ($type = $block->getType()) { } break; - case 'other': - break; + default: + $exist = null; } ?> diff --git a/app/code/Magento/CatalogRule/Model/ResourceModel/Product/LinkedProductSelectBuilderByCatalogRulePrice.php b/app/code/Magento/CatalogRule/Model/ResourceModel/Product/LinkedProductSelectBuilderByCatalogRulePrice.php index 00808f38c913263d2dc2ddfade74416069f4326f..3f396cacd37dab442e332343586d6f27c880b72f 100644 --- a/app/code/Magento/CatalogRule/Model/ResourceModel/Product/LinkedProductSelectBuilderByCatalogRulePrice.php +++ b/app/code/Magento/CatalogRule/Model/ResourceModel/Product/LinkedProductSelectBuilderByCatalogRulePrice.php @@ -105,6 +105,7 @@ class LinkedProductSelectBuilderByCatalogRulePrice implements LinkedProductSelec ->where('t.customer_group_id = ?', $this->customerSession->getCustomerGroupId()) ->where('t.rule_date = ?', $currentDate) ->order('t.rule_price ' . Select::SQL_ASC) + ->order(BaseSelectProcessorInterface::PRODUCT_TABLE_ALIAS . '.' . $linkField . ' ' . Select::SQL_ASC) ->limit(1); $priceSelect = $this->baseSelectProcessor->process($priceSelect); diff --git a/app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html b/app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html index f2baf5d50030e80f34dc7dda2d32a700ea6a8124..fd994a4e8a9553b9f77f251428a78e9e05faa50b 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html @@ -7,7 +7,7 @@ <div class="billing-address-details" data-bind="if: isAddressDetailsVisible() && currentBillingAddress()"> <!-- ko text: currentBillingAddress().prefix --><!-- /ko --> <!-- ko text: currentBillingAddress().firstname --><!-- /ko --> <!-- ko text: currentBillingAddress().middlename --><!-- /ko --> <!-- ko text: currentBillingAddress().lastname --><!-- /ko --> <!-- ko text: currentBillingAddress().suffix --><!-- /ko --><br/> - <!-- ko text: currentBillingAddress().street --><!-- /ko --><br/> + <!-- ko text: _.values(currentBillingAddress().street).join(", ") --><!-- /ko --><br/> <!-- ko text: currentBillingAddress().city --><!-- /ko -->, <span data-bind="html: currentBillingAddress().region"></span> <!-- ko text: currentBillingAddress().postcode --><!-- /ko --><br/> <!-- ko text: getCountryName(currentBillingAddress().countryId) --><!-- /ko --><br/> <!-- ko if: (currentBillingAddress().telephone) --> diff --git a/app/code/Magento/Checkout/view/frontend/web/template/shipping-information/address-renderer/default.html b/app/code/Magento/Checkout/view/frontend/web/template/shipping-information/address-renderer/default.html index ec41cae0bdc5e17cc3920b669f7c8337a1fc9dac..b66526f660af761d974c9bc61857a60c6e66466f 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/shipping-information/address-renderer/default.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/shipping-information/address-renderer/default.html @@ -7,7 +7,7 @@ <!-- ko if: (visible()) --> <!-- ko text: address().prefix --><!-- /ko --> <!-- ko text: address().firstname --><!-- /ko --> <!-- ko text: address().middlename --><!-- /ko --> <!-- ko text: address().lastname --><!-- /ko --> <!-- ko text: address().suffix --><!-- /ko --><br/> - <!-- ko text: address().street --><!-- /ko --><br/> + <!-- ko text: _.values(address().street).join(", ") --><!-- /ko --><br/> <!-- ko text: address().city --><!-- /ko -->, <span data-bind="html: address().region"></span> <!-- ko text: address().postcode --><!-- /ko --><br/> <!-- ko text: getCountryName(address().countryId) --><!-- /ko --><br/> <!-- ko if: (address().telephone) --> diff --git a/app/code/Magento/Eav/Model/Attribute.php b/app/code/Magento/Eav/Model/Attribute.php index 64504b59fe9c96ac318cd23a5b83413477cc1998..e53f3ccc82a755eb71272bfd600a987da58b54e7 100644 --- a/app/code/Magento/Eav/Model/Attribute.php +++ b/app/code/Magento/Eav/Model/Attribute.php @@ -62,7 +62,7 @@ class Attribute extends \Magento\Eav\Model\Entity\Attribute */ public function getWebsite() { - if (is_null($this->_website)) { + if ($this->_website === null) { $this->_website = $this->_storeManager->getWebsite(); } @@ -88,7 +88,7 @@ class Attribute extends \Magento\Eav\Model\Entity\Attribute public function getUsedInForms() { $forms = $this->getData('used_in_forms'); - if (is_null($forms)) { + if ($forms === null) { $forms = $this->_getResource()->getUsedInForms($this); $this->setData('used_in_forms', $forms); } diff --git a/app/code/Magento/Eav/Model/Attribute/Data/AbstractData.php b/app/code/Magento/Eav/Model/Attribute/Data/AbstractData.php index ed052cb71e2fa094f41225f18ace2f84ec4285fd..12023acc3b33b37bacbb2f63e7e5e3f32adccd96 100644 --- a/app/code/Magento/Eav/Model/Attribute/Data/AbstractData.php +++ b/app/code/Magento/Eav/Model/Attribute/Data/AbstractData.php @@ -205,7 +205,7 @@ abstract class AbstractData */ public function getExtractedData($index = null) { - if (!is_null($index)) { + if ($index !== null) { if (isset($this->_extractedData[$index])) { return $this->_extractedData[$index]; } @@ -262,9 +262,9 @@ abstract class AbstractData */ protected function _dateFilterFormat($format = null) { - if (is_null($format)) { + if ($format === null) { // get format - if (is_null($this->_dateFilterFormat)) { + if ($this->_dateFilterFormat === null) { $this->_dateFilterFormat = \IntlDateFormatter::SHORT; } return $this->_localeDate->getDateFormat($this->_dateFilterFormat); diff --git a/app/code/Magento/Eav/Model/Entity/AbstractEntity.php b/app/code/Magento/Eav/Model/Entity/AbstractEntity.php index b0d186705026f86b681c9997535f43ebe8869530..feb2c4d7d3f9faed766a36414d1f9a1d1ffca2cf 100644 --- a/app/code/Magento/Eav/Model/Entity/AbstractEntity.php +++ b/app/code/Magento/Eav/Model/Entity/AbstractEntity.php @@ -1294,7 +1294,7 @@ abstract class AbstractEntity extends AbstractResource implements EntityInterfac $origData = $this->_getOrigObject($newObject)->getOrigData(); } - if (is_null($origData)) { + if ($origData === null) { $origData = []; } diff --git a/app/code/Magento/Eav/Model/Entity/Attribute/Backend/Datetime.php b/app/code/Magento/Eav/Model/Entity/Attribute/Backend/Datetime.php index 786060ea7b312cec5da89d4325bb309375816044..1a5f0a7811de34d440e5a18ca7a2943f0f56cc06 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute/Backend/Datetime.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute/Backend/Datetime.php @@ -49,7 +49,7 @@ class Datetime extends \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBacke throw new \Magento\Framework\Exception\LocalizedException(__('Invalid date')); } - if (is_null($value)) { + if ($value === null) { $value = $object->getData($attributeName); } diff --git a/app/code/Magento/Newsletter/Setup/UpgradeSchema.php b/app/code/Magento/Newsletter/Setup/UpgradeSchema.php new file mode 100644 index 0000000000000000000000000000000000000000..e7ce898de83a3e04fa3369b963b22137b480243d --- /dev/null +++ b/app/code/Magento/Newsletter/Setup/UpgradeSchema.php @@ -0,0 +1,36 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Newsletter\Setup; + +use Magento\Framework\Setup\ModuleContextInterface; +use Magento\Framework\Setup\SchemaSetupInterface; +use Magento\Framework\Setup\UpgradeSchemaInterface; + +/** + * Upgrade the Newsletter module DB scheme + */ +class UpgradeSchema implements UpgradeSchemaInterface +{ + /** + * {@inheritdoc} + */ + public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context) + { + $setup->startSetup(); + + if (version_compare($context->getVersion(), '2.0.1', '<')) { + $connection = $setup->getConnection(); + + $connection->addIndex( + $setup->getTable('newsletter_subscriber'), + $setup->getIdxName('newsletter_subscriber', ['subscriber_email']), + ['subscriber_email'] + ); + } + + $setup->endSetup(); + } +} diff --git a/app/code/Magento/Newsletter/etc/module.xml b/app/code/Magento/Newsletter/etc/module.xml index f338445225222a56ab82e2baebee390ccabefe36..5da16a9a3e9ba7b76c73cbeb9236dcd15a71a3b2 100644 --- a/app/code/Magento/Newsletter/etc/module.xml +++ b/app/code/Magento/Newsletter/etc/module.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> - <module name="Magento_Newsletter" setup_version="2.0.0"> + <module name="Magento_Newsletter" setup_version="2.0.1"> <sequence> <module name="Magento_Store"/> <module name="Magento_Customer"/> diff --git a/app/code/Magento/ProductAlert/Controller/Add/TestObserver.php b/app/code/Magento/ProductAlert/Controller/Add/TestObserver.php deleted file mode 100644 index 74f03220e59d381e0f8af2e788e6484e0d7fdbc9..0000000000000000000000000000000000000000 --- a/app/code/Magento/ProductAlert/Controller/Add/TestObserver.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\ProductAlert\Controller\Add; - -use Magento\ProductAlert\Controller\Add as AddController; -use Magento\Framework\DataObject; - -class TestObserver extends AddController -{ - /** - * @return void - */ - public function execute() - { - $object = new DataObject(); - /** @var \Magento\ProductAlert\Model\Observer $observer */ - $observer = $this->_objectManager->get(\Magento\ProductAlert\Model\Observer::class); - $observer->process($object); - } -} diff --git a/app/code/Magento/Review/Controller/Product/ListAction.php b/app/code/Magento/Review/Controller/Product/ListAction.php index dd8b272867c551aefd5690f51ae65c9a58dad7af..26344d125172a86fe32582230eee2033a0139d30 100644 --- a/app/code/Magento/Review/Controller/Product/ListAction.php +++ b/app/code/Magento/Review/Controller/Product/ListAction.php @@ -26,8 +26,8 @@ class ListAction extends ProductController $resultPage->getConfig()->setPageLayout($product->getPageLayout()); } $urlSafeSku = rawurlencode($product->getSku()); - $resultPage->addPageLayoutHandles(['id' => $product->getId(), 'sku' => $urlSafeSku]); $resultPage->addPageLayoutHandles(['type' => $product->getTypeId()], null, false); + $resultPage->addPageLayoutHandles(['id' => $product->getId(), 'sku' => $urlSafeSku]); $resultPage->addUpdate($product->getCustomLayoutUpdate()); return $resultPage; } diff --git a/app/code/Magento/Sales/Model/AdminOrder/Create.php b/app/code/Magento/Sales/Model/AdminOrder/Create.php index 69f4d19e4dd630a45242df8e507de199525602d5..8ea09e6fb3d42de9e8ffc9b6c2f061200d37e2a3 100644 --- a/app/code/Magento/Sales/Model/AdminOrder/Create.php +++ b/app/code/Magento/Sales/Model/AdminOrder/Create.php @@ -681,7 +681,7 @@ class Create extends \Magento\Framework\DataObject implements \Magento\Checkout\ */ public function getCustomerWishlist($cacheReload = false) { - if (!is_null($this->_wishlist) && !$cacheReload) { + if (($this->_wishlist !== null) && !$cacheReload) { return $this->_wishlist; } @@ -708,7 +708,7 @@ class Create extends \Magento\Framework\DataObject implements \Magento\Checkout\ */ public function getCustomerCart() { - if (!is_null($this->_cart)) { + if ($this->_cart !== null) { return $this->_cart; } @@ -736,7 +736,7 @@ class Create extends \Magento\Framework\DataObject implements \Magento\Checkout\ */ public function getCustomerCompareList() { - if (!is_null($this->_compareList)) { + if ($this->_compareList !== null) { return $this->_compareList; } $customerId = (int)$this->getSession()->getCustomerId(); @@ -807,7 +807,7 @@ class Create extends \Magento\Framework\DataObject implements \Magento\Checkout\ break; case 'cart': $cart = $this->getCustomerCart(); - if ($cart && is_null($item->getOptionByCode('additional_options'))) { + if ($cart && ($item->getOptionByCode('additional_options') === null)) { //options and info buy request $product = $this->_objectManager->create( \Magento\Catalog\Model\Product::class @@ -1727,7 +1727,7 @@ class Create extends \Magento\Framework\DataObject implements \Magento\Checkout\ } $data = $form->restoreData($data); foreach ($data as $key => $value) { - if (!is_null($value)) { + if ($value !== null) { unset($data[$key]); } } @@ -1851,12 +1851,12 @@ class Create extends \Magento\Framework\DataObject implements \Magento\Checkout\ switch ($addressType) { case \Magento\Quote\Model\Quote\Address::ADDRESS_TYPE_BILLING: - if (is_null($customer->getDefaultBilling())) { + if ($customer->getDefaultBilling() === null) { $customerAddress->setIsDefaultBilling(true); } break; case \Magento\Quote\Model\Quote\Address::ADDRESS_TYPE_SHIPPING: - if (is_null($customer->getDefaultShipping())) { + if ($customer->getDefaultShipping() === null) { $customerAddress->setIsDefaultShipping(true); } break; @@ -1948,7 +1948,7 @@ class Create extends \Magento\Framework\DataObject implements \Magento\Checkout\ protected function _validate() { $customerId = $this->getSession()->getCustomerId(); - if (is_null($customerId)) { + if ($customerId === null) { throw new \Magento\Framework\Exception\LocalizedException(__('Please select a customer')); } diff --git a/app/code/Magento/Sales/Model/Order/Creditmemo.php b/app/code/Magento/Sales/Model/Order/Creditmemo.php index 64b903fe5b5c1eacca4eb2b0241f71102f523176..0d0e0d23496b75ba8781c500d36463c0aff59229 100644 --- a/app/code/Magento/Sales/Model/Order/Creditmemo.php +++ b/app/code/Magento/Sales/Model/Order/Creditmemo.php @@ -431,7 +431,7 @@ class Creditmemo extends AbstractModel implements EntityInterface, CreditmemoInt /** * If we not retrieve negative answer from payment yet */ - if (is_null($canVoid)) { + if ($canVoid === null) { $canVoid = $this->getOrder()->getPayment()->canVoid(); if ($canVoid === false) { $this->setCanVoidFlag(false); @@ -451,7 +451,7 @@ class Creditmemo extends AbstractModel implements EntityInterface, CreditmemoInt */ public static function getStates() { - if (is_null(static::$_states)) { + if (static::$_states === null) { static::$_states = [ self::STATE_OPEN => __('Pending'), self::STATE_REFUNDED => __('Refunded'), @@ -469,11 +469,11 @@ class Creditmemo extends AbstractModel implements EntityInterface, CreditmemoInt */ public function getStateName($stateId = null) { - if (is_null($stateId)) { + if ($stateId === null) { $stateId = $this->getState(); } - if (is_null(static::$_states)) { + if (static::$_states === null) { static::getStates(); } if (isset(static::$_states[$stateId])) { diff --git a/app/code/Magento/Sales/Model/Order/CustomerManagement.php b/app/code/Magento/Sales/Model/Order/CustomerManagement.php index bf54e65d0ce1058ccac59429ba6ad8021f113339..466f3ff8adddb61b8ff3fd129a54a49b5c9e9408 100644 --- a/app/code/Magento/Sales/Model/Order/CustomerManagement.php +++ b/app/code/Magento/Sales/Model/Order/CustomerManagement.php @@ -131,6 +131,7 @@ class CustomerManagement implements \Magento\Sales\Api\OrderCustomerManagementIn $customer = $this->customerFactory->create(['data' => $customerData]); $account = $this->accountManagement->createAccount($customer); $order->setCustomerId($account->getId()); + $order->setCustomerIsGuest(0); $this->orderRepository->save($order); return $account; diff --git a/app/code/Magento/Sales/Model/Order/Payment/Transaction.php b/app/code/Magento/Sales/Model/Order/Payment/Transaction.php index b9b7a142095d9de0750949dbfa68d5914c3a4d1b..7540ee1902b572e72fab886c4db2e9292126bdac 100644 --- a/app/code/Magento/Sales/Model/Order/Payment/Transaction.php +++ b/app/code/Magento/Sales/Model/Order/Payment/Transaction.php @@ -733,7 +733,7 @@ class Transaction extends AbstractModel implements TransactionInterface */ public function getOrderWebsiteId() { - if (is_null($this->_orderWebsiteId)) { + if ($this->_orderWebsiteId === null) { $this->_orderWebsiteId = (int)$this->getResource()->getOrderWebsiteId($this->getOrderId()); } return $this->_orderWebsiteId; diff --git a/app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php b/app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php index 1a25ff7bfdb80ffd079669adcdb3ea421e9ee6b1..1b80d08e68cda046cbdc887e76a45649f57d4408 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php @@ -804,7 +804,7 @@ abstract class AbstractPdf extends \Magento\Framework\DataObject throw new \Magento\Framework\Exception\LocalizedException(__('We found an invalid renderer model.')); } - if (is_null($this->_renderers[$type]['renderer'])) { + if ($this->_renderers[$type]['renderer'] === null) { $this->_renderers[$type]['renderer'] = $this->_pdfItemsFactory->get($this->_renderers[$type]['model']); } diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Invoice.php b/app/code/Magento/Sales/Model/Order/Pdf/Invoice.php index f294128a72f9f2df99360c201f0d1ce8f5fe8e81..ba99ed083e952dbc9714a4cf2b3059297523cffd 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Invoice.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Invoice.php @@ -96,7 +96,7 @@ class Invoice extends AbstractPdf $lines[0][] = ['text' => __('Qty'), 'feed' => 435, 'align' => 'right']; - $lines[0][] = ['text' => __('Price'), 'feed' => 360, 'align' => 'right']; + $lines[0][] = ['text' => __('Price'), 'feed' => 375, 'align' => 'right']; $lines[0][] = ['text' => __('Tax'), 'feed' => 495, 'align' => 'right']; diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Items/Invoice/DefaultInvoice.php b/app/code/Magento/Sales/Model/Order/Pdf/Items/Invoice/DefaultInvoice.php index bb6078e425900a94adc2cfb358cbf8a6eac439eb..7d62e839ad92463472421faf721206a8d341b234 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Items/Invoice/DefaultInvoice.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Items/Invoice/DefaultInvoice.php @@ -81,8 +81,8 @@ class DefaultInvoice extends \Magento\Sales\Model\Order\Pdf\Items\AbstractItems // draw item Prices $i = 0; $prices = $this->getItemPricesForDisplay(); - $feedPrice = 395; - $feedSubtotal = $feedPrice + 170; + $feedPrice = 375; + $feedSubtotal = $feedPrice + 190; foreach ($prices as $priceData) { if (isset($priceData['label'])) { // draw Price label diff --git a/app/code/Magento/Sales/Model/ResourceModel/Report/Bestsellers/Collection.php b/app/code/Magento/Sales/Model/ResourceModel/Report/Bestsellers/Collection.php index 7f0aaff02d1040403b4cf384fc75b46694f54860..fa4fccb1b17e768ed0906d4f04345bc50e4d78c9 100644 --- a/app/code/Magento/Sales/Model/ResourceModel/Report/Bestsellers/Collection.php +++ b/app/code/Magento/Sales/Model/ResourceModel/Report/Bestsellers/Collection.php @@ -255,8 +255,8 @@ class Collection extends \Magento\Sales\Model\ResourceModel\Report\Collection\Ab $selectUnions = []; // apply date boundaries (before calling $this->_applyDateRangeFilter()) - $periodFrom = !is_null($this->_from) ? new \DateTime($this->_from) : null; - $periodTo = !is_null($this->_to) ? new \DateTime($this->_to) : null; + $periodFrom = ($this->_from !== null) ? new \DateTime($this->_from) : null; + $periodTo = ($this->_to !== null) ? new \DateTime($this->_to) : null; if ('year' == $this->_period) { if ($periodFrom) { // not the first day of the year diff --git a/app/code/Magento/SalesRule/view/frontend/web/js/view/summary/discount.js b/app/code/Magento/SalesRule/view/frontend/web/js/view/summary/discount.js index 5b047005962727ddff7bd8a49c68d3853f2eb8e2..6df769a90894e9916549daed4967d061730db622 100644 --- a/app/code/Magento/SalesRule/view/frontend/web/js/view/summary/discount.js +++ b/app/code/Magento/SalesRule/view/frontend/web/js/view/summary/discount.js @@ -44,6 +44,25 @@ define([ return this.totals()['coupon_label']; }, + /** + * Get discount title + * + * @returns {null|String} + */ + getTitle: function () { + var discountSegments; + + if (!this.totals()) { + return null; + } + + discountSegments = this.totals()['total_segments'].filter(function (segment) { + return segment.code === 'discount'; + }); + + return discountSegments.length ? discountSegments[0].title : null; + }, + /** * @return {Number} */ diff --git a/app/code/Magento/SalesRule/view/frontend/web/template/cart/totals/discount.html b/app/code/Magento/SalesRule/view/frontend/web/template/cart/totals/discount.html index 4b70b4b110c976a3b59ba143af798848c4b426fb..8fbb4a6ce74ae0e6ba13e62654d2ef8be20e0779 100644 --- a/app/code/Magento/SalesRule/view/frontend/web/template/cart/totals/discount.html +++ b/app/code/Magento/SalesRule/view/frontend/web/template/cart/totals/discount.html @@ -7,7 +7,7 @@ <!-- ko if: isDisplayed() --> <tr class="totals"> <th colspan="1" style="" class="mark" scope="row"> - <span class="title" data-bind="text: title"></span> + <span class="title" data-bind="text: getTitle()"></span> <span class="discount coupon" data-bind="text: getCouponLabel()"></span> </th> <td class="amount" data-bind="attr: {'data-th': title}"> diff --git a/app/code/Magento/SalesRule/view/frontend/web/template/summary/discount.html b/app/code/Magento/SalesRule/view/frontend/web/template/summary/discount.html index 17a9559fa01f2565f27cadf957a4d9307dffb81a..017e358c7e41992b27516bd38e7f9b8da7894ee5 100644 --- a/app/code/Magento/SalesRule/view/frontend/web/template/summary/discount.html +++ b/app/code/Magento/SalesRule/view/frontend/web/template/summary/discount.html @@ -7,7 +7,7 @@ <!-- ko if: isDisplayed() --> <tr class="totals discount"> <th class="mark" scope="row"> - <span class="title" data-bind="text: title"></span> + <span class="title" data-bind="text: getTitle()"></span> <span class="discount coupon" data-bind="text: getCouponCode()"></span> </th> <td class="amount"> diff --git a/app/code/Magento/Security/Model/AdminSessionsManager.php b/app/code/Magento/Security/Model/AdminSessionsManager.php index 4ebdcc58240a1ee16216ba0c28fcd3a8c104357e..af690f1899e7beb485740509cd2d8015cf2711f8 100644 --- a/app/code/Magento/Security/Model/AdminSessionsManager.php +++ b/app/code/Magento/Security/Model/AdminSessionsManager.php @@ -66,6 +66,14 @@ class AdminSessionsManager */ private $remoteAddress; + /** + * Max lifetime for session prolong to be valid (sec) + * + * Means that after session was prolonged + * all other prolongs will be ignored within this period + */ + private $maxIntervalBetweenConsecutiveProlongs = 60; + /** * @param ConfigInterface $securityConfig * @param \Magento\Backend\Model\Auth\Session $authSession @@ -124,11 +132,16 @@ class AdminSessionsManager */ public function processProlong() { - $this->getCurrentSession()->setData( - 'updated_at', - $this->authSession->getUpdatedAt() - ); - $this->getCurrentSession()->save(); + if ($this->lastProlongIsOldEnough()) { + $this->getCurrentSession()->setData( + 'updated_at', + date( + \Magento\Framework\Stdlib\DateTime::DATETIME_PHP_FORMAT, + $this->authSession->getUpdatedAt() + ) + ); + $this->getCurrentSession()->save(); + } return $this; } @@ -298,4 +311,45 @@ class AdminSessionsManager { return $this->adminSessionInfoCollectionFactory->create(); } + + /** + * Calculates diff between now and last session updated_at + * and decides whether new prolong must be triggered or not + * + * This is done to limit amount of session prolongs and updates to database + * within some period of time - X + * X - is calculated in getIntervalBetweenConsecutiveProlongs() + * + * @see getIntervalBetweenConsecutiveProlongs() + * @return bool + */ + private function lastProlongIsOldEnough() + { + $lastProlongTimestamp = strtotime($this->getCurrentSession()->getUpdatedAt()); + $nowTimestamp = $this->authSession->getUpdatedAt(); + + $diff = $nowTimestamp - $lastProlongTimestamp; + + return (float) $diff > $this->getIntervalBetweenConsecutiveProlongs(); + } + + /** + * Calculates lifetime for session prolong to be valid + * + * Calculation is based on admin session lifetime + * Calculated result is in seconds and is in the interval + * between 1 (including) and MAX_INTERVAL_BETWEEN_CONSECUTIVE_PROLONGS (including) + * + * @return float + */ + private function getIntervalBetweenConsecutiveProlongs() + { + return (float) max( + 1, + min( + 4 * log((float)$this->securityConfig->getAdminSessionLifetime()), + $this->maxIntervalBetweenConsecutiveProlongs + ) + ); + } } diff --git a/app/code/Magento/Security/Test/Unit/Model/AdminSessionsManagerTest.php b/app/code/Magento/Security/Test/Unit/Model/AdminSessionsManagerTest.php index d81264f661762ca2a29cad90d203684b7ce01339..ddfeaa59ac224f72bab2cf3aa12537c693e8ac9a 100644 --- a/app/code/Magento/Security/Test/Unit/Model/AdminSessionsManagerTest.php +++ b/app/code/Magento/Security/Test/Unit/Model/AdminSessionsManagerTest.php @@ -99,7 +99,8 @@ class AdminSessionsManagerTest extends \PHPUnit\Framework\TestCase 'setIsOtherSessionsTerminated', 'save', 'getUserId', - 'getSessionId' + 'getSessionId', + 'getUpdatedAt' ]); $this->securityConfigMock = $this->getMockBuilder(\Magento\Security\Model\ConfigInterface::class) @@ -216,7 +217,8 @@ class AdminSessionsManagerTest extends \PHPUnit\Framework\TestCase public function testProcessProlong() { $sessionId = 50; - $updatedAt = '2015-12-31 23:59:59'; + $lastUpdatedAt = '2015-12-31 23:59:59'; + $newUpdatedAt = '2016-01-01 00:00:30'; $this->adminSessionInfoFactoryMock->expects($this->any()) ->method('create') @@ -230,13 +232,21 @@ class AdminSessionsManagerTest extends \PHPUnit\Framework\TestCase ->method('load') ->willReturnSelf(); - $this->authSessionMock->expects($this->once()) + $this->currentSessionMock->expects($this->once()) + ->method('getUpdatedAt') + ->willReturn($lastUpdatedAt); + + $this->authSessionMock->expects($this->exactly(2)) ->method('getUpdatedAt') - ->willReturn($updatedAt); + ->willReturn(strtotime($newUpdatedAt)); + + $this->securityConfigMock->expects($this->once()) + ->method('getAdminSessionLifetime') + ->willReturn(100); $this->currentSessionMock->expects($this->once()) ->method('setData') - ->with('updated_at', $updatedAt) + ->with('updated_at', $newUpdatedAt) ->willReturnSelf(); $this->currentSessionMock->expects($this->once()) diff --git a/app/code/Magento/Swatches/Block/Adminhtml/Attribute/Edit/Options/Visual.php b/app/code/Magento/Swatches/Block/Adminhtml/Attribute/Edit/Options/Visual.php index 306f01af17e71f93a8487e5b5e1ed702a261a6aa..66ecd06c646e7980be68eb94de32eab394aac435 100644 --- a/app/code/Magento/Swatches/Block/Adminhtml/Attribute/Edit/Options/Visual.php +++ b/app/code/Magento/Swatches/Block/Adminhtml/Attribute/Edit/Options/Visual.php @@ -84,15 +84,15 @@ class Visual extends AbstractSwatch * Parse swatch labels for template * * @codeCoverageIgnore - * @param null $swatchStoreValue - * @return string + * @param null|array $swatchStoreValue + * @return null|array */ protected function reformatSwatchLabels($swatchStoreValue = null) { if ($swatchStoreValue === null) { return; } - $newSwatch = ''; + $newSwatch = []; foreach ($swatchStoreValue as $key => $value) { if ($value[0] == '#') { $newSwatch[$key] = 'background: '.$value; diff --git a/app/code/Magento/Swatches/Model/Plugin/EavAttribute.php b/app/code/Magento/Swatches/Model/Plugin/EavAttribute.php index 599406f4552816ac0a3e5c2eb074a37156a3940f..d3904f058dc2db8bd4001c7b6eb8b4b9f47523c1 100644 --- a/app/code/Magento/Swatches/Model/Plugin/EavAttribute.php +++ b/app/code/Magento/Swatches/Model/Plugin/EavAttribute.php @@ -432,7 +432,7 @@ class EavAttribute $options = $attribute->getData('optiontext'); } if ($options && !$this->isOptionsValid($options, $attribute)) { - throw new InputException(__('Admin is a required field in the each row')); + throw new InputException(__('Admin is a required field in each row')); } return true; } diff --git a/app/code/Magento/Swatches/Test/Unit/Model/Plugin/EavAttributeTest.php b/app/code/Magento/Swatches/Test/Unit/Model/Plugin/EavAttributeTest.php index 258347887ff08ac7ada538e18aea89234cd958c8..31a45ddb2847cd72c1f61fe94183fbec979ad2c4 100644 --- a/app/code/Magento/Swatches/Test/Unit/Model/Plugin/EavAttributeTest.php +++ b/app/code/Magento/Swatches/Test/Unit/Model/Plugin/EavAttributeTest.php @@ -191,7 +191,7 @@ class EavAttributeTest extends \PHPUnit\Framework\TestCase /** * @expectedException \Magento\Framework\Exception\InputException - * @expectedExceptionMessage Admin is a required field in the each row + * @expectedExceptionMessage Admin is a required field in each row */ public function testBeforeSaveWithFailedValidation() { diff --git a/app/code/Magento/Swatches/i18n/en_US.csv b/app/code/Magento/Swatches/i18n/en_US.csv index 3ea4977a75348e621707de5952093eff09446d54..00874d7611169530b54227ae7d2cd215a7458d4b 100644 --- a/app/code/Magento/Swatches/i18n/en_US.csv +++ b/app/code/Magento/Swatches/i18n/en_US.csv @@ -1,4 +1,4 @@ -"Admin is a required field in the each row","Admin is a required field in the each row" +"Admin is a required field in each row","Admin is a required field in each row" "Update Product Preview Image","Update Product Preview Image" "Filtering by this attribute will update the product image on catalog page","Filtering by this attribute will update the product image on catalog page" "Use Product Image for Swatch if Possible","Use Product Image for Swatch if Possible" diff --git a/app/code/Magento/Tax/Model/Calculation/Rate.php b/app/code/Magento/Tax/Model/Calculation/Rate.php index f639d6680a7fc039b95e3617c63f3664b1134e1d..9e44cd113ddeaa7d4b0ff1704c70edcb12a76df6 100644 --- a/app/code/Magento/Tax/Model/Calculation/Rate.php +++ b/app/code/Magento/Tax/Model/Calculation/Rate.php @@ -227,7 +227,7 @@ class Rate extends \Magento\Framework\Model\AbstractExtensibleModel implements T */ public function saveTitles($titles = null) { - if (is_null($titles)) { + if ($titles === null) { $titles = $this->getTitle(); } @@ -256,7 +256,7 @@ class Rate extends \Magento\Framework\Model\AbstractExtensibleModel implements T */ public function getTitleModel() { - if (is_null($this->_titleModel)) { + if ($this->_titleModel === null) { $this->_titleModel = $this->_titleFactory->create(); } return $this->_titleModel; @@ -270,7 +270,7 @@ class Rate extends \Magento\Framework\Model\AbstractExtensibleModel implements T if ($this->getData(self::KEY_TITLES)) { return $this->getData(self::KEY_TITLES); } - if (is_null($this->_titles)) { + if ($this->_titles === null) { $this->_titles = $this->getTitleModel()->getCollection()->loadByRateId($this->getId())->getItems(); } return $this->_titles; diff --git a/app/code/Magento/Tax/Model/Sales/Total/Quote/CommonTaxCollector.php b/app/code/Magento/Tax/Model/Sales/Total/Quote/CommonTaxCollector.php index 1fcaf0e413cd5e6f7ba077422f9a59e998956f27..7752911ceb22f59bb0523623cbe20a913d3041db 100644 --- a/app/code/Magento/Tax/Model/Sales/Total/Quote/CommonTaxCollector.php +++ b/app/code/Magento/Tax/Model/Sales/Total/Quote/CommonTaxCollector.php @@ -771,7 +771,7 @@ class CommonTaxCollector extends AbstractTotal $previouslyAppliedTaxes[$row['id']] = $row; } - if (!is_null($row['percent'])) { + if ($row['percent'] !== null) { $row['percent'] = $row['percent'] ? $row['percent'] : 1; $rate = $rate ? $rate : 1; diff --git a/app/code/Magento/Ui/i18n/en_US.csv b/app/code/Magento/Ui/i18n/en_US.csv index 225d83387563be037b4615c232535d2480af5fd5..cff52a3fd6fedf836d9ed37863312b8d005f3125 100644 --- a/app/code/Magento/Ui/i18n/en_US.csv +++ b/app/code/Magento/Ui/i18n/en_US.csv @@ -192,7 +192,7 @@ CSV,CSV "Please enter a valid value from list","Please enter a valid value from list" "Please enter valid SKU key.","Please enter valid SKU key." "Please enter a valid number.","Please enter a valid number." -"Admin is a required field in the each row.","Admin is a required field in the each row." +"Admin is a required field in each row.","Admin is a required field in each row." "Please fix this field.","Please fix this field." "Please enter a valid date (ISO).","Please enter a valid date (ISO)." "Please enter only digits.","Please enter only digits." diff --git a/app/code/Magento/Ui/view/base/web/js/form/components/html.js b/app/code/Magento/Ui/view/base/web/js/form/components/html.js index 82e51aff402872c5abffce21db6a94599c437ce4..466b6840e9b195301d1db28e072a9c8db877d7e8 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/components/html.js +++ b/app/code/Magento/Ui/view/base/web/js/form/components/html.js @@ -19,6 +19,7 @@ define([ showSpinner: false, loading: false, visible: true, + error: false, template: 'ui/content/content', additionalClasses: {} }, diff --git a/app/code/Magento/Ui/view/base/web/templates/content/content.html b/app/code/Magento/Ui/view/base/web/templates/content/content.html index 8cf47120865dcbc172acd113fc634f9cd4a17b4e..62e5959a02559be8b3ed975b193ce793f1ba93d6 100644 --- a/app/code/Magento/Ui/view/base/web/templates/content/content.html +++ b/app/code/Magento/Ui/view/base/web/templates/content/content.html @@ -17,3 +17,5 @@ <span repeat="8"/> </div> </div> + +<label class="admin__field-error" if="error" attr="for: uid" text="error"/> diff --git a/app/design/adminhtml/Magento/backend/Magento_ConfigurableProduct/web/css/source/module/components/_currency-addon.less b/app/design/adminhtml/Magento/backend/Magento_ConfigurableProduct/web/css/source/module/components/_currency-addon.less index 1e5d03d6f25c2d4da7215d611dc0f63378e74be0..df184f0f232ccf463c60faf75617eab6c3c9733f 100644 --- a/app/design/adminhtml/Magento/backend/Magento_ConfigurableProduct/web/css/source/module/components/_currency-addon.less +++ b/app/design/adminhtml/Magento/backend/Magento_ConfigurableProduct/web/css/source/module/components/_currency-addon.less @@ -19,10 +19,30 @@ .currency-addon { position: relative; + border: 1px solid #adadad; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + display: inline-flex; + flex-flow: row nowrap; + width: 100%; + position: relative; .admin__control-text { - border-width: 1px 1px 1px 0; - padding-left: @currency-addon-symbol__width + .2; + appearence: none; + -webkit-flex-grow: 1; + flex-grow: 1; + -ms-flex-order: 1; + -webkit-order: 1; + order: 1; + -webkit-flex-shrink: 1; + flex-shrink: 1; + background-color: transparent; + border-color: transparent; + box-shadow: none; + vertical-align: top; &:focus { + .currency-symbol { @@ -31,18 +51,29 @@ } } + label.error { + position: absolute; + left: 0; + top: 33px; + } + .currency-symbol { border: solid @currency-addon-symbol__border-color; - border-width: 0 0 0 1px; + border-width: 0; box-sizing: border-box; color: @currency-addon-symbol__color; height: @currency-addon-symbol__height; - left: 0; padding: 7px 0 0 @indent__xs; - position: absolute; - top: 0; + position: static; transition: @smooth__border-color; - width: @currency-addon-symbol__width; + -webkit-flex-basis: auto; + flex-basis: auto; + -webkit-flex-grow: 0; + flex-grow: 0; + -webkit-flex-shrink: 0; + flex-shrink: 0; + z-index: 1; + order: 0; } ._error & { diff --git a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_cart.less b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_cart.less index 871c9e63490daf0f0a2de452cef89418e2a68772..bb14a3c2521b04ee223c2857a60c8e55a5c2e177 100644 --- a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_cart.less +++ b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_cart.less @@ -80,6 +80,10 @@ margin-bottom: 0; overflow: inherit; } + + .discount.coupon { + display: none; + } } // Products table diff --git a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/checkout/_order-summary.less b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/checkout/_order-summary.less index 5da1faeb8216e589867c7dd511f30611de39b5e1..43c2ad50c7a6fae89bf8dbcc4c1d9c1ec3762bfa 100644 --- a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/checkout/_order-summary.less +++ b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/checkout/_order-summary.less @@ -49,6 +49,10 @@ } } + .discount.coupon { + display: none; + } + .grand.incl { & + .grand.excl { .mark, diff --git a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_cart.less b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_cart.less index b619391402016057de197191149656ce69fec370..4b8db9202b1958750e38f80387b8f20b1544d339 100644 --- a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_cart.less +++ b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_cart.less @@ -166,6 +166,10 @@ text-align: left; } } + + .discount.coupon { + display: none; + } } // Products table diff --git a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_order-summary.less b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_order-summary.less index ec2e95b7d820e652274edd2f8e8f953cd896d899..5ecc4d4713bf1b36e1d68750f84c6913bef2d602 100644 --- a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_order-summary.less +++ b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_order-summary.less @@ -49,6 +49,10 @@ } } + .discount.coupon { + display: none; + } + .grand.incl { & + .grand.excl { .mark, diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Customer/Cest/AdminCreateCustomerCest.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Customer/Cest/AdminCreateCustomerCest.xml index b0a4cb06c0842fd7c178c6877294123fd430f36e..4e446a838d327c44490731aff20fe4ff4b681513 100644 --- a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Customer/Cest/AdminCreateCustomerCest.xml +++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Customer/Cest/AdminCreateCustomerCest.xml @@ -21,6 +21,7 @@ <testCaseId value="MAGETWO-72095"/> <group value="customer"/> <group value="create"/> + <group value="skip"/> </annotations> <amOnPage url="{{AdminLoginPage.url}}" stepKey="navigateToAdmin"/> <fillField userInput="{{_ENV.MAGENTO_ADMIN_USERNAME}}" selector="{{AdminLoginFormSection.username}}" stepKey="fillUsername"/> diff --git a/dev/tests/integration/testsuite/Magento/Security/Model/Plugin/AuthSessionTest.php b/dev/tests/integration/testsuite/Magento/Security/Model/Plugin/AuthSessionTest.php index 7166779621001bec29d4cb552362ad6835d9dcbc..52268dc96d8a325720b1f824cc0687b28d706a5f 100644 --- a/dev/tests/integration/testsuite/Magento/Security/Model/Plugin/AuthSessionTest.php +++ b/dev/tests/integration/testsuite/Magento/Security/Model/Plugin/AuthSessionTest.php @@ -40,6 +40,11 @@ class AuthSessionTest extends \PHPUnit\Framework\TestCase */ protected $dateTime; + /** + * @var \Magento\Security\Model\ConfigInterface + */ + protected $securityConfig; + /** * Set up */ @@ -54,8 +59,9 @@ class AuthSessionTest extends \PHPUnit\Framework\TestCase $this->authSession = $this->objectManager->create(\Magento\Backend\Model\Auth\Session::class); $this->adminSessionInfo = $this->objectManager->create(\Magento\Security\Model\AdminSessionInfo::class); $this->auth->setAuthStorage($this->authSession); - $this->adminSessionsManager = $this->objectManager->create(\Magento\Security\Model\AdminSessionsManager::class); + $this->adminSessionsManager = $this->objectManager->get(\Magento\Security\Model\AdminSessionsManager::class); $this->dateTime = $this->objectManager->create(\Magento\Framework\Stdlib\DateTime::class); + $this->securityConfig = $this->objectManager->create(\Magento\Security\Model\ConfigInterface::class); } /** @@ -73,7 +79,42 @@ class AuthSessionTest extends \PHPUnit\Framework\TestCase /** * Test of prolong user action + * session manager will not trigger new prolong if previous prolong was less than X sec ago + * X - is calculated based on current admin session lifetime * + * @see \Magento\Security\Model\AdminSessionsManager::lastProlongIsOldEnough + * @magentoDbIsolation enabled + */ + public function testConsecutiveProcessProlong() + { + $this->auth->login( + \Magento\TestFramework\Bootstrap::ADMIN_NAME, + \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD + ); + $sessionId = $this->authSession->getSessionId(); + $prolongsDiff = log($this->securityConfig->getAdminSessionLifetime()) - 2; // X from comment above + $dateInPast = $this->dateTime->formatDate($this->authSession->getUpdatedAt() - $prolongsDiff); + $this->adminSessionsManager->getCurrentSession() + ->setData( + 'updated_at', + $dateInPast + ) + ->save(); + $this->adminSessionInfo->load($sessionId, 'session_id'); + $oldUpdatedAt = $this->adminSessionInfo->getUpdatedAt(); + $this->authSession->prolong(); + $this->adminSessionInfo->load($sessionId, 'session_id'); + $updatedAt = $this->adminSessionInfo->getUpdatedAt(); + + $this->assertSame(strtotime($oldUpdatedAt), strtotime($updatedAt)); + } + + /** + * Test of prolong user action + * session manager will trigger new prolong if previous prolong was more than X sec ago + * X - is calculated based on current admin session lifetime + * + * @see \Magento\Security\Model\AdminSessionsManager::lastProlongIsOldEnough * @magentoDbIsolation enabled */ public function testProcessProlong() @@ -83,7 +124,8 @@ class AuthSessionTest extends \PHPUnit\Framework\TestCase \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD ); $sessionId = $this->authSession->getSessionId(); - $dateInPast = $this->dateTime->formatDate($this->authSession->getUpdatedAt() - 100); + $prolongsDiff = 4 * log($this->securityConfig->getAdminSessionLifetime()) + 2; // X from comment above + $dateInPast = $this->dateTime->formatDate($this->authSession->getUpdatedAt() - $prolongsDiff); $this->adminSessionsManager->getCurrentSession() ->setData( 'updated_at', @@ -95,6 +137,7 @@ class AuthSessionTest extends \PHPUnit\Framework\TestCase $this->authSession->prolong(); $this->adminSessionInfo->load($sessionId, 'session_id'); $updatedAt = $this->adminSessionInfo->getUpdatedAt(); - $this->assertGreaterThan($oldUpdatedAt, $updatedAt); + + $this->assertGreaterThan(strtotime($oldUpdatedAt), strtotime($updatedAt)); } } diff --git a/lib/internal/Magento/Framework/Locale/Config.php b/lib/internal/Magento/Framework/Locale/Config.php index 2a623deca082f8971a5ed5e64a07667ee519c1b1..4db842acedb7e42ae75b2230f936c79b0fbd22f8 100644 --- a/lib/internal/Magento/Framework/Locale/Config.php +++ b/lib/internal/Magento/Framework/Locale/Config.php @@ -89,6 +89,7 @@ class Config implements \Magento\Framework\Locale\ConfigInterface 'sq_AL', /*Albanian (Albania)*/ 'sr_Cyrl_RS', /*Serbian (Serbia)*/ 'sv_SE', /*Swedish (Sweden)*/ + 'sv_FI', /*Swedish (Finland)*/ 'sw_KE', /*Swahili (Kenya)*/ 'th_TH', /*Thai (Thailand)*/ 'tr_TR', /*Turkish (Turkey)*/ diff --git a/lib/internal/Magento/Framework/composer.json b/lib/internal/Magento/Framework/composer.json index 49265774814d964d4897ede372c636c8b04eb1ec..61e36c908eeff3931473163f13c1da11d0c03919 100644 --- a/lib/internal/Magento/Framework/composer.json +++ b/lib/internal/Magento/Framework/composer.json @@ -34,7 +34,8 @@ "zendframework/zend-uri": "^2.5.1", "zendframework/zend-validator": "^2.6.0", "zendframework/zend-stdlib": "^2.7.7", - "zendframework/zend-http": "^2.6.0" + "zendframework/zend-http": "^2.6.0", + "magento/zendframework1": "~1.13.0" }, "suggest": { "ext-imagick": "Use Image Magick >=3.0.0 as an optional alternative image processing library" diff --git a/lib/web/i18n/en_US.csv b/lib/web/i18n/en_US.csv index 5c63a191420a4d2daeebffef9dcab9e886edbd93..4acc62aa6dc81edd1f2b4c6397d577bdd9f3621c 100644 --- a/lib/web/i18n/en_US.csv +++ b/lib/web/i18n/en_US.csv @@ -95,7 +95,7 @@ Submit,Submit "Please enter valid SKU key.","Please enter valid SKU key." "Please enter a valid number.","Please enter a valid number." "This is required field","This is required field" -"Admin is a required field in the each row.","Admin is a required field in the each row." +"Admin is a required field in each row.","Admin is a required field in each row." "Password cannot be the same as email address.","Password cannot be the same as email address." "Please fix this field.","Please fix this field." "Please enter a valid email address.","Please enter a valid email address." diff --git a/lib/web/mage/validation.js b/lib/web/mage/validation.js index fee88826be7eb76adaa906667f48279c64f5452a..2b5aaff8385025d2caf3a5fa505034feee5ca6c5 100644 --- a/lib/web/mage/validation.js +++ b/lib/web/mage/validation.js @@ -1550,15 +1550,15 @@ ], 'required-text-swatch-entry': [ tableSingleValidation, - $.mage.__('Admin is a required field in the each row.') + $.mage.__('Admin is a required field in each row.') ], 'required-visual-swatch-entry': [ tableSingleValidation, - $.mage.__('Admin is a required field in the each row.') + $.mage.__('Admin is a required field in each row.') ], 'required-dropdown-attribute-entry': [ tableSingleValidation, - $.mage.__('Admin is a required field in the each row.') + $.mage.__('Admin is a required field in each row.') ], 'validate-item-quantity': [ function (value, element, params) { diff --git a/setup/performance-toolkit/benchmark.jmx b/setup/performance-toolkit/benchmark.jmx index 154915cd3a4fcb7b9abd2bf5cb304625a50470a3..ef407b9206c0f9ccc899b3ced8c8367fb99ac870 100644 --- a/setup/performance-toolkit/benchmark.jmx +++ b/setup/performance-toolkit/benchmark.jmx @@ -12976,6 +12976,9 @@ vars.put("admin_user", adminUser); //Index of the current product from the cluster Random random = new Random(); + if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); + } int iterator = random.nextInt(clusterLength); if (iterator == 0) { iterator = 1; @@ -32318,7 +32321,7 @@ vars.put("admin_user", adminUser); <stringProp name="RegexExtractor.regex">actions":\{"edit":\{"href":"(?:http|https):\\/\\/(.*?)\\/customer\\/index\\/edit\\/id\\/(\d+)\\/",</stringProp> <stringProp name="RegexExtractor.template">/customer/index/edit/id/$2$/</stringProp> <stringProp name="RegexExtractor.default"/> - <stringProp name="RegexExtractor.match_number">0</stringProp> + <stringProp name="RegexExtractor.match_number">1</stringProp> </RegexExtractor> <hashTree/> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Assert customer edit url" enabled="true"> @@ -34535,6 +34538,9 @@ vars.put("admin_user", adminUser); //Index of the current product from the cluster Random random = new Random(); + if (${seedForRandom} > 0) { + random.setSeed(${seedForRandom} + ${__threadNum}); + } int iterator = random.nextInt(clusterLength); if (iterator == 0) { iterator = 1; diff --git a/setup/src/Magento/Setup/Console/Command/GenerateFixturesCommand.php b/setup/src/Magento/Setup/Console/Command/GenerateFixturesCommand.php index c817d2e07660a35e478747f5156a0d21225089a8..d4f192255c2096768addd41678e0458792112302 100644 --- a/setup/src/Magento/Setup/Console/Command/GenerateFixturesCommand.php +++ b/setup/src/Magento/Setup/Console/Command/GenerateFixturesCommand.php @@ -96,8 +96,10 @@ class GenerateFixturesCommand extends Command $indexerRegistry = $fixtureModel->getObjectManager() ->create(\Magento\Framework\Indexer\IndexerRegistry::class); + $indexersState = []; foreach ($indexerListIds as $indexerId) { $indexer = $indexerRegistry->get($indexerId['indexer_id']); + $indexersState[$indexerId['indexer_id']] = $indexer->isScheduled(); $indexer->setScheduled(true); } @@ -107,6 +109,12 @@ class GenerateFixturesCommand extends Command $this->clearChangelog(); + foreach ($indexerListIds as $indexerId) { + /** @var $indexer \Magento\Indexer\Model\Indexer */ + $indexer = $indexerRegistry->get($indexerId['indexer_id']); + $indexer->setScheduled($indexersState[$indexerId['indexer_id']]); + } + /** @var \Magento\Setup\Fixtures\IndexersStatesApplyFixture $indexerFixture */ $indexerFixture = $fixtureModel ->getFixtureByName(\Magento\Setup\Fixtures\IndexersStatesApplyFixture::class);