Skip to content

Commit 5c31521

Browse files
Merge branch '2.4-develop' into refactor-moveFileFromTmp
2 parents 05abef2 + 390505a commit 5c31521

File tree

576 files changed

+16277
-2194
lines changed

Some content is hidden

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

576 files changed

+16277
-2194
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/Backend/Test/Mftf/Test/AdminDashboardWithChartsTest.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
<!-- Reset admin order filter -->
3535
<comment userInput="Reset admin order filter" stepKey="resetAdminOrderFilter"/>
3636
<actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearOrderFilters"/>
37-
<waitForLoadingMaskToDisappear stepKey="waitForLoadingOrderGrid"/>
3837
<magentoCLI command="config:set admin/dashboard/enable_charts 0" stepKey="setDisableChartsAsDefault"/>
3938
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
4039
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
@@ -84,8 +83,7 @@
8483
<comment userInput="Create invoice" stepKey="createInvoice"/>
8584

8685
<actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickOrderRow"/>
87-
<click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceButton"/>
88-
<waitForPageLoad stepKey="waitForInvoicePageToLoad"/>
86+
<actionGroup ref="AdminClickInvoiceButtonOrderViewActionGroup" stepKey="clickInvoiceButton"/>
8987
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seeNewInvoiceInPageTitle" after="clickInvoiceButton"/>
9088
<see selector="{{AdminInvoiceTotalSection.total('Subtotal')}}" userInput="$150.00" stepKey="seeCorrectGrandTotal"/>
9189
<actionGroup ref="AdminInvoiceClickSubmitActionGroup" stepKey="clickSubmitInvoice"/>

app/code/Magento/Backend/Test/Mftf/Test/AdminLoginAfterJSMinificationTest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@
2424
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache">
2525
<argument name="tags" value="config"/>
2626
</actionGroup>
27+
<magentoCLI command="setup:static-content:deploy -f" stepKey="deployStaticContent"/>
2728
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
2829
</before>
2930
<after>
3031
<magentoCLI command="config:set {{MinifyJavaScriptFilesDisableConfigData.path}} {{MinifyJavaScriptFilesDisableConfigData.value}}" stepKey="disableJsMinification"/>
3132
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
3233
</after>
33-
<see userInput="Dashboard" selector="{{AdminHeaderSection.pageTitle}}" stepKey="seeDashboardTitle"/>
3434
<waitForPageLoad stepKey="waitForPageLoadOnDashboard"/>
35+
<see userInput="Dashboard" selector="{{AdminHeaderSection.pageTitle}}" stepKey="seeDashboardTitle"/>
3536
<actionGroup ref="AssertAdminSuccessLoginActionGroup" stepKey="loggedInSuccessfully"/>
3637
<actionGroup ref="AssertAdminPageIsNot404ActionGroup" stepKey="dontSee404Page"/>
3738
</test>

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

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,52 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
7+
use Magento\Framework\Escaper;
8+
use Magento\Framework\View\Helper\SecureHtmlRenderer;
9+
10+
/**
11+
* @var SecureHtmlRenderer $secureRenderer
12+
* @var Escaper $escaper
13+
*/
814
?>
9-
<!-- <?php if ($block->getTitle()): ?>
10-
<h3><?= $block->escapeHtml($block->getTitle()) ?></h3>
11-
<?php endif ?> -->
1215
<?php if (!empty($tabs)): ?>
13-
<div id="<?= $block->escapeHtmlAttr($block->getId()) ?>">
16+
<?php $blockId = $block->getId() ?>
17+
<div id="<?= $escaper->escapeHtmlAttr($blockId) ?>" class="hidden">
1418
<ul class="tabs-horiz">
1519
<?php foreach ($tabs as $_tab): ?>
20+
<?php $tabId = $block->getTabId($_tab) ?>
1621
<?php $_tabClass = 'tab-item-link ' . $block->getTabClass($_tab) . ' ' .
1722
(preg_match('/\s?ajax\s?/', $_tab->getClass()) ? 'notloaded' : '') ?>
1823
<?php $_tabType = (!preg_match('/\s?ajax\s?/', $_tabClass) && $block->getTabUrl($_tab) != '#') ? 'link' : '' ?>
1924
<?php $_tabHref = $block->getTabUrl($_tab) == '#' ?
20-
'#' . $block->getTabId($_tab) . '_content' :
25+
'#' . $tabId . '_content' :
2126
$block->getTabUrl($_tab) ?>
2227
<li>
23-
<a href="<?= $block->escapeUrl($_tabHref) ?>"
24-
id="<?= $block->escapeHtmlAttr($block->getTabId($_tab)) ?>"
25-
title="<?= $block->escapeHtmlAttr($block->getTabTitle($_tab)) ?>"
26-
class="<?= $block->escapeHtmlAttr($_tabClass) ?>"
27-
data-tab-type="<?= $block->escapeHtmlAttr($_tabType) ?>">
28+
<a href="<?= $escaper->escapeUrl($_tabHref) ?>"
29+
id="<?= $escaper->escapeHtmlAttr($tabId) ?>"
30+
title="<?= $escaper->escapeHtmlAttr($block->getTabTitle($_tab)) ?>"
31+
class="<?= $escaper->escapeHtmlAttr($_tabClass) ?>"
32+
data-tab-type="<?= $escaper->escapeHtmlAttr($_tabType) ?>">
2833
<span>
2934
<span class="changed"
30-
title="<?= $block->escapeHtmlAttr(__('The information in this tab has been changed.')) ?>"></span>
35+
title="<?= $escaper->escapeHtmlAttr(__(
36+
'The information in this tab has been changed.'
37+
)) ?>"></span>
3138
<span class="error"
32-
title="<?= $block->escapeHtmlAttr(__(
39+
title="<?= $escaper->escapeHtmlAttr(__(
3340
'This tab contains invalid data. Please resolve this before saving.'
3441
)) ?>"></span>
3542
<span class="loader"
36-
title="<?= $block->escapeHtmlAttr(__('Loading...')) ?>"></span>
37-
<?= $block->escapeHtml($block->getTabLabel($_tab)) ?>
43+
title="<?= $escaper->escapeHtmlAttr(__('Loading...')) ?>"></span>
44+
<?= $escaper->escapeHtml($block->getTabLabel($_tab)) ?>
3845
</span>
3946
</a>
40-
<div id="<?= $block->escapeHtmlAttr($block->getTabId($_tab)) ?>_content">
47+
<div id="<?= $escaper->escapeHtmlAttr($tabId) ?>_content">
4148
<?= /* @noEscape */ $block->getTabContent($_tab) ?>
4249
</div>
4350
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag(
4451
'display:none',
45-
'#' . $block->escapeJs($block->getTabId($_tab)) . '_content'
52+
'#' . $escaper->escapeJs($tabId) . '_content'
4653
); ?>
4754
</li>
4855
<?php endforeach; ?>
@@ -51,11 +58,12 @@
5158
<?php $scriptString = <<<script
5259
require(["jquery","mage/backend/tabs"], function($){
5360
$(function() {
54-
$('#{$block->getId()}').tabs({
55-
active: '{$block->getActiveTabId()}',
56-
destination: '#{$block->getDestElementId()}',
61+
$('#{$escaper->escapeJs($blockId)}').tabs({
62+
active: '{$escaper->escapeJs($block->getActiveTabId())}',
63+
destination: '#{$escaper->escapeJs($block->getDestElementId())}',
5764
shadowTabs: {$block->getAllShadowTabs()}
5865
});
66+
$('#{$escaper->escapeJs($blockId)}').removeClass('hidden');
5967
});
6068
});
6169
script;

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();

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@
8686

8787
<!--Add another bundle option with 2 items-->
8888
<!--Go to bundle product creation page-->
89-
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="GoToCatalogProductPage"/>
90-
<waitForPageLoad stepKey="WaitForPageToLoad"/>
89+
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogProductPage"/>
9190
<conditionalClick selector="{{AdminProductFiltersSection.filtersClear}}" dependentSelector="{{AdminProductFiltersSection.filtersClear}}" visible="true" stepKey="ClickOnButtonToRemoveFiltersIfPresent"/>
9291
<waitForPageLoad stepKey="WaitForClear"/>
9392
<actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName">

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@
5454

5555
<!--Testing that price appears correctly in admin catalog-->
5656
<!--Set filter to product name-->
57-
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="GoToCatalogProductPage"/>
58-
<waitForPageLoad stepKey="WaitForPageToLoad"/>
57+
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogProductPage"/>
5958
<actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName">
6059
<argument name="product" value="BundleProduct"/>
6160
</actionGroup>
@@ -75,8 +74,7 @@
7574

7675
<!--Testing that price appears correctly in admin catalog-->
7776
<!--Set filter to product name-->
78-
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="GoToCatalogProductPage2"/>
79-
<waitForPageLoad stepKey="WaitForPageToLoad2"/>
77+
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogProductPage2"/>
8078
<actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName2">
8179
<argument name="product" value="BundleProduct"/>
8280
</actionGroup>

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@
9696
</actionGroup>
9797

9898
<!--Filter catalog-->
99-
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToCatalogProductPage"/>
100-
<waitForPageLoad stepKey="WaitForPageToLoad"/>
99+
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogProductPage"/>
101100
<actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName">
102101
<argument name="product" value="BundleProduct"/>
103102
</actionGroup>

0 commit comments

Comments
 (0)