Skip to content

Commit e4b1e2e

Browse files
author
Joan He
committed
MC-17854: Improper Escaping for Bundle Options in Multiple Address Checkout
- Merge remote-tracking branch 'arcticfoxes/MC-17854' into test-branch # Conflicts: # app/code/Magento/Multishipping/view/frontend/templates/checkout/item/default.phtml
2 parents 7219923 + f17ca76 commit e4b1e2e

File tree

65 files changed

+6503
-220
lines changed

Some content is hidden

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

65 files changed

+6503
-220
lines changed

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductActionSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1010
<section name="StorefrontProductActionSection">
1111
<element name="quantity" type="input" selector="#qty"/>
12-
<element name="addToCart" type="button" selector="#product-addtocart-button"/>
12+
<element name="addToCart" type="button" selector="#product-addtocart-button" timeout="60"/>
1313
<element name="addToCartButtonTitleIsAdding" type="text" selector="//button/span[text()='Adding...']"/>
1414
<element name="addToCartButtonTitleIsAdded" type="text" selector="//button/span[text()='Added']"/>
1515
<element name="addToCartButtonTitleIsAddToCart" type="text" selector="//button/span[text()='Add to Cart']"/>

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutCartSummarySection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<element name="totalAmount" type="text" selector="//*[@id='cart-totals']//tr[@class='grand totals']//td//span[@class='price' and contains(text(), '{{amount}}')]" parameterized="true"/>
2121
<element name="proceedToCheckout" type="button" selector=".action.primary.checkout span" timeout="30"/>
2222
<element name="discountAmount" type="text" selector="td[data-th='Discount']"/>
23-
<element name="shippingHeading" type="button" selector="#block-shipping-heading"/>
23+
<element name="shippingHeading" type="button" selector="#block-shipping-heading" timeout="60"/>
2424
<element name="postcode" type="input" selector="input[name='postcode']" timeout="10"/>
2525
<element name="stateProvince" type="select" selector="select[name='region_id']" timeout="10"/>
2626
<element name="stateProvinceInput" type="input" selector="input[name='region']"/>

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingMethodsSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<element name="shippingMethodRow" type="text" selector=".form.methods-shipping table tbody tr"/>
1515
<element name="checkShippingMethodByName" type="radio" selector="//div[@id='checkout-shipping-method-load']//td[contains(., '{{var1}}')]/..//input" parameterized="true"/>
1616
<element name="shippingMethodFlatRate" type="radio" selector="#checkout-shipping-method-load input[value='flatrate_flatrate']"/>
17-
<element name="shippingMethodFreeShipping" type="radio" selector="#checkout-shipping-method-load input[value='freeshipping_freeshipping']"/>
17+
<element name="shippingMethodFreeShipping" type="radio" selector="#checkout-shipping-method-load input[value='freeshipping_freeshipping']" timeout="60"/>
1818
<element name="shippingMethodRowByName" type="text" selector="//div[@id='checkout-shipping-method-load']//td[contains(., '{{var1}}')]/.." parameterized="true"/>
1919
<element name="shipHereButton" type="button" selector="//div/following-sibling::div/button[contains(@class, 'action-select-shipping-item')]"/>
2020
<element name="shippingMethodLoader" type="button" selector="//div[contains(@class, 'checkout-shipping-method')]/following-sibling::div[contains(@class, 'loading-mask')]"/>

app/code/Magento/Checkout/Test/Mftf/Section/StorefrontMiniCartSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<element name="productName" type="text" selector=".product-item-name"/>
1717
<element name="productOptionsDetailsByName" type="button" selector="//header//ol[@id='mini-cart']//div[@class='product-item-details'][.//a[contains(text(), '{{var1}}')]]//span[.='See Details']" parameterized="true"/>
1818
<element name="productOptionByNameAndAttribute" type="text" selector="//header//ol[@id='mini-cart']//div[@class='product-item-details'][.//a[contains(text(), '{{var1}}')]]//dt[@class='label' and .='{{var2}}']/following-sibling::dd[@class='values']//span" parameterized="true"/>
19-
<element name="showCart" type="button" selector="a.showcart"/>
19+
<element name="showCart" type="button" selector="a.showcart" timeout="60"/>
2020
<element name="quantity" type="button" selector="span.counter-number"/>
2121
<element name="miniCartOpened" type="button" selector="a.showcart.active"/>
2222
<element name="goToCheckout" type="button" selector="#top-cart-btn-checkout" timeout="30"/>

app/code/Magento/Checkout/view/frontend/web/js/region-updater.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ define([
157157
regionInput = $(this.options.regionInputId),
158158
postcode = $(this.options.postcodeId),
159159
label = regionList.parent().siblings('label'),
160-
requiredLabel = regionList.parents('div.field');
160+
container = regionList.parents('div.field');
161161

162162
this._clearError();
163163
this._checkRegionRequired(country);
@@ -181,15 +181,16 @@ define([
181181

182182
if (this.options.isRegionRequired) {
183183
regionList.addClass('required-entry').removeAttr('disabled');
184-
requiredLabel.addClass('required');
184+
container.addClass('required').show();
185185
} else {
186186
regionList.removeClass('required-entry validate-select').removeAttr('data-validate');
187-
requiredLabel.removeClass('required');
187+
container.removeClass('required');
188188

189189
if (!this.options.optionalRegionAllowed) { //eslint-disable-line max-depth
190-
regionList.attr('disabled', 'disabled');
190+
regionList.hide();
191+
container.hide();
191192
} else {
192-
regionList.removeAttr('disabled');
193+
regionList.show();
193194
}
194195
}
195196

@@ -201,12 +202,13 @@ define([
201202

202203
if (this.options.isRegionRequired) {
203204
regionInput.addClass('required-entry').removeAttr('disabled');
204-
requiredLabel.addClass('required');
205+
container.addClass('required').show();
205206
} else {
206207
if (!this.options.optionalRegionAllowed) { //eslint-disable-line max-depth
207208
regionInput.attr('disabled', 'disabled');
209+
container.hide();
208210
}
209-
requiredLabel.removeClass('required');
211+
container.removeClass('required');
210212
regionInput.removeClass('required-entry');
211213
}
212214

app/code/Magento/Config/Test/Mftf/Section/GeneralSection.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="ContentManagementSection">
12-
<element name="WYSIWYGOptions" type="button" selector="#cms_wysiwyg-head"/>
12+
<element name="WYSIWYGOptions" type="button" selector="#cms_wysiwyg-head" timeout="60"/>
1313
<element name="CheckIfTabExpand" type="button" selector="#cms_wysiwyg-head:not(.open)"/>
1414
<element name="EnableSystemValue" type="button" selector="#cms_wysiwyg_enabled_inherit"/>
1515
<element name="EnableWYSIWYG" type="button" selector="#cms_wysiwyg_enabled"/>
16-
<element name="SwitcherSystemValue" type="button" selector="#cms_wysiwyg_editor_inherit"/>
16+
<element name="SwitcherSystemValue" type="button" selector="#cms_wysiwyg_editor_inherit" timeout="60"/>
1717
<element name="Switcher" type="button" selector="#cms_wysiwyg_editor" />
1818
<element name="StaticURL" type="button" selector="#cms_wysiwyg_use_static_urls_in_catalog" />
1919
<element name="Save" type="button" selector="#save" timeout="30"/>

app/code/Magento/ConfigurableProductGraphQl/Model/Variant/Collection.php

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@
99

1010
use Magento\Catalog\Api\Data\ProductInterface;
1111
use Magento\Catalog\Model\Product;
12-
use Magento\Catalog\Model\ProductFactory;
1312
use Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Product\Collection as ChildCollection;
1413
use Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Product\CollectionFactory;
1514
use Magento\Framework\EntityManager\MetadataPool;
1615
use Magento\Framework\Api\SearchCriteriaBuilder;
17-
use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product as DataProvider;
16+
use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product\CollectionProcessorInterface;
1817

1918
/**
2019
* Collection for fetching configurable child product data.
@@ -26,21 +25,11 @@ class Collection
2625
*/
2726
private $childCollectionFactory;
2827

29-
/**
30-
* @var ProductFactory
31-
*/
32-
private $productFactory;
33-
3428
/**
3529
* @var SearchCriteriaBuilder
3630
*/
3731
private $searchCriteriaBuilder;
3832

39-
/**
40-
* @var DataProvider
41-
*/
42-
private $productDataProvider;
43-
4433
/**
4534
* @var MetadataPool
4635
*/
@@ -61,25 +50,27 @@ class Collection
6150
*/
6251
private $attributeCodes = [];
6352

53+
/**
54+
* @var CollectionProcessorInterface
55+
*/
56+
private $collectionProcessor;
57+
6458
/**
6559
* @param CollectionFactory $childCollectionFactory
66-
* @param ProductFactory $productFactory
6760
* @param SearchCriteriaBuilder $searchCriteriaBuilder
68-
* @param DataProvider $productDataProvider
6961
* @param MetadataPool $metadataPool
62+
* @param CollectionProcessorInterface $collectionProcessor
7063
*/
7164
public function __construct(
7265
CollectionFactory $childCollectionFactory,
73-
ProductFactory $productFactory,
7466
SearchCriteriaBuilder $searchCriteriaBuilder,
75-
DataProvider $productDataProvider,
76-
MetadataPool $metadataPool
67+
MetadataPool $metadataPool,
68+
CollectionProcessorInterface $collectionProcessor
7769
) {
7870
$this->childCollectionFactory = $childCollectionFactory;
79-
$this->productFactory = $productFactory;
8071
$this->searchCriteriaBuilder = $searchCriteriaBuilder;
81-
$this->productDataProvider = $productDataProvider;
8272
$this->metadataPool = $metadataPool;
73+
$this->collectionProcessor = $collectionProcessor;
8374
}
8475

8576
/**
@@ -148,7 +139,11 @@ private function fetch() : array
148139
/** @var ChildCollection $childCollection */
149140
$childCollection = $this->childCollectionFactory->create();
150141
$childCollection->setProductFilter($product);
151-
$childCollection->addAttributeToSelect($attributeData);
142+
$this->collectionProcessor->process(
143+
$childCollection,
144+
$this->searchCriteriaBuilder->create(),
145+
$attributeData
146+
);
152147

153148
/** @var Product $childProduct */
154149
foreach ($childCollection->getItems() as $childProduct) {

app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerLogoutActionGroup.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1111
<actionGroup name="StorefrontCustomerLogoutActionGroup">
1212
<amOnPage url="{{StorefrontCustomerLogoutPage.url}}" stepKey="storefrontSignOut"/>
13+
<waitForPageLoad stepKey="waitForSignOut"/>
1314
</actionGroup>
1415

1516
<actionGroup name="StorefrontSignOutActionGroup">

app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerSidebarSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="StorefrontCustomerSidebarSection">
12-
<element name="sidebarTab" type="text" selector="//div[@id='block-collapsible-nav']//a[text()='{{tabName}}']" parameterized="true"/>
12+
<element name="sidebarTab" type="text" selector="//div[@id='block-collapsible-nav']//a[text()='{{tabName}}']" parameterized="true" timeout="60"/>
1313
<element name="sidebarCurrentTab" type="text" selector="//div[@id='block-collapsible-nav']//*[contains(text(), '{{var}}')]" parameterized="true"/>
1414
</section>
1515
</sections>

app/code/Magento/Customer/Test/Mftf/Test/VerifyDisabledCustomerGroupFieldTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
<!-- 2. Navigate to Customers > Customer Groups -->
2828
<amOnPage url="{{AdminCustomerGroupPage.url}}" stepKey="amOnCustomerGroupPage" />
2929
<waitForPageLoad stepKey="waitForCustomerGroupsPageLoad" />
30+
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearFilters"/>
3031

3132
<!-- 3. Select system Customer Group specified in data set from grid -->
3233
<click selector="{{AdminCustomerGroupMainSection.editButtonByCustomerGroupCode(NotLoggedInCustomerGroup.code)}}" stepKey="clickOnEditCustomerGroup" />

0 commit comments

Comments
 (0)