Skip to content

Commit 69b91ff

Browse files
committed
Merge branch '2.4-develop' into L3_PR_21-12-13
2 parents b57d5db + d553cf9 commit 69b91ff

File tree

180 files changed

+21457
-19755
lines changed

Some content is hidden

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

180 files changed

+21457
-19755
lines changed

app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/AbstractRenderer.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ protected function _getValue(DataObject $row)
9797
}
9898
return '';
9999
}
100-
return $row->getData($this->getColumn()->getIndex());
100+
return $this->getColumn()->getIndex() !== null
101+
? $row->getData($this->getColumn()->getIndex())
102+
: null;
101103
}
102104

103105
/**

app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Currency.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ protected function _getCurrencyCode($row)
102102
if ($code = $this->getColumn()->getCurrencyCode()) {
103103
return $code;
104104
}
105-
if ($code = $row->getData($this->getColumn()->getCurrency())) {
105+
$currency = $this->getColumn()->getCurrency();
106+
107+
if ($currency !== null && $code = $row->getData($currency)) {
106108
return $code;
107109
}
108110

@@ -118,11 +120,14 @@ protected function _getCurrencyCode($row)
118120
protected function _getRate($row)
119121
{
120122
if ($rate = $this->getColumn()->getRate()) {
121-
return (float)$rate;
123+
return (float) $rate;
122124
}
123-
if ($rate = $row->getData($this->getColumn()->getRateField())) {
124-
return (float)$rate;
125+
$rateField = $this->getColumn()->getRateField();
126+
127+
if ($rateField !== null && $rate = $row->getData($rateField)) {
128+
return (float) $rate;
125129
}
130+
126131
return $this->_defaultBaseCurrency->getRate($this->_getCurrencyCode($row));
127132
}
128133

app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Price.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function render(\Magento\Framework\DataObject $row)
6060
return $data;
6161
}
6262

63-
$data = (float)$data * $this->_getRate($row);
63+
$data = (float) $data * $this->_getRate($row);
6464
$data = sprintf("%f", $data);
6565
$data = $this->_localeCurrency->getCurrency($currencyCode)->toCurrency($data);
6666
return $data;
@@ -79,7 +79,9 @@ protected function _getCurrencyCode($row)
7979
if ($code = $this->getColumn()->getCurrencyCode()) {
8080
return $code;
8181
}
82-
if ($code = $row->getData($this->getColumn()->getCurrency())) {
82+
$currency = $this->getColumn()->getCurrency();
83+
84+
if ($currency !== null && $code = $row->getData($currency)) {
8385
return $code;
8486
}
8587
return false;
@@ -94,10 +96,12 @@ protected function _getCurrencyCode($row)
9496
protected function _getRate($row)
9597
{
9698
if ($rate = $this->getColumn()->getRate()) {
97-
return (float)$rate;
99+
return (float) $rate;
98100
}
99-
if ($rate = $row->getData($this->getColumn()->getRateField())) {
100-
return (float)$rate;
101+
$rateField = $this->getColumn()->getRateField();
102+
103+
if ($rateField !== null && $rate = $row->getData($rateField)) {
104+
return (float) $rate;
101105
}
102106
return 1;
103107
}

app/code/Magento/Catalog/Setup/Patch/Data/UpdateMultiselectAttributesBackendTypes.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,10 @@ public function getAliases()
5959
public function apply()
6060
{
6161
$this->dataSetup->startSetup();
62+
$setup = $this->dataSetup;
63+
$connection = $setup->getConnection();
6264

63-
$connection = $this->dataSetup->getConnection();
64-
$attributeTable = $connection->getTableName('eav_attribute');
65+
$attributeTable = $setup->getTable('eav_attribute');
6566
/** @var EavSetup $eavSetup */
6667
$eavSetup = $this->eavSetupFactory->create(['setup' => $this->dataSetup]);
6768
$entityTypeId = $eavSetup->getEntityTypeId(Product::ENTITY);
@@ -74,8 +75,8 @@ public function apply()
7475
->where('frontend_input = ?', 'multiselect')
7576
);
7677

77-
$varcharTable = $connection->getTableName('catalog_product_entity_varchar');
78-
$textTable = $connection->getTableName('catalog_product_entity_text');
78+
$varcharTable = $setup->getTable('catalog_product_entity_varchar');
79+
$textTable = $setup->getTable('catalog_product_entity_text');
7980
$varcharTableDataSql = $connection
8081
->select()
8182
->from($varcharTable)

app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit/Tab/Conditions.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
*/
66
namespace Magento\CatalogRule\Block\Adminhtml\Promo\Catalog\Edit\Tab;
77

8-
use Magento\Backend\Block\Widget\Form;
98
use Magento\Backend\Block\Widget\Form\Generic;
9+
use Magento\Backend\Block\Widget\Form\Renderer\Fieldset;
1010
use Magento\Ui\Component\Layout\Tabs\TabInterface;
1111
use Magento\Rule\Model\Condition\AbstractCondition;
1212

1313
class Conditions extends Generic implements TabInterface
1414
{
1515
/**
16-
* @var \Magento\Backend\Block\Widget\Form\Renderer\Fieldset
16+
* @var Fieldset
1717
*/
1818
protected $_rendererFieldset;
1919

@@ -27,15 +27,15 @@ class Conditions extends Generic implements TabInterface
2727
* @param \Magento\Framework\Registry $registry
2828
* @param \Magento\Framework\Data\FormFactory $formFactory
2929
* @param \Magento\Rule\Block\Conditions $conditions
30-
* @param \Magento\Backend\Block\Widget\Form\Renderer\Fieldset $rendererFieldset
30+
* @param Fieldset $rendererFieldset
3131
* @param array $data
3232
*/
3333
public function __construct(
3434
\Magento\Backend\Block\Template\Context $context,
3535
\Magento\Framework\Registry $registry,
3636
\Magento\Framework\Data\FormFactory $formFactory,
3737
\Magento\Rule\Block\Conditions $conditions,
38-
\Magento\Backend\Block\Widget\Form\Renderer\Fieldset $rendererFieldset,
38+
Fieldset $rendererFieldset,
3939
array $data = []
4040
) {
4141
$this->_rendererFieldset = $rendererFieldset;
@@ -121,7 +121,7 @@ public function isAjaxLoaded()
121121
}
122122

123123
/**
124-
* @return Form
124+
* @inheritdoc
125125
*/
126126
protected function _prepareForm()
127127
{
@@ -135,6 +135,8 @@ protected function _prepareForm()
135135
}
136136

137137
/**
138+
* Adds 'Conditions' to the form.
139+
*
138140
* @param \Magento\CatalogRule\Api\Data\RuleInterface $model
139141
* @param string $fieldsetId
140142
* @param string $formName
@@ -154,7 +156,8 @@ protected function addTabToForm($model, $fieldsetId = 'conditions_fieldset', $fo
154156
['form_namespace' => $formName]
155157
);
156158

157-
$renderer = $this->_rendererFieldset->setTemplate('Magento_CatalogRule::promo/fieldset.phtml')
159+
$renderer = $this->getLayout()->createBlock(Fieldset::class);
160+
$renderer->setTemplate('Magento_CatalogRule::promo/fieldset.phtml')
158161
->setNewChildUrl($newChildUrl)
159162
->setFieldSetId($conditionsFieldSetId);
160163

@@ -183,6 +186,8 @@ protected function addTabToForm($model, $fieldsetId = 'conditions_fieldset', $fo
183186
}
184187

185188
/**
189+
* Sets form name for Condition section.
190+
*
186191
* @param AbstractCondition $conditions
187192
* @param string $formName
188193
* @param string $jsFormName

app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest/AdminCreateCatalogPriceRuleByPercentTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
</before>
3737
<after>
3838
<!-- delete the simple product and catalog price rule and logout -->
39-
<amOnPage stepKey="goToPriceRulePage" url="admin/catalog_rule/promo_catalog/"/>
39+
<amOnPage stepKey="goToPriceRulePage" url="{{CatalogRulePage.url}}"/>
4040
<actionGroup stepKey="deletePriceRule" ref="deleteEntitySecondaryGrid">
4141
<argument name="name" value="{{_defaultCatalogRule.name}}"/>
4242
<argument name="searchInput" value="{{AdminSecondaryGridSection.catalogRuleIdentifierSearch}}"/>

app/code/Magento/CatalogSearch/Model/ResourceModel/Fulltext/Collection.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ public function __construct(
177177
TotalRecordsResolverFactory $totalRecordsResolverFactory = null,
178178
DefaultFilterStrategyApplyCheckerInterface $defaultFilterStrategyApplyChecker = null
179179
) {
180-
$this->searchResultFactory = $searchResultFactory ?? \Magento\Framework\App\ObjectManager::getInstance()
181-
->get(\Magento\Framework\Api\Search\SearchResultFactory::class);
180+
$this->searchResultFactory = $searchResultFactory
181+
?? ObjectManager::getInstance()->get(SearchResultFactory::class);
182182
parent::__construct(
183183
$entityFactory,
184184
$logger,
@@ -368,13 +368,12 @@ public function _loadEntities($printQuery = false, $logQuery = false)
368368
$this->getEntity();
369369

370370
$this->printLogQuery($printQuery, $logQuery);
371-
371+
/**
372+
* Prepare select query
373+
* @var string $query
374+
*/
375+
$query = $this->getSelect();
372376
try {
373-
/**
374-
* Prepare select query
375-
* @var string $query
376-
*/
377-
$query = $this->getSelect();
378377
$rows = $this->_fetchAll($query);
379378
} catch (\Exception $e) {
380379
$this->printLogQuery(false, true, $query);
@@ -455,7 +454,7 @@ protected function _renderFiltersBefore()
455454
}
456455

457456
if ($this->searchRequestName !== 'quick_search_container'
458-
|| strlen(trim($this->queryText))
457+
|| ($this->queryText && strlen(trim($this->queryText)))
459458
) {
460459
$this->prepareSearchTermFilter();
461460
$this->preparePriceAggregation();

app/code/Magento/CatalogUrlRewrite/Test/Mftf/Data/AdminCategoryRestrictedUrlMessageData.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
<data key="urlRest">URL key "rest" matches a reserved endpoint name (admin, soap, rest, graphql, standard). Use another URL key.</data>
1515
<data key="urlGraphql">URL key "graphql" matches a reserved endpoint name (admin, soap, rest, graphql, standard). Use another URL key.</data>
1616
<data key="urlAdminError">URL key "admin" matches a reserved endpoint name (admin). Use another URL key.</data>
17+
<data key="urlAdminPartialError">URL key "admin" matches a reserved endpoint name </data>
1718
</entity>
1819
</entities>

app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminCategoryWithRestrictedUrlKeyNotCreatedTest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@
4646
<argument name="categoryName" value="admin"/>
4747
<argument name="categoryUrlKey" value=""/>
4848
</actionGroup>
49-
<see selector="{{AdminMessagesSection.error}}" userInput='{{AdminCategoryRestrictedUrlErrorMessage.urlAdminError}}' stepKey="seeAdminFirstErrorMessage"/>
49+
<see selector="{{AdminMessagesSection.error}}" userInput='{{AdminCategoryRestrictedUrlErrorMessage.urlAdminPartialError}}' stepKey="seeAdminFirstErrorMessage"/>
5050
<actionGroup ref="FillCategoryNameAndUrlKeyAndSaveActionGroup" stepKey="fillAdminSecondCategoryForm">
5151
<argument name="categoryName" value="{{SimpleSubCategory.name}}"/>
5252
<argument name="categoryUrlKey" value="admin"/>
5353
</actionGroup>
54-
<see selector="{{AdminMessagesSection.error}}" userInput='{{AdminCategoryRestrictedUrlErrorMessage.urlAdminError}}' stepKey="seeAdminSecondErrorMessage"/>
54+
<see selector="{{AdminMessagesSection.error}}" userInput='{{AdminCategoryRestrictedUrlErrorMessage.urlAdminPartialError}}' stepKey="seeAdminSecondErrorMessage"/>
5555
<!--Create category with 'admin' name-->
5656
<comment userInput="Create category with 'admin' name" stepKey="commentAdminCategoryCreation"/>
5757
<actionGroup ref="FillCategoryNameAndUrlKeyAndSaveActionGroup" stepKey="fillAdminThirdCategoryForm">

app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<dt class="label"><!-- ko text: option.label --><!-- /ko --></dt>
4343
<dd class="values">
4444
<!-- ko if: Array.isArray(option.value) -->
45-
<span data-bind="html: $parents[1].getOptionValueUnsanitizedHtml(option.value.join('<br/>'))"></span>
45+
<span data-bind="html: $parents[1].getOptionValueUnsanitizedHtml(option.value.join('<br>'))"></span>
4646
<!-- /ko -->
4747
<!-- ko if: (!Array.isArray(option.value) && ['file', 'html'].includes(option.option_type)) -->
4848
<span data-bind="html: $parents[1].getOptionValueUnsanitizedHtml(option.value)"></span>
@@ -83,7 +83,7 @@
8383
type="number"
8484
size="4"
8585
class="item-qty cart-item-qty"/>
86-
<button data-bind="attr: {
86+
<button data-bind="attr: {
8787
id: 'update-cart-item-'+item_id,
8888
'data-cart-item': item_id,
8989
title: $t('Update')

0 commit comments

Comments
 (0)