Skip to content

Commit 87a4fd9

Browse files
committed
Merge branch '2.4-develop' of http://github.com/magento/magento2 into fix-CategoryWithOverriddenUrlKey
2 parents 5d9ce4d + 70223c0 commit 87a4fd9

File tree

399 files changed

+12108
-1620
lines changed

Some content is hidden

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

399 files changed

+12108
-1620
lines changed

app/bootstrap.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
#ini_set('display_errors', 1);
1515

1616
/* PHP version validation */
17-
if (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 70103) {
17+
if (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 70300) {
1818
if (PHP_SAPI == 'cli') {
19-
echo 'Magento supports PHP 7.1.3 or later. ' .
20-
'Please read https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements-tech.html';
19+
echo 'Magento supports PHP 7.3.0 or later. ' .
20+
'Please read https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements-tech.html';
2121
} else {
2222
echo <<<HTML
2323
<div style="font:12px/1.35em arial, helvetica, sans-serif;">
24-
<p>Magento supports PHP 7.1.3 or later. Please read
25-
<a target="_blank" href="https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements-tech.html">
24+
<p>Magento supports PHP 7.3.0 or later. Please read
25+
<a target="_blank" href="https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements-tech.html">
2626
Magento System Requirements</a>.
2727
</div>
2828
HTML;

app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface;
1111

1212
/**
13-
* Class AdvancedPricing
13+
* Import advanced pricing class
1414
*
1515
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
1616
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -19,43 +19,27 @@
1919
class AdvancedPricing extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity
2020
{
2121
const VALUE_ALL_GROUPS = 'ALL GROUPS';
22-
2322
const VALUE_ALL_WEBSITES = 'All Websites';
24-
2523
const COL_SKU = 'sku';
26-
2724
const COL_TIER_PRICE_WEBSITE = 'tier_price_website';
28-
2925
const COL_TIER_PRICE_CUSTOMER_GROUP = 'tier_price_customer_group';
30-
3126
const COL_TIER_PRICE_QTY = 'tier_price_qty';
32-
3327
const COL_TIER_PRICE = 'tier_price';
34-
3528
const COL_TIER_PRICE_PERCENTAGE_VALUE = 'percentage_value';
36-
3729
const COL_TIER_PRICE_TYPE = 'tier_price_value_type';
38-
3930
const TIER_PRICE_TYPE_FIXED = 'Fixed';
40-
4131
const TIER_PRICE_TYPE_PERCENT = 'Discount';
42-
4332
const TABLE_TIER_PRICE = 'catalog_product_entity_tier_price';
44-
4533
const DEFAULT_ALL_GROUPS_GROUPED_PRICE_VALUE = '0';
46-
4734
const ENTITY_TYPE_CODE = 'advanced_pricing';
48-
4935
const VALIDATOR_MAIN = 'validator';
50-
5136
const VALIDATOR_WEBSITE = 'validator_website';
5237

5338
/**
5439
* @deprecated
5540
* @see VALIDATOR_TIER_PRICE
5641
*/
5742
private const VALIDATOR_TEAR_PRICE = 'validator_tier_price';
58-
5943
private const VALIDATOR_TIER_PRICE = 'validator_tier_price';
6044

6145
/**
@@ -176,10 +160,8 @@ class AdvancedPricing extends \Magento\ImportExport\Model\Import\Entity\Abstract
176160
* @param \Magento\Framework\Json\Helper\Data $jsonHelper
177161
* @param \Magento\ImportExport\Helper\Data $importExportData
178162
* @param \Magento\ImportExport\Model\ResourceModel\Import\Data $importData
179-
* @param \Magento\Eav\Model\Config $config
180163
* @param \Magento\Framework\App\ResourceConnection $resource
181164
* @param \Magento\ImportExport\Model\ResourceModel\Helper $resourceHelper
182-
* @param \Magento\Framework\Stdlib\StringUtils $string
183165
* @param ProcessingErrorAggregatorInterface $errorAggregator
184166
* @param \Magento\Framework\Stdlib\DateTime\DateTime $dateTime
185167
* @param \Magento\CatalogImportExport\Model\Import\Proxy\Product\ResourceModelFactory $resourceFactory
@@ -197,10 +179,8 @@ public function __construct(
197179
\Magento\Framework\Json\Helper\Data $jsonHelper,
198180
\Magento\ImportExport\Helper\Data $importExportData,
199181
\Magento\ImportExport\Model\ResourceModel\Import\Data $importData,
200-
\Magento\Eav\Model\Config $config,
201182
\Magento\Framework\App\ResourceConnection $resource,
202183
\Magento\ImportExport\Model\ResourceModel\Helper $resourceHelper,
203-
\Magento\Framework\Stdlib\StringUtils $string,
204184
ProcessingErrorAggregatorInterface $errorAggregator,
205185
\Magento\Framework\Stdlib\DateTime\DateTime $dateTime,
206186
\Magento\CatalogImportExport\Model\Import\Proxy\Product\ResourceModelFactory $resourceFactory,

app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricingTest.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use Magento\CatalogImportExport\Model\Import\Product\RowValidatorInterface as RowValidatorInterface;
1717
use Magento\CatalogImportExport\Model\Import\Product\StoreResolver;
1818
use Magento\CatalogImportExport\Model\Import\Proxy\Product\ResourceModelFactory as ResourceFactory;
19-
use Magento\Eav\Model\Config;
2019
use Magento\Eav\Model\Entity\Type;
2120
use Magento\Framework\App\ResourceConnection;
2221
use Magento\Framework\DB\Adapter\AdapterInterface;
@@ -26,7 +25,6 @@
2625
use Magento\Framework\Json\Helper\Data;
2726
use Magento\Framework\Stdlib\DateTime\DateTime;
2827
use Magento\Framework\Stdlib\DateTime\TimezoneInterface;
29-
use Magento\Framework\Stdlib\StringUtils;
3028
use Magento\ImportExport\Model\Import;
3129
use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface;
3230
use Magento\ImportExport\Model\ResourceModel\Helper;
@@ -99,11 +97,6 @@ class AdvancedPricingTest extends AbstractImportTestCase
9997
*/
10098
protected $dataSourceModel;
10199

102-
/**
103-
* @var Config
104-
*/
105-
protected $eavConfig;
106-
107100
/**
108101
* @var TimezoneInterface|MockObject
109102
*/
@@ -139,11 +132,6 @@ class AdvancedPricingTest extends AbstractImportTestCase
139132
*/
140133
protected $advancedPricing;
141134

142-
/**
143-
* @var StringUtils
144-
*/
145-
protected $stringObject;
146-
147135
/**
148136
* @var ProcessingErrorAggregatorInterface
149137
*/
@@ -165,10 +153,8 @@ protected function setUp(): void
165153
);
166154
$this->resource->method('getConnection')->willReturn($this->connection);
167155
$this->dataSourceModel = $this->createMock(\Magento\ImportExport\Model\ResourceModel\Import\Data::class);
168-
$this->eavConfig = $this->createMock(Config::class);
169156
$entityType = $this->createMock(Type::class);
170157
$entityType->method('getEntityTypeId')->willReturn('');
171-
$this->eavConfig->method('getEntityType')->willReturn($entityType);
172158
$this->resourceFactory = $this->getMockBuilder(
173159
\Magento\CatalogImportExport\Model\Import\Proxy\Product\ResourceModelFactory::class
174160
)
@@ -193,7 +179,6 @@ protected function setUp(): void
193179
$this->tierPriceValidator = $this->createMock(
194180
TierPrice::class
195181
);
196-
$this->stringObject = $this->createMock(StringUtils::class);
197182
$this->errorAggregator = $this->getErrorAggregatorObject();
198183
$this->dateTime = $this->getMockBuilder(DateTime::class)
199184
->disableOriginalConstructor()
@@ -1070,10 +1055,8 @@ private function getAdvancedPricingMock($methods = [])
10701055
$this->jsonHelper,
10711056
$this->importExportData,
10721057
$this->dataSourceModel,
1073-
$this->eavConfig,
10741058
$this->resource,
10751059
$this->resourceHelper,
1076-
$this->stringObject,
10771060
$this->errorAggregator,
10781061
$this->dateTime,
10791062
$this->resourceFactory,

app/code/Magento/Bundle/Model/Product/LinksList.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ public function __construct(
3939
}
4040

4141
/**
42+
* Bundle Product Items Data
43+
*
4244
* @param \Magento\Catalog\Api\Data\ProductInterface $product
4345
* @param int $optionId
4446
* @return \Magento\Bundle\Api\Data\LinkInterface[]
@@ -50,8 +52,12 @@ public function getItems(\Magento\Catalog\Api\Data\ProductInterface $product, $o
5052
$productLinks = [];
5153
/** @var \Magento\Catalog\Model\Product $selection */
5254
foreach ($selectionCollection as $selection) {
55+
$bundledProductPrice = $selection->getSelectionPriceValue();
56+
if ($bundledProductPrice <= 0) {
57+
$bundledProductPrice = $selection->getPrice();
58+
}
5359
$selectionPriceType = $product->getPriceType() ? $selection->getSelectionPriceType() : null;
54-
$selectionPrice = $product->getPriceType() ? $selection->getSelectionPriceValue() : null;
60+
$selectionPrice = $bundledProductPrice ? $bundledProductPrice : null;
5561

5662
/** @var \Magento\Bundle\Api\Data\LinkInterface $productLink */
5763
$productLink = $this->linkFactory->create();
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
9+
<test name="StorefrontBundlePlaceOrderWithMultipleOptionsSuccessTest">
10+
<annotations>
11+
<features value="Bundle"/>
12+
<stories value="Bundle product details page"/>
13+
<title value="Customer should be able to see all the bundle items in invoice view"/>
14+
<description value="Customer should be able to see all the bundle items in invoice view"/>
15+
<severity value="MAJOR"/>
16+
<testCaseId value="MC-37515"/>
17+
<group value="Bundle"/>
18+
</annotations>
19+
<before>
20+
<createData entity="_defaultCategory" stepKey="createPreReqCategory"/>
21+
<createData entity="SimpleProduct2" stepKey="firstSimpleProduct"/>
22+
<createData entity="SimpleProduct2" stepKey="secondSimpleProduct"/>
23+
<createData entity="CustomerEntityOne" stepKey="createCustomer"/>
24+
<actionGroup stepKey="loginToAdminPanel" ref="AdminLoginActionGroup"/>
25+
</before>
26+
<after>
27+
<deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/>
28+
<deleteData createDataKey="firstSimpleProduct" stepKey="deleteFirstSimpleProduct"/>
29+
<deleteData createDataKey="secondSimpleProduct" stepKey="deleteSecondSimpleProduct"/>
30+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
31+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
32+
</after>
33+
<!-- Create new bundle product -->
34+
<actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createBundleProduct">
35+
<argument name="productType" value="bundle"/>
36+
</actionGroup>
37+
38+
<!-- Fill all main fields -->
39+
<actionGroup ref="FillMainBundleProductFormActionGroup" stepKey="fillMainProductFields"/>
40+
41+
<!-- Add first bundle option to the product -->
42+
<actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addFirstBundleOption">
43+
<argument name="x" value="0"/>
44+
<argument name="n" value="1"/>
45+
<argument name="prodOneSku" value="$firstSimpleProduct.sku$"/>
46+
<argument name="prodTwoSku" value="$secondSimpleProduct.sku$$"/>
47+
<argument name="optionTitle" value="{{CheckboxOption.title}}"/>
48+
<argument name="inputType" value="{{CheckboxOption.type}}"/>
49+
</actionGroup>
50+
51+
<!-- Save product form -->
52+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveWithThreeOptions"/>
53+
54+
<!--Login customer on storefront-->
55+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginCustomer">
56+
<argument name="Customer" value="$$createCustomer$$" />
57+
</actionGroup>
58+
59+
<!--Open Product Page-->
60+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage">
61+
<argument name="productUrl" value="{{BundleProduct.name}}"/>
62+
</actionGroup>
63+
64+
<!-- Add bundle to cart -->
65+
<actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickAddToCart">
66+
<argument name="productUrl" value="{{BundleProduct.name}}"/>
67+
</actionGroup>
68+
<checkOption selector="{{StorefrontBundledSection.checkboxOptionThreeProducts(CheckboxOption.title, '1')}}" stepKey="selectOption2Product1"/>
69+
<checkOption selector="{{StorefrontBundledSection.checkboxOptionThreeProducts(CheckboxOption.title, '2')}}" stepKey="selectOption2Product2"/>
70+
<actionGroup ref="StorefrontEnterProductQuantityAndAddToTheCartActionGroup" stepKey="enterProductQuantityAndAddToTheCart">
71+
<argument name="quantity" value="1"/>
72+
</actionGroup>
73+
74+
<!--Navigate to checkout-->
75+
<actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="openCheckoutPage"/>
76+
<!-- Click next button to open payment section -->
77+
<actionGroup ref="StorefrontCheckoutClickNextButtonActionGroup" stepKey="clickNext"/>
78+
<!-- Click place order -->
79+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="placeOrder"/>
80+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/>
81+
82+
<!-- Order review page has address that was created during checkout -->
83+
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrdersGridById">
84+
<argument name="orderId" value="{$grabOrderNumber}"/>
85+
</actionGroup>
86+
87+
<!-- Open create invoice page -->
88+
<actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startInvoice"/>
89+
90+
<!-- Assert item options display -->
91+
<see selector="{{AdminInvoiceItemsSection.bundleItem}}" userInput="50 x $firstSimpleProduct.sku$" stepKey="seeFirstProductInList"/>
92+
<see selector="{{AdminInvoiceItemsSection.bundleItem}}" userInput="50 x $secondSimpleProduct.sku$" stepKey="seeSecondProductInList"/>
93+
</test>
94+
</tests>

app/code/Magento/Bundle/Test/Unit/Model/Product/LinksListTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function testLinksList()
9191
->method('getSelectionsCollection')
9292
->with([$optionId], $this->productMock)
9393
->willReturn([$this->selectionMock]);
94-
$this->productMock->expects($this->exactly(2))->method('getPriceType')->willReturn('price_type');
94+
$this->productMock->expects($this->once())->method('getPriceType')->willReturn('price_type');
9595
$this->selectionMock->expects($this->once())
9696
->method('getSelectionPriceType')
9797
->willReturn('selection_price_type');

app/code/Magento/Bundle/view/adminhtml/templates/sales/invoice/create/items/renderer.phtml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<?php $items = $block->getChildren($_item); ?>
1616
<?php $_count = count($items) ?>
1717
<?php $_index = 0 ?>
18+
<?php $canEditItemQty = true ?>
1819
<?php
1920
/** @var \Magento\Catalog\Helper\Data $catalogHelper */
2021
$catalogHelper = $block->getData('catalogHelper');
@@ -37,7 +38,7 @@ $catalogHelper = $block->getData('catalogHelper');
3738
<?php if ($_item->getOrderItem()->getParentItem()): ?>
3839
<?php
3940
if ($shipTogether) {
40-
continue;
41+
$canEditItemQty = false;
4142
}
4243
?>
4344
<?php $attributes = $block->getSelectionAttributes($_item) ?>
@@ -130,7 +131,7 @@ $catalogHelper = $block->getData('catalogHelper');
130131
</td>
131132
<td class="col-qty-invoice">
132133
<?php if ($block->canShowPriceInfo($_item) || $shipTogether): ?>
133-
<?php if ($block->canEditQty()): ?>
134+
<?php if ($block->canEditQty() && $canEditItemQty): ?>
134135
<input type="text"
135136
class="input-text admin__control-text qty-input"
136137
name="invoice[items][<?= $block->escapeHtmlAttr($_item->getOrderItemId()) ?>]"

app/code/Magento/Catalog/Block/Product/View.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,10 @@ public function getJsonConfig()
196196
'productId' => (int)$product->getId(),
197197
'priceFormat' => $this->_localeFormat->getPriceFormat(),
198198
'prices' => [
199+
'baseOldPrice' => [
200+
'amount' => $priceInfo->getPrice('regular_price')->getAmount()->getBaseAmount() * 1,
201+
'adjustments' => []
202+
],
199203
'oldPrice' => [
200204
'amount' => $priceInfo->getPrice('regular_price')->getAmount()->getValue() * 1,
201205
'adjustments' => []

app/code/Magento/Catalog/Helper/Image.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,9 @@ public function backgroundColor($colorRGB)
384384
{
385385
// assume that 3 params were given instead of array
386386
if (!is_array($colorRGB)) {
387+
//phpcs:disable
387388
$colorRGB = func_get_args();
389+
//phpcs:enabled
388390
}
389391
$this->_getModel()->setBackgroundColor($colorRGB);
390392
return $this;
@@ -498,7 +500,11 @@ protected function initBaseFile()
498500
if ($this->getImageFile()) {
499501
$model->setBaseFile($this->getImageFile());
500502
} else {
501-
$model->setBaseFile($this->getProduct()->getData($model->getDestinationSubdir()));
503+
$model->setBaseFile(
504+
$this->getProduct()
505+
? $this->getProduct()->getData($model->getDestinationSubdir())
506+
: ''
507+
);
502508
}
503509
}
504510
return $this;

app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryAndUpdateAsInactiveTest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@
7676
<argument name="tags" value=""/>
7777
</actionGroup>
7878
<!--Open Index Management Page -->
79-
<amOnPage url="{{AdminIndexManagementPage.url}}" stepKey="openIndexManagementPage"/>
80-
<waitForPageLoad stepKey="waitForIndexPageToBeLoaded"/>
79+
<actionGroup ref="AdminOpenIndexManagementPageActionGroup" stepKey="openIndexManagementPage"/>
8180
<see stepKey="seeIndexStatus" selector="{{AdminIndexManagementSection.indexerStatus('Category Flat Data')}}" userInput="Ready"/>
8281
<!--Verify Category In Store Front-->
8382
<amOnPage url="/$$createCategory.name$$.html" stepKey="openCategoryPage1"/>

app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryTest.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,7 @@
7676
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache">
7777
<argument name="tags" value=""/>
7878
</actionGroup>
79-
<!--Open Index Management Page -->
80-
<amOnPage url="{{AdminIndexManagementPage.url}}" stepKey="openIndexManagementPage"/>
81-
<waitForPageLoad stepKey="waitForIndexPageToBeLoaded"/>
79+
<actionGroup ref="AdminOpenIndexManagementPageActionGroup" stepKey="openIndexManagementPage"/>
8280
<see stepKey="seeIndexStatus" selector="{{AdminIndexManagementSection.indexerStatus('Category Flat Data')}}" userInput="Ready"/>
8381
<!--Verify Category In Store Front-->
8482
<amOnPage url="/$$createCategory.name$$.html" stepKey="openCategoryPage1"/>

app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveInMenuFlatCategoryTest.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,7 @@
7777
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache">
7878
<argument name="tags" value=""/>
7979
</actionGroup>
80-
<!--Open Index Management Page -->
81-
<amOnPage url="{{AdminIndexManagementPage.url}}" stepKey="openIndexManagementPage"/>
82-
<waitForPageLoad stepKey="waitForIndexPageToBeLoaded"/>
80+
<actionGroup ref="AdminOpenIndexManagementPageActionGroup" stepKey="openIndexManagementPage"/>
8381
<see stepKey="seeIndexStatus" selector="{{AdminIndexManagementSection.indexerStatus('Category Flat Data')}}" userInput="Ready"/>
8482
<!--Verify Category In Store Front-->
8583
<amOnPage url="/$$category.name$$.html" stepKey="openCategoryPage1"/>

0 commit comments

Comments
 (0)