diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index f191bd9aaba67..9d66ee40d6f59 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -35,4 +35,4 @@ - [ ] Pull request has a meaningful description of its purpose - [ ] All commits are accompanied by meaningful commit messages - [ ] All new or changed code is covered with unit/integration tests (if applicable) - - [ ] All automated tests passed successfully (all builds on Travis CI are green) + - [ ] All automated tests passed successfully (all builds are green) diff --git a/.travis.yml b/.travis.yml.sample similarity index 100% rename from .travis.yml rename to .travis.yml.sample diff --git a/README.md b/README.md index ecd457a4f1aef..73154c18d891d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ -[![Build Status](https://travis-ci.org/magento/magento2.svg?branch=2.3-develop)](https://travis-ci.org/magento/magento2) [![Open Source Helpers](https://www.codetriage.com/magento/magento2/badges/users.svg)](https://www.codetriage.com/magento/magento2) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/magento/magento2?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![Crowdin](https://d322cqt584bo4o.cloudfront.net/magento-2/localized.svg)](https://crowdin.com/project/magento-2) diff --git a/app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php b/app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php index 059580b9b5eae..030b6e1d2204c 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php +++ b/app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php @@ -15,8 +15,9 @@ use Magento\Catalog\Pricing\Price\CustomOptionPriceInterface; /** - * Product aoptions section abstract block. + * Product options section abstract block. * + * phpcs:disable Magento2.Classes.AbstractApi * @api * @since 100.0.2 */ diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper/AttributeFilter.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper/AttributeFilter.php index 188b0b22f33bf..49165c85f85d7 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper/AttributeFilter.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper/AttributeFilter.php @@ -46,6 +46,8 @@ public function prepareProductAttributes(Product $product, array $productData, a } /** + * Reset "Use Config Settings" to false in product data. + * * @param Product $product * @param string $attributeCode * @param array $productData @@ -62,6 +64,8 @@ private function prepareConfigData(Product $product, string $attributeCode, arra } /** + * Prepare default attribute data for product. + * * @param array $attributeList * @param string $attributeCode * @param array $productData @@ -73,7 +77,7 @@ private function prepareDefaultData(array $attributeList, string $attributeCode, /** @var \Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute */ $attribute = $attributeList[$attributeCode]; $attributeType = $attribute->getBackendType(); - // For non-numberic types set the attributeValue to 'false' to trigger their removal from the db + // For non-numeric types set the attributeValue to 'false' to trigger their removal from the db if ($attributeType === 'varchar' || $attributeType === 'text' || $attributeType === 'datetime') { $attribute->setIsRequired(false); $productData[$attributeCode] = false; @@ -86,6 +90,8 @@ private function prepareDefaultData(array $attributeList, string $attributeCode, } /** + * Check, whether attribute should not be updated. + * * @param Product $product * @param array $useDefaults * @param string $attribute diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php index 76e65400721d9..d8760de2888fb 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php @@ -807,7 +807,7 @@ public function load($printQuery = false, $logQuery = false) } /** - * Processs adding product website names to result collection + * Process adding product website names to result collection * * @return $this */ diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryTest.xml index 8806612c0f5de..15171fe3713c3 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryTest.xml @@ -96,7 +96,7 @@ - + diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/js.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/js.phtml index 195ac92422715..ddcec99f2108c 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/js.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/js.phtml @@ -45,11 +45,11 @@ function checkOptionsPanelVisibility(){ if($('frontend_input') && ($('frontend_input').value=='select' || $('frontend_input').value=='multiselect')){ panel.show(); - panel.addClass(activePanelClass); + jQuery(panel).addClass(activePanelClass); } else { panel.hide(); - panel.removeClass(activePanelClass); + jQuery(panel).removeClass(activePanelClass); } } } diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml index 8fea72764f280..ce34a8d09c302 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml @@ -49,9 +49,9 @@ - + - + diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGCMSTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGCMSTest.xml index 9e5eb2558d6f2..3b501859e606e 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGCMSTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGCMSTest.xml @@ -43,9 +43,9 @@ - + - + diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml index 393e25e474f12..8b18c4eaef5db 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml @@ -37,7 +37,7 @@ - + diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml index 9ee9d27de477a..fc4accf211577 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml @@ -41,7 +41,7 @@ - + diff --git a/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable/Attribute.php b/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable/Attribute.php index e93c44893bf58..1b5ea4d020f8e 100644 --- a/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable/Attribute.php +++ b/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable/Attribute.php @@ -1,7 +1,5 @@ setData('region', $region); + } elseif (!$regionId && is_array($region)) { + $this->setData('region', $regionId); } return $this->getData('region'); diff --git a/app/code/Magento/LayeredNavigation/Test/Mftf/Test/ShopByButtonInMobile.xml b/app/code/Magento/LayeredNavigation/Test/Mftf/Test/ShopByButtonInMobile.xml index 28b937f61ee95..721942f58f7cc 100644 --- a/app/code/Magento/LayeredNavigation/Test/Mftf/Test/ShopByButtonInMobile.xml +++ b/app/code/Magento/LayeredNavigation/Test/Mftf/Test/ShopByButtonInMobile.xml @@ -11,11 +11,11 @@ - - - <description value="Storefront Shop By collapsible button works in a mobile theme"/> + <stories value="Storefront Shop By collapsible button in mobile themes"/> + <title value="Storefront Shop By collapsible button works in a mobile theme"/> + <description value="Storefront Shop By collapsible button should work in a mobile theme"/> <severity value="CRITICAL"/> - <testCaseId value="MAGETWO-94873"/> + <testCaseId value="MC-6092"/> <group value="LayeredNavigation"/> </annotations> <before> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddVariableToWYSIWYGNewsletterTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddVariableToWYSIWYGNewsletterTest.xml index e3d73fb57333e..841d202d518ab 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddVariableToWYSIWYGNewsletterTest.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddVariableToWYSIWYGNewsletterTest.xml @@ -49,9 +49,9 @@ <waitForLoadingMaskToDisappear stepKey="waitForPageLoad3"/> <!--see Insert Variable button disabled--> <see selector="{{VariableSection.InsertVariableBtnDisabled}}" userInput="Insert Variable" stepKey="seeInsertWidgetDisabled" /> - <!--see Cancel button enabed--> + <!--see Cancel button enabled--> <see selector="{{VariableSection.CancelBtnEnabled}}" userInput="Cancel" stepKey="seeCancelBtnEnabled" /> - <!--see 4 colums--> + <!--see 4 columns--> <see selector="{{VariableSection.ColName('Select')}}" userInput="Select" stepKey="selectCol" /> <see selector="{{VariableSection.ColName('Variable Name')}}" userInput="Variable Name" stepKey="variableCol" /> <see selector="{{VariableSection.ColName('Type')}}" userInput="Type" stepKey="typeCol" /> diff --git a/app/code/Magento/Paypal/Test/Unit/Model/AbstractConfigTest.php b/app/code/Magento/Paypal/Test/Unit/Model/AbstractConfigTest.php index 6bb2173e06f8d..7c528e5718c3b 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/AbstractConfigTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/AbstractConfigTest.php @@ -109,8 +109,8 @@ public function testGetValue($key, $method, $returnMap, $expectedValue) /** * - * @case #1 This conf parameters must return AbstractConfig::PAYMENT_ACTION_SALE (isWppApiAvailabe == false) - * @case #2 This conf parameters must return configValue (isWppApiAvailabe == true) + * @case #1 This conf parameters must return AbstractConfig::PAYMENT_ACTION_SALE (isWppApiAvailable == false) + * @case #2 This conf parameters must return configValue (isWppApiAvailable == true) * @case #3 This conf parameters must return configValue ($key != 'payment_action') * @case #4 This conf parameters must return configValue (configValue == 'Sale') * @case #5 This conf parameters must return configValue (shouldUseUnilateralPayments == false) diff --git a/app/code/Magento/Reports/Model/Product/Index/AbstractIndex.php b/app/code/Magento/Reports/Model/Product/Index/AbstractIndex.php index 7337286149cc3..78b6b7d6c9ab7 100644 --- a/app/code/Magento/Reports/Model/Product/Index/AbstractIndex.php +++ b/app/code/Magento/Reports/Model/Product/Index/AbstractIndex.php @@ -7,8 +7,11 @@ /** * Reports Product Index Abstract Model + * + * phpcs:disable Magento2.Classes.AbstractApi * @api * @since 100.0.2 + * @SuppressWarnings(PHPMD.CookieAndSessionMisuse) */ abstract class AbstractIndex extends \Magento\Framework\Model\AbstractModel { @@ -156,7 +159,7 @@ public function getStoreId() } /** - * On customer loggin merge visitor/customer index + * On customer login merge visitor/customer index * * @return $this */ diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create/Adjustments.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create/Adjustments.php index 9e13e9424d1fd..50d29c195968c 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create/Adjustments.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create/Adjustments.php @@ -8,7 +8,7 @@ use Magento\Framework\Pricing\PriceCurrencyInterface; /** - * Credit memo adjustmets block + * Credit memo adjustments block * * @api * @since 100.0.2 diff --git a/app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php b/app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php index 85e34f560bb7b..723940a5f67c0 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php @@ -11,6 +11,7 @@ /** * Sales Order PDF abstract model * + * phpcs:disable Magento2.Classes.AbstractApi * @api * @SuppressWarnings(PHPMD.ExcessiveClassComplexity) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) @@ -116,6 +117,11 @@ abstract public function getPdf(); */ protected $addressRenderer; + /** + * @var array $pageSettings + */ + private $pageSettings; + /** * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Framework\Stdlib\StringUtils $string @@ -172,10 +178,12 @@ public function __construct( */ public function widthForStringUsingFontSize($string, $font, $fontSize) { + // phpcs:ignore Generic.PHP.NoSilencedErrors $drawingString = '"libiconv"' == ICONV_IMPL ? iconv( 'UTF-8', 'UTF-16BE//IGNORE', $string + // phpcs:ignore Generic.PHP.NoSilencedErrors ) : @iconv( 'UTF-8', 'UTF-16BE', @@ -183,7 +191,10 @@ public function widthForStringUsingFontSize($string, $font, $fontSize) ); $characters = []; - for ($i = 0; $i < strlen($drawingString); $i++) { + + $drawingStringLength = strlen($drawingString); + + for ($i = 0; $i < $drawingStringLength; $i++) { $characters[] = ord($drawingString[$i++]) << 8 | ord($drawingString[$i]); } $glyphs = $font->glyphNumbersForCharacters($characters); @@ -224,14 +235,14 @@ public function getAlignCenter($string, $x, $columnWidth, \Zend_Pdf_Resource_Fon $width = $this->widthForStringUsingFontSize($string, $font, $fontSize); return $x + round(($columnWidth - $width) / 2); } - /** * Insert logo to pdf page * - * @param \Zend_Pdf_Page &$page + * @param \Zend_Pdf_Page $page * @param string|null $store * @return void * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @throws \Zend_Pdf_Exception */ protected function insertLogo(&$page, $store = null) { @@ -283,7 +294,7 @@ protected function insertLogo(&$page, $store = null) /** * Insert address to pdf page * - * @param \Zend_Pdf_Page &$page + * @param \Zend_Pdf_Page $page * @param string|null $store * @return void */ @@ -364,9 +375,9 @@ protected function _calcAddressHeight($address) } /** - * Insert order to pdf page + * Insert order to pdf page. * - * @param \Zend_Pdf_Page &$page + * @param \Zend_Pdf_Page $page * @param \Magento\Sales\Model\Order $obj * @param bool $putOrderId * @return void @@ -511,7 +522,7 @@ protected function insertOrder(&$page, $obj, $putOrderId = true) $this->y -= 15; $this->_setFontBold($page, 12); $page->setFillColor(new \Zend_Pdf_Color_GrayScale(0)); - $page->drawText(__('Payment Method'), 35, $this->y, 'UTF-8'); + $page->drawText(__('Payment Method:'), 35, $this->y, 'UTF-8'); $page->drawText(__('Shipping Method:'), 285, $this->y, 'UTF-8'); $this->y -= 10; @@ -964,9 +975,11 @@ public function newPage(array $settings = []) * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + * @SuppressWarnings(PHPMD.UnusedLocalVariable) */ public function drawLineBlocks(\Zend_Pdf_Page $page, array $draw, array $pageSettings = []) { + $this->pageSettings = $pageSettings; foreach ($draw as $itemsProp) { if (!isset($itemsProp['lines']) || !is_array($itemsProp['lines'])) { throw new \Magento\Framework\Exception\LocalizedException( @@ -975,7 +988,6 @@ public function drawLineBlocks(\Zend_Pdf_Page $page, array $draw, array $pageSet } $lines = $itemsProp['lines']; $height = isset($itemsProp['height']) ? $itemsProp['height'] : 10; - if (empty($itemsProp['shift'])) { $shift = 0; foreach ($lines as $line) { @@ -986,6 +998,7 @@ public function drawLineBlocks(\Zend_Pdf_Page $page, array $draw, array $pageSet $column['text'] = [$column['text']]; } $top = 0; + // foreach ($column['text'] as $part) { $top += $lineSpacing; } @@ -1000,69 +1013,99 @@ public function drawLineBlocks(\Zend_Pdf_Page $page, array $draw, array $pageSet if ($this->y - $itemsProp['shift'] < 15) { $page = $this->newPage($pageSettings); } + $this->correctLines($lines, $page, $height); + } - foreach ($lines as $line) { - $maxHeight = 0; - foreach ($line as $column) { - $fontSize = empty($column['font_size']) ? 10 : $column['font_size']; - if (!empty($column['font_file'])) { - $font = \Zend_Pdf_Font::fontWithPath($column['font_file']); - $page->setFont($font, $fontSize); - } else { - $fontStyle = empty($column['font']) ? 'regular' : $column['font']; - switch ($fontStyle) { - case 'bold': - $font = $this->_setFontBold($page, $fontSize); - break; - case 'italic': - $font = $this->_setFontItalic($page, $fontSize); - break; - default: - $font = $this->_setFontRegular($page, $fontSize); - break; - } - } - - if (!is_array($column['text'])) { - $column['text'] = [$column['text']]; - } - - $lineSpacing = !empty($column['height']) ? $column['height'] : $height; - $top = 0; - foreach ($column['text'] as $part) { - if ($this->y - $lineSpacing < 15) { - $page = $this->newPage($pageSettings); - } + return $page; + } - $feed = $column['feed']; - $textAlign = empty($column['align']) ? 'left' : $column['align']; - $width = empty($column['width']) ? 0 : $column['width']; - switch ($textAlign) { - case 'right': - if ($width) { - $feed = $this->getAlignRight($part, $feed, $width, $font, $fontSize); - } else { - $feed = $feed - $this->widthForStringUsingFontSize($part, $font, $fontSize); - } - break; - case 'center': - if ($width) { - $feed = $this->getAlignCenter($part, $feed, $width, $font, $fontSize); - } - break; - default: - break; - } - $page->drawText($part, $feed, $this->y - $top, 'UTF-8'); - $top += $lineSpacing; + /** + * Correct lines. + * + * @param array $lines + * @param \Zend_Pdf_Page $page + * @param int $height + * @throws \Zend_Pdf_Exception + * @SuppressWarnings(PHPMD.CyclomaticComplexity) + */ + private function correctLines($lines, $page, $height) :void + { + foreach ($lines as $line) { + $maxHeight = 0; + foreach ($line as $column) { + $fontSize = empty($column['font_size']) ? 10 : $column['font_size']; + if (!empty($column['font_file'])) { + $font = \Zend_Pdf_Font::fontWithPath($column['font_file']); + $page->setFont($font, $fontSize); + } else { + $fontStyle = empty($column['font']) ? 'regular' : $column['font']; + switch ($fontStyle) { + case 'bold': + $font = $this->_setFontBold($page, $fontSize); + break; + case 'italic': + $font = $this->_setFontItalic($page, $fontSize); + break; + default: + $font = $this->_setFontRegular($page, $fontSize); + break; } + } - $maxHeight = $top > $maxHeight ? $top : $maxHeight; + if (!is_array($column['text'])) { + $column['text'] = [$column['text']]; } - $this->y -= $maxHeight; + $top = $this->correctText($column, $height, $font, $page); + + $maxHeight = $top > $maxHeight ? $top : $maxHeight; } + $this->y -= $maxHeight; } + } - return $page; + /** + * Correct text. + * + * @param array $column + * @param int $height + * @param \Zend_Pdf_Resource_Font $font + * @param \Zend_Pdf_Page $page + * @throws \Zend_Pdf_Exception + * @return int + * @SuppressWarnings(PHPMD.CyclomaticComplexity) + */ + private function correctText($column, $height, $font, $page) :int + { + $top = 0; + $lineSpacing = !empty($column['height']) ? $column['height'] : $height; + $fontSize = empty($column['font_size']) ? 10 : $column['font_size']; + foreach ($column['text'] as $part) { + if ($this->y - $lineSpacing < 15) { + $page = $this->newPage($this->pageSettings); + } + + $feed = $column['feed']; + $textAlign = empty($column['align']) ? 'left' : $column['align']; + $width = empty($column['width']) ? 0 : $column['width']; + switch ($textAlign) { + case 'right': + if ($width) { + $feed = $this->getAlignRight($part, $feed, $width, $font, $fontSize); + } else { + $feed = $feed - $this->widthForStringUsingFontSize($part, $font, $fontSize); + } + break; + case 'center': + if ($width) { + $feed = $this->getAlignCenter($part, $feed, $width, $font, $fontSize); + } + break; + default: + break; + } + $page->drawText($part, $feed, $this->y - $top, 'UTF-8'); + $top += $lineSpacing; + } + return $top; } } diff --git a/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/account.phtml b/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/account.phtml index 0d2ee1f24d5b3..f7d5f4aa8aa33 100644 --- a/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/account.phtml +++ b/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/account.phtml @@ -5,16 +5,16 @@ */ ?> -<div class="admin__page-section-title <?= /* @escapeNotVerified */ $block->getHeaderCssClass() ?>"> - <span class="title"><?= /* @escapeNotVerified */ $block->getHeaderText() ?></span> +<div class="admin__page-section-title <?= /* @noEscape */ $block->getHeaderCssClass() ?>"> + <span class="title"><?= /* @noEscape */ $block->getHeaderText() ?></span> <div class="actions"></div> </div> -<div id="customer_account_fieds" class="admin__page-section-content"> +<div id="customer_account_fields" class="admin__page-section-content"> <?= $block->getForm()->getHtml() ?> </div> <script> require(["prototype", "Magento_Sales/order/create/form"], function(){ - order.accountFieldsBind($('customer_account_fieds')); + order.accountFieldsBind($('customer_account_fields')); }); </script> diff --git a/app/code/Magento/SalesRule/Model/Quote/Address/Total/ShippingDiscount.php b/app/code/Magento/SalesRule/Model/Quote/Address/Total/ShippingDiscount.php index c37ca276e0ee2..53adcd268f81d 100644 --- a/app/code/Magento/SalesRule/Model/Quote/Address/Total/ShippingDiscount.php +++ b/app/code/Magento/SalesRule/Model/Quote/Address/Total/ShippingDiscount.php @@ -89,7 +89,7 @@ public function fetch(Quote $quote, Total $total): array $amount = $total->getDiscountAmount(); if ($amount != 0) { - $description = $total->getDiscountDescription() ?: ''; + $description = (string)$total->getDiscountDescription() ?: ''; $result = [ 'code' => DiscountCollector::COLLECTOR_TYPE_CODE, 'title' => strlen($description) ? __('Discount (%1)', $description) : __('Discount'), diff --git a/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/main/_collapsible-blocks.less b/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/main/_collapsible-blocks.less index dec35d1364836..a43f9acbaa099 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/main/_collapsible-blocks.less +++ b/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/main/_collapsible-blocks.less @@ -105,11 +105,16 @@ // .admin__collapsible-block-wrapper { + .admin__collapsible-title[aria-expanded='true'] { + &:before { + content: @icon-expand-close__content; + } + } + .__collapsible-block-wrapper-pattern(); .admin__collapsible-title { .__collapsible-title-pattern(); } - &.opened, &._show { > .fieldset-wrapper-title { diff --git a/dev/tests/integration/.gitignore b/dev/tests/integration/.gitignore index 7f8540b3c7710..c4d6c1a77a9cc 100644 --- a/dev/tests/integration/.gitignore +++ b/dev/tests/integration/.gitignore @@ -2,3 +2,4 @@ !/etc/integration-tests-config.xml /var/ /etc/*.php +/framework/tests/unit/var/allure-results/ diff --git a/dev/tests/integration/testsuite/Magento/Quote/Model/Quote/AddressTest.php b/dev/tests/integration/testsuite/Magento/Quote/Model/Quote/AddressTest.php index 62e417d27c51b..545638bcb0c57 100644 --- a/dev/tests/integration/testsuite/Magento/Quote/Model/Quote/AddressTest.php +++ b/dev/tests/integration/testsuite/Magento/Quote/Model/Quote/AddressTest.php @@ -25,6 +25,15 @@ class AddressTest extends \Magento\TestFramework\Indexer\TestCase /**@var \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository */ protected $customerRepository; + /** @var \Magento\Customer\Api\AddressRepositoryInterface $addressRepository */ + protected $addressRepository; + + /** @var \Magento\Framework\Reflection\DataObjectProcessor */ + protected $dataProcessor; + + /** + * phpcs:ignoreFile + */ public static function setUpBeforeClass() { $db = \Magento\TestFramework\Helper\Bootstrap::getInstance()->getBootstrap() @@ -61,6 +70,14 @@ public function setUp() $this->_address->setId(1); $this->_address->load($this->_address->getId()); $this->_address->setQuote($this->_quote); + + $this->addressRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Customer\Api\AddressRepositoryInterface::class + ); + + $this->dataProcessor = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Framework\Reflection\DataObjectProcessor::class + ); } protected function tearDown() @@ -322,4 +339,23 @@ public function dataProvider() [[123, true], [123, true]] ]; } + + public function testSaveShippingAddressWithEmptyRegionId() + { + $customerAddress = $this->addressRepository->getById(1); + $customerAddress->setRegionId(0); + + $address = $this->dataProcessor->buildOutputDataArray( + $customerAddress, + \Magento\Customer\Api\Data\AddressInterface::class + ); + + $shippingAddress = $this->_quote->getShippingAddress(); + $shippingAddress->addData($address); + + $shippingAddress->save(); + + $this->assertEquals(0, $shippingAddress->getRegionId()); + $this->assertEquals(0, $shippingAddress->getRegion()); + } } diff --git a/dev/tests/static/.gitignore b/dev/tests/static/.gitignore index 651969a59ce46..175be896e8def 100644 --- a/dev/tests/static/.gitignore +++ b/dev/tests/static/.gitignore @@ -1,4 +1,6 @@ /*.xml -framework/tests/unit/*.xml -report/ -tmp/ +/framework/tests/unit/*.xml +/framework/tests/unit/var/allure-results/ +/report/ +/tmp/ +/var/allure-results/ diff --git a/dev/tests/unit/.gitignore b/dev/tests/unit/.gitignore index 319b3826f9338..944850d16608e 100644 --- a/dev/tests/unit/.gitignore +++ b/dev/tests/unit/.gitignore @@ -1 +1,2 @@ /phpunit.xml +/var/allure-results/ diff --git a/lib/web/css/docs/source/_rating.less b/lib/web/css/docs/source/_rating.less index 88de27b24cb87..6f7ec12b77bff 100644 --- a/lib/web/css/docs/source/_rating.less +++ b/lib/web/css/docs/source/_rating.less @@ -236,7 +236,7 @@ // # Accessible rating with vote // -// The following markup corresponds to **accesibility** demands +// The following markup corresponds to **accessibility** demands // ``` html // <fieldset class="exapmle-ratings-5 fieldset ratings vote"> // <legend>How do you rate this product?</legend>