Skip to content

Commit fcbb2b9

Browse files
committed
Merge remote-tracking branch 'mainline/2.3-develop' into MAGETWO-97411
2 parents 11d55a9 + 2c31192 commit fcbb2b9

File tree

55 files changed

+474
-113
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+474
-113
lines changed

app/code/Magento/Backend/Test/Mftf/Section/AdminMainActionsSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
<element name="save" type="button" selector="#save" timeout="30"/>
1313
<element name="saveAndContinue" type="button" selector="button[id*=save_and_continue]" timeout="30"/>
1414
<element name="delete" type="button" selector="#delete" timeout="30"/>
15+
<element name="add" type="button" selector="#add" timeout="30"/>
1516
</section>
1617
</sections>

app/code/Magento/Backend/view/adminhtml/templates/widget/tabshoriz.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<?php $_tabType = (!preg_match('/\s?ajax\s?/', $_tabClass) && $block->getTabUrl($_tab) != '#') ? 'link' : '' ?>
1919
<?php $_tabHref = $block->getTabUrl($_tab) == '#' ? '#' . $block->getTabId($_tab) . '_content' : $block->getTabUrl($_tab) ?>
2020
<li>
21-
<a href="<?= /* @escapeNotVerified */ $_tabHref ?>" id="<?= /* @escapeNotVerified */ $block->getTabId($_tab) ?>" title="<?= /* @escapeNotVerified */ $block->getTabTitle($_tab) ?>" class="<?php $_tabClass ?>" data-tab-type="<?php $_tabType ?>">
21+
<a href="<?= $block->escapeHtmlAttr($_tabHref) ?>" id="<?= $block->escapeHtmlAttr($block->getTabId($_tab)) ?>" title="<?= $block->escapeHtmlAttr($block->getTabTitle($_tab)) ?>" class="<?= $block->escapeHtmlAttr($_tabClass) ?>" data-tab-type="<?= $block->escapeHtmlAttr($_tabType) ?>">
2222
<span>
2323
<span class="changed" title="<?= /* @escapeNotVerified */ __('The information in this tab has been changed.') ?>"></span>
2424
<span class="error" title="<?= /* @escapeNotVerified */ __('This tab contains invalid data. Please resolve this before saving.') ?>"></span>

app/code/Magento/Bundle/Test/Mftf/ActionGroup/EnableDisableProductActionGroup.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
<fillField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{BundleProduct.sku}}" stepKey="fillProductSku"/>
1515

1616
<!--Trigger SEO drop down-->
17-
<conditionalClick selector="{{AdminProductFormBundleSection.seoDropdown}}" dependentSelector="{{AdminProductFormBundleSection.seoDependent}}" visible="false" stepKey="OpenDropDownIfClosed"/>
17+
<scrollTo selector="{{AdminProductFormBundleSection.seoDropdown}}" stepKey="moveToSEOSection"/>
18+
<conditionalClick selector="{{AdminProductFormBundleSection.seoDropdown}}" dependentSelector="{{AdminProductFormBundleSection.urlKey}}" visible="false" stepKey="openDropDownIfClosed"/>
1819
<waitForPageLoad stepKey="WaitForDropDownSEO"/>
1920

2021
<!--Fill URL input-->

app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProducts.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@
9999
<fillField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{BundleProduct.sku2}}" stepKey="fillProductSku2"/>
100100

101101
<!--Trigger SEO drop down-->
102-
<conditionalClick selector="{{AdminProductFormBundleSection.seoDropdown}}" dependentSelector="{{AdminProductFormBundleSection.seoDependent}}" visible="false" stepKey="OpenDropDownIfClosed2"/>
103-
<waitForPageLoad stepKey="WaitForDropDownSEO"/>
102+
<scrollTo selector="{{AdminProductFormBundleSection.seoDropdown}}" stepKey="moveToSEOSection"/>
103+
<conditionalClick selector="{{AdminProductFormBundleSection.seoDropdown}}" dependentSelector="{{AdminProductFormBundleSection.urlKey}}" visible="false" stepKey="openDropDownIfClosed"/>
104104

105105
<!--Fill URL input-->
106106
<fillField userInput="{{BundleProduct.urlKey2}}" selector="{{AdminProductFormBundleSection.urlKey}}" stepKey="FillsinSEOlinkExtension2"/>

app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,7 @@
6060
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/>
6161
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/>
6262

63-
<fillField selector="{{AdminProductFormBundleSection.productName}}" userInput="{{BundleProduct.name}}" stepKey="fillProductName"/>
64-
<fillField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{BundleProduct.sku}}" stepKey="fillProductSku"/>
65-
66-
<!--Trigger SEO drop down-->
67-
<conditionalClick selector="{{AdminProductFormBundleSection.seoDropdown}}" dependentSelector="{{AdminProductFormBundleSection.seoDependent}}" visible="false" stepKey="OpenDropDownIfClosed"/>
68-
<waitForPageLoad stepKey="WaitForDropDownSEO"/>
69-
70-
<!--Fill URL input-->
71-
<fillField userInput="{{BundleProduct.urlKey}}" selector="{{AdminProductFormBundleSection.urlKey}}" stepKey="FillsinSEOlinkExtension"/>
63+
<actionGroup ref="AncillaryPrepBundleProduct" stepKey="createBundledProductForTwoSimpleProducts"/>
7264

7365
<!--Save the product-->
7466
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/>
@@ -104,7 +96,8 @@
10496
<fillField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{BundleProduct.sku2}}" stepKey="fillProductSku2"/>
10597

10698
<!--Trigger SEO drop down-->
107-
<conditionalClick selector="{{AdminProductFormBundleSection.seoDropdown}}" dependentSelector="{{AdminProductFormBundleSection.seoDependent}}" visible="false" stepKey="OpenDropDownIfClosed2"/>
99+
<scrollTo selector="{{AdminProductFormBundleSection.seoDropdown}}" stepKey="moveToSEOSection"/>
100+
<conditionalClick selector="{{AdminProductFormBundleSection.seoDropdown}}" dependentSelector="{{AdminProductFormBundleSection.urlKey}}" visible="false" stepKey="openDropDownIfClosed"/>
108101
<waitForPageLoad stepKey="WaitForDropDownSEO2"/>
109102

110103
<!--Fill URL input-->
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
declare(strict_types=1);
8+
9+
namespace Magento\Catalog\Block\Product\View;
10+
11+
/**
12+
* Product details block.
13+
*
14+
* Holds a group of blocks to show as tabs.
15+
*
16+
* @api
17+
*/
18+
class Details extends \Magento\Framework\View\Element\Template
19+
{
20+
/**
21+
* Get sorted child block names.
22+
*
23+
* @param string $groupName
24+
* @param string $callback
25+
* @throws \Magento\Framework\Exception\LocalizedException
26+
*
27+
* @return array
28+
*/
29+
public function getGroupSortedChildNames(string $groupName, string $callback): array
30+
{
31+
$groupChildNames = $this->getGroupChildNames($groupName, $callback);
32+
$layout = $this->getLayout();
33+
34+
$childNamesSortOrder = [];
35+
36+
foreach ($groupChildNames as $childName) {
37+
$alias = $layout->getElementAlias($childName);
38+
$sortOrder = (int)$this->getChildData($alias, 'sort_order') ?? 0;
39+
40+
$childNamesSortOrder[$sortOrder] = $childName;
41+
}
42+
43+
ksort($childNamesSortOrder, SORT_NUMERIC);
44+
45+
return $childNamesSortOrder;
46+
}
47+
}

app/code/Magento/Catalog/Model/Product/Option/Type/Select.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function validateUserValue($values)
7171
}
7272
if (!$this->_isSingleSelection()) {
7373
$valuesCollection = $option->getOptionValuesByOptionId($value, $this->getProduct()->getStoreId())->load();
74-
$valueCount = is_array($value) ? count($value) : 1;
74+
$valueCount = is_array($value) ? count($value) : 0;
7575
if ($valuesCollection->count() != $valueCount) {
7676
$this->setIsValid(false);
7777
throw new LocalizedException(

app/code/Magento/Catalog/view/frontend/layout/catalog_product_view.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,19 +136,21 @@
136136
</arguments>
137137
</block>
138138
</container>
139-
<block class="Magento\Catalog\Block\Product\View\Description" name="product.info.details" template="Magento_Catalog::product/view/details.phtml" after="product.info.media">
139+
<block class="Magento\Catalog\Block\Product\View\Details" name="product.info.details" template="Magento_Catalog::product/view/details.phtml" after="product.info.media">
140140
<block class="Magento\Catalog\Block\Product\View\Description" name="product.info.description" as="description" template="Magento_Catalog::product/view/attribute.phtml" group="detailed_info">
141141
<arguments>
142142
<argument name="at_call" xsi:type="string">getDescription</argument>
143143
<argument name="at_code" xsi:type="string">description</argument>
144144
<argument name="css_class" xsi:type="string">description</argument>
145145
<argument name="at_label" xsi:type="string">none</argument>
146146
<argument name="title" translate="true" xsi:type="string">Details</argument>
147+
<argument name="sort_order" xsi:type="string">10</argument>
147148
</arguments>
148149
</block>
149150
<block class="Magento\Catalog\Block\Product\View\Attributes" name="product.attributes" as="additional" template="Magento_Catalog::product/view/attributes.phtml" group="detailed_info">
150151
<arguments>
151152
<argument translate="true" name="title" xsi:type="string">More Information</argument>
153+
<argument name="sort_order" xsi:type="string">20</argument>
152154
</arguments>
153155
</block>
154156
</block>

app/code/Magento/Catalog/view/frontend/templates/product/view/details.phtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66

77
// @codingStandardsIgnoreFile
88

9+
/** @var \Magento\Catalog\Block\Product\View\Details $block */
910
?>
10-
<?php if ($detailedInfoGroup = $block->getGroupChildNames('detailed_info', 'getChildHtml')):?>
11+
<?php if ($detailedInfoGroup = $block->getGroupSortedChildNames('detailed_info', 'getChildHtml')):?>
1112
<div class="product info detailed">
1213
<?php $layout = $block->getLayout(); ?>
1314
<div class="product data items" data-mage-init='{"tabs":{"openedState":"active"}}'>

app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/price-configurable.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ define([
5353
if (isConfigurable) {
5454
this.disable();
5555
this.clear();
56+
} else {
57+
this.enable();
5658
}
5759
}
5860
});

app/code/Magento/Eav/Model/Attribute/Data/AbstractData.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ public function setRequestScope($scope)
143143

144144
/**
145145
* Set scope visibility
146+
*
146147
* Search value only in scope or search value in scope and global
147148
*
148149
* @param bool $flag
@@ -296,7 +297,7 @@ protected function _applyOutputFilter($value)
296297
* Validate value by attribute input validation rule
297298
*
298299
* @param string $value
299-
* @return string|true
300+
* @return array|true
300301
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
301302
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
302303
*/

app/code/Magento/Eav/Model/Attribute/Data/Text.php

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,17 @@ public function validateValue($value)
7272
return true;
7373
}
7474

75-
if (empty($value) && $value !== '0') {
75+
if (empty($value) && $value !== '0' && $attribute->getDefaultValue() === null) {
7676
$label = __($attribute->getStoreLabel());
7777
$errors[] = __('"%1" is a required value.', $label);
7878
}
7979

80-
$result = $this->validateLength($attribute, $value);
81-
if (count($result) !== 0) {
82-
$errors = array_merge($errors, $result);
83-
}
80+
$validateLengthResult = $this->validateLength($attribute, $value);
81+
$errors = array_merge($errors, $validateLengthResult);
82+
83+
$validateInputRuleResult = $this->validateInputRule($value);
84+
$errors = array_merge($errors, $validateInputRuleResult);
8485

85-
$result = $this->_validateInputRule($value);
86-
if ($result !== true) {
87-
$errors = array_merge($errors, $result);
88-
}
8986
if (count($errors) == 0) {
9087
return true;
9188
}
@@ -141,7 +138,7 @@ public function outputValue($format = \Magento\Eav\Model\AttributeDataFactory::O
141138
* @param string $value
142139
* @return array errors
143140
*/
144-
private function validateLength(\Magento\Eav\Model\Attribute $attribute, $value): array
141+
private function validateLength(\Magento\Eav\Model\Attribute $attribute, string $value): array
145142
{
146143
$errors = [];
147144
$length = $this->_string->strlen(trim($value));
@@ -162,4 +159,16 @@ private function validateLength(\Magento\Eav\Model\Attribute $attribute, $value)
162159

163160
return $errors;
164161
}
162+
163+
/**
164+
* Validate value by attribute input validation rule.
165+
*
166+
* @param string $value
167+
* @return array
168+
*/
169+
private function validateInputRule(string $value): array
170+
{
171+
$result = $this->_validateInputRule($value);
172+
return \is_array($result) ? $result : [];
173+
}
165174
}

app/code/Magento/Reports/Controller/Adminhtml/Report/Statistics.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,19 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
/**
8-
* Report statistics admin controller
9-
*
10-
* @author Magento Core Team <[email protected]>
11-
*/
127
namespace Magento\Reports\Controller\Adminhtml\Report;
138

149
use Magento\Backend\Model\Auth\Session as AuthSession;
1510
use Magento\Backend\Model\Session;
11+
use Magento\Framework\App\Action\HttpGetActionInterface;
1612

1713
/**
14+
* Report statistics admin controller.
15+
*
1816
* @api
1917
* @since 100.0.2
2018
*/
21-
abstract class Statistics extends \Magento\Backend\App\Action
19+
abstract class Statistics extends \Magento\Backend\App\Action implements HttpGetActionInterface
2220
{
2321
/**
2422
* Authorization level of a basic admin session
@@ -49,7 +47,7 @@ abstract class Statistics extends \Magento\Backend\App\Action
4947
/**
5048
* @param \Magento\Backend\App\Action\Context $context
5149
* @param \Magento\Framework\Stdlib\DateTime\Filter\Date $dateFilter
52-
* @param [] $reportTypes
50+
* @param array $reportTypes
5351
*/
5452
public function __construct(
5553
\Magento\Backend\App\Action\Context $context,

app/code/Magento/Reports/Model/ResourceModel/Order/Collection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class Collection extends \Magento\Sales\Model\ResourceModel\Order\Collection
8181
* @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate
8282
* @param \Magento\Sales\Model\Order\Config $orderConfig
8383
* @param \Magento\Sales\Model\ResourceModel\Report\OrderFactory $reportOrderFactory
84-
* @param null $connection
84+
* @param \Magento\Framework\DB\Adapter\AdapterInterface $connection
8585
* @param \Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource
8686
*
8787
* @SuppressWarnings(PHPMD.ExcessiveParameterList)

app/code/Magento/Reports/Observer/CatalogProductCompareClearObserver.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class CatalogProductCompareClearObserver implements ObserverInterface
2424

2525
/**
2626
* @param \Magento\Reports\Model\Product\Index\ComparedFactory $productCompFactory
27+
* @param \Magento\Reports\Model\ReportStatus $reportStatus
2728
*/
2829
public function __construct(
2930
\Magento\Reports\Model\Product\Index\ComparedFactory $productCompFactory,
@@ -39,7 +40,7 @@ public function __construct(
3940
* Reset count of compared products cache
4041
*
4142
* @param \Magento\Framework\Event\Observer $observer
42-
* @return $this
43+
* @return void
4344
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
4445
*/
4546
public function execute(\Magento\Framework\Event\Observer $observer)

app/code/Magento/Reports/Observer/CatalogProductViewObserver.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
/**
1212
* Reports Event observer model
13+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
1314
*/
1415
class CatalogProductViewObserver implements ObserverInterface
1516
{
@@ -49,6 +50,7 @@ class CatalogProductViewObserver implements ObserverInterface
4950
* @param \Magento\Customer\Model\Session $customerSession
5051
* @param \Magento\Customer\Model\Visitor $customerVisitor
5152
* @param EventSaver $eventSaver
53+
* @param \Magento\Reports\Model\ReportStatus $reportStatus
5254
*/
5355
public function __construct(
5456
\Magento\Store\Model\StoreManagerInterface $storeManager,

app/code/Magento/Reports/Observer/CheckoutCartAddProductObserver.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class CheckoutCartAddProductObserver implements ObserverInterface
2525

2626
/**
2727
* @param EventSaver $eventSaver
28+
* @param \Magento\Reports\Model\ReportStatus $reportStatus
2829
*/
2930
public function __construct(
3031
EventSaver $eventSaver,

app/code/Magento/Reports/Observer/CustomerLogoutObserver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function __construct(
3838
* Customer logout processing
3939
*
4040
* @param \Magento\Framework\Event\Observer $observer
41-
* @return $this
41+
* @return void
4242
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
4343
*/
4444
public function execute(\Magento\Framework\Event\Observer $observer)

app/code/Magento/Reports/Observer/SendfriendProductObserver.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class SendfriendProductObserver implements ObserverInterface
2525

2626
/**
2727
* @param EventSaver $eventSaver
28+
* @param \Magento\Reports\Model\ReportStatus $reportStatus
2829
*/
2930
public function __construct(
3031
EventSaver $eventSaver,

app/code/Magento/Reports/Observer/WishlistAddProductObserver.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class WishlistAddProductObserver implements ObserverInterface
2525

2626
/**
2727
* @param EventSaver $eventSaver
28+
* @param \Magento\Reports\Model\ReportStatus $reportStatus
2829
*/
2930
public function __construct(
3031
EventSaver $eventSaver,

app/code/Magento/Reports/Observer/WishlistShareObserver.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class WishlistShareObserver implements ObserverInterface
2525

2626
/**
2727
* @param EventSaver $eventSaver
28+
* @param \Magento\Reports\Model\ReportStatus $reportStatus
2829
*/
2930
public function __construct(
3031
EventSaver $eventSaver,

app/code/Magento/Review/view/frontend/layout/catalog_product_view.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
</referenceContainer>
2020
<referenceBlock name="product.info.details">
2121
<block class="Magento\Review\Block\Product\Review" name="reviews.tab" as="reviews" template="Magento_Review::review.phtml" group="detailed_info" ifconfig="catalog/review/active">
22+
<arguments>
23+
<argument name="sort_order" xsi:type="string">30</argument>
24+
</arguments>
2225
<block class="Magento\Review\Block\Form" name="product.review.form" as="review_form" ifconfig="catalog/review/active">
2326
<container name="product.review.form.fields.before" as="form_fields_before" label="Review Form Fields Before"/>
2427
</block>

app/code/Magento/Ui/view/base/web/js/form/components/fieldset.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ define([
162162
}
163163

164164
this.error(hasErrors || message);
165+
166+
if (hasErrors || message) {
167+
this.open();
168+
}
165169
},
166170

167171
/**

app/code/Magento/Ui/view/base/web/js/form/element/abstract.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ define([
408408
isValid = this.disabled() || !this.visible() || result.passed;
409409

410410
this.error(message);
411+
this.error.valueHasMutated();
411412
this.bubble('error', message);
412413

413414
//TODO: Implement proper result propagation for form

app/code/Magento/Ui/view/base/web/templates/grid/filters/elements/ui-select.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
class="action-select admin__action-multiselect"
3737
data-role="advanced-select"
3838
data-bind="
39-
css: {_active: multiselectFocus},
39+
css: {_active: listVisible},
4040
click: function(data, event) {
4141
toggleListVisible(data, event)
4242
}
@@ -73,7 +73,7 @@
7373
class="action-select admin__action-multiselect"
7474
data-role="advanced-select"
7575
data-bind="
76-
css: {_active: multiselectFocus},
76+
css: {_active: listVisible},
7777
click: function(data, event) {
7878
toggleListVisible(data, event)
7979
}

0 commit comments

Comments
 (0)