Skip to content

Commit 7907a08

Browse files
merge magento/2.3-develop into magento-tsg/2.3-develop-pr82
2 parents 2eeacca + 9cc293e commit 7907a08

File tree

20 files changed

+313
-52
lines changed

20 files changed

+313
-52
lines changed

app/code/Magento/Catalog/Controller/Adminhtml/Product/Gallery/Upload.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,6 @@ public function execute()
8989
['fileId' => 'image']
9090
);
9191
$uploader->setAllowedExtensions($this->getAllowedExtensions());
92-
93-
if (!$uploader->checkMimeType($this->getAllowedMimeTypes())) {
94-
throw new LocalizedException(__('Disallowed File Type.'));
95-
}
96-
9792
$imageAdapter = $this->adapterFactory->create();
9893
$uploader->addValidateCallback('catalog_product_image', $imageAdapter, 'validateUploadFile');
9994
$uploader->setAllowRenameFiles(true);
@@ -133,14 +128,4 @@ private function getAllowedExtensions()
133128
{
134129
return array_keys($this->allowedMimeTypes);
135130
}
136-
137-
/**
138-
* Get the set of allowed mime types.
139-
*
140-
* @return array
141-
*/
142-
private function getAllowedMimeTypes()
143-
{
144-
return array_values($this->allowedMimeTypes);
145-
}
146131
}

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickOnAdvancedInventoryLinkActionGroup.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,15 @@
1818
<click selector="{{AdminProductFormSection.advancedInventoryLink}}" stepKey="clickOnAdvancedInventoryLink"/>
1919
<waitForPageLoad stepKey="waitForAdvancedInventoryPageToLoad"/>
2020
</actionGroup>
21+
22+
<!-- ActionGroup click on Advanced Inventory Button in product form;
23+
You must already be on the product form page -->
24+
<actionGroup name="AdminClickOnAdvancedInventoryButtonActionGroup">
25+
<annotations>
26+
<description>Clicks on the 'Advanced Inventory' link on the Admin Product creation/edit page.</description>
27+
</annotations>
28+
29+
<click selector="{{AdminProductFormSection.advancedInventoryButton}}" stepKey="clickOnAdvancedInventoryLink"/>
30+
<waitForPageLoad stepKey="waitForAdvancedInventoryPageToLoad"/>
31+
</actionGroup>
2132
</actionGroups>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<element name="categoriesDropdown" type="multiselect" selector="div[data-index='category_ids']" timeout="30"/>
3939
<element name="unselectCategories" type="button" selector="//span[@class='admin__action-multiselect-crumb']/span[contains(.,'{{category}}')]/../button[@data-action='remove-selected-item']" parameterized="true" timeout="30"/>
4040
<element name="productQuantity" type="input" selector=".admin__field[data-index=qty] input"/>
41-
<element name="advancedInventoryLink" type="button" selector="//button[contains(@data-index, 'advanced_inventory_button')]" timeout="30"/>
41+
<element name="advancedInventoryLink" type="button" selector="button[data-index='advanced_inventory_button'].action-additional" timeout="30"/>
4242
<element name="productStockStatus" type="select" selector="select[name='product[quantity_and_stock_status][is_in_stock]']" timeout="30"/>
4343
<element name="productStockStatusDisabled" type="select" selector="select[name='product[quantity_and_stock_status][is_in_stock]'][disabled=true]"/>
4444
<element name="stockStatus" type="select" selector="[data-index='product-details'] select[name='product[quantity_and_stock_status][is_in_stock]']"/>

app/code/Magento/CatalogInventory/Test/Mftf/Section/AdminProductFormSection.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +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="AdminProductFormSection">
12-
<element name="advancedInventoryLink" type="button" selector="button[data-index='advanced_inventory_button']" timeout="30"/>
12+
<element name="advancedInventoryLink" type="button" selector="button[data-index='advanced_inventory_button'].action-additional" timeout="30"/>
13+
<element name="advancedInventoryButton" type="button" selector="button[data-index='advanced_inventory_button'].action-basic" timeout="30"/>
1314
</section>
1415
</sections>

app/code/Magento/CmsGraphQl/Model/Resolver/DataProvider/Block.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function getData(string $blockIdentifier): array
5656
);
5757
}
5858

59-
$renderedContent = $this->widgetFilter->filter($block->getContent());
59+
$renderedContent = $this->widgetFilter->filterDirective($block->getContent());
6060

6161
$blockData = [
6262
BlockInterface::BLOCK_ID => $block->getId(),

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<element name="updateChangesBtn" type="button" selector=".order-sidebar .actions .action-default.scalable" timeout="30"/>
1313
<element name="productName" type="text" selector="#order-items_grid span[id*=order_item]"/>
1414
<element name="productPrice" type="text" selector=".even td[class=col-price] span[class=price]"/>
15-
<element name="productQty" type="input" selector="td[class=col-qty] input"/>
15+
<element name="productQty" type="input" selector="td[class=col-qty] .input-text.item-qty.admin__control-text"/>
1616
<element name="gridCell" type="text" selector="//div[contains(@id, 'order-items_grid')]//tbody[{{row}}]//td[count(//table[contains(@class, 'order-tables')]//th[contains(., '{{column}}')]/preceding-sibling::th) +1 ]" parameterized="true" timeout="30"/>
1717
</section>
1818
</sections>

app/code/Magento/CustomerGraphQl/Model/Customer/Address/ExtractCustomerAddressData.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ public function execute(AddressInterface $address): array
105105
foreach ($addressData[CustomAttributesDataInterface::CUSTOM_ATTRIBUTES] as $attribute) {
106106
$isArray = false;
107107
if (is_array($attribute['value'])) {
108+
// @ignoreCoverageStart
108109
$isArray = true;
109110
foreach ($attribute['value'] as $attributeValue) {
110111
if (is_array($attributeValue)) {
@@ -116,6 +117,7 @@ public function execute(AddressInterface $address): array
116117
$customAttributes[$attribute['attribute_code']] = implode(',', $attribute['value']);
117118
continue;
118119
}
120+
// @ignoreCoverageEnd
119121
}
120122
if ($isArray) {
121123
continue;

app/code/Magento/QuoteGraphQl/Model/Cart/AssignBillingAddressToCart.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@ public function __construct(
3939
*
4040
* @param CartInterface $cart
4141
* @param AddressInterface $billingAddress
42-
* @param bool $useForShipping
42+
* @param bool $sameAsShipping
4343
* @throws GraphQlInputException
4444
* @throws GraphQlNoSuchEntityException
4545
*/
4646
public function execute(
4747
CartInterface $cart,
4848
AddressInterface $billingAddress,
49-
bool $useForShipping
49+
bool $sameAsShipping
5050
): void {
5151
try {
52-
$this->billingAddressManagement->assign($cart->getId(), $billingAddress, $useForShipping);
52+
$this->billingAddressManagement->assign($cart->getId(), $billingAddress, $sameAsShipping);
5353
} catch (NoSuchEntityException $e) {
5454
throw new GraphQlNoSuchEntityException(__($e->getMessage()), $e);
5555
} catch (InputException $e) {

app/code/Magento/QuoteGraphQl/Model/Cart/ExtractQuoteAddressData.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,25 @@ public function execute(QuoteAddress $address): array
6161
return $addressData;
6262
}
6363

64-
$addressItemsData = [];
6564
foreach ($address->getAllItems() as $addressItem) {
6665
if ($addressItem instanceof \Magento\Quote\Model\Quote\Item) {
6766
$itemId = $addressItem->getItemId();
6867
} else {
6968
$itemId = $addressItem->getQuoteItemId();
7069
}
71-
72-
$addressItemsData[] = [
70+
$productData = $addressItem->getProduct()->getData();
71+
$productData['model'] = $addressItem->getProduct();
72+
$addressData['cart_items'][] = [
7373
'cart_item_id' => $itemId,
7474
'quantity' => $addressItem->getQty()
7575
];
76+
$addressData['cart_items_v2'][] = [
77+
'id' => $itemId,
78+
'quantity' => $addressItem->getQty(),
79+
'product' => $productData,
80+
'model' => $addressItem,
81+
];
7682
}
77-
$addressData['cart_items'] = $addressItemsData;
78-
7983
return $addressData;
8084
}
8185
}

app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,11 @@ public function execute(ContextInterface $context, CartInterface $cart, array $b
6565
{
6666
$customerAddressId = $billingAddressInput['customer_address_id'] ?? null;
6767
$addressInput = $billingAddressInput['address'] ?? null;
68-
$useForShipping = isset($billingAddressInput['use_for_shipping'])
68+
// Need to keep this for BC of `use_for_shipping` field
69+
$sameAsShipping = isset($billingAddressInput['use_for_shipping'])
6970
? (bool)$billingAddressInput['use_for_shipping'] : false;
71+
$sameAsShipping = isset($billingAddressInput['same_as_shipping'])
72+
? (bool)$billingAddressInput['same_as_shipping'] : $sameAsShipping;
7073

7174
if (null === $customerAddressId && null === $addressInput) {
7275
throw new GraphQlInputException(
@@ -81,15 +84,15 @@ public function execute(ContextInterface $context, CartInterface $cart, array $b
8184
}
8285

8386
$addresses = $cart->getAllShippingAddresses();
84-
if ($useForShipping && count($addresses) > 1) {
87+
if ($sameAsShipping && count($addresses) > 1) {
8588
throw new GraphQlInputException(
86-
__('Using the "use_for_shipping" option with multishipping is not possible.')
89+
__('Using the "same_as_shipping" option with multishipping is not possible.')
8790
);
8891
}
8992

9093
$billingAddress = $this->createBillingAddress($context, $customerAddressId, $addressInput);
9194

92-
$this->assignBillingAddressToCart->execute($cart, $billingAddress, $useForShipping);
95+
$this->assignBillingAddressToCart->execute($cart, $billingAddress, $sameAsShipping);
9396
}
9497

9598
/**

0 commit comments

Comments
 (0)