Skip to content

Commit 1a77c62

Browse files
[Magento Community Engineering] Community Contributions - 2.4-develop
- merged latest code from mainline branch
2 parents f10b559 + 38d712e commit 1a77c62

File tree

128 files changed

+1184
-309
lines changed

Some content is hidden

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

128 files changed

+1184
-309
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,8 @@ private function fetchTierPrices(array $productIds): array
486486
)
487487
->where(
488488
'ap.' . $productEntityLinkField . ' IN (?)',
489-
$productIds
489+
$productIds,
490+
\Zend_Db::INT_TYPE
490491
);
491492

492493
if ($priceFromFilter !== null) {

app/code/Magento/Backend/App/Area/FrontNameResolver.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,13 @@ public function isHostBackend()
123123
if ($this->scopeConfig->getValue(self::XML_PATH_USE_CUSTOM_ADMIN_URL, ScopeInterface::SCOPE_STORE)) {
124124
$backendUrl = $this->scopeConfig->getValue(self::XML_PATH_CUSTOM_ADMIN_URL, ScopeInterface::SCOPE_STORE);
125125
} else {
126-
$backendUrl = $this->scopeConfig->getValue(Store::XML_PATH_UNSECURE_BASE_URL, ScopeInterface::SCOPE_STORE);
126+
$backendUrl = $this->config->getValue(Store::XML_PATH_UNSECURE_BASE_URL);
127+
if ($backendUrl === null) {
128+
$backendUrl = $this->scopeConfig->getValue(
129+
Store::XML_PATH_UNSECURE_BASE_URL,
130+
ScopeInterface::SCOPE_STORE
131+
);
132+
}
127133
}
128134
$host = $this->request->getServer('HTTP_HOST', '');
129135
return stripos($this->getHostWithPort($backendUrl), (string) $host) !== false;

app/code/Magento/Backend/Block/Widget/Button.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
*/
66
namespace Magento\Backend\Block\Widget;
77

8+
use Magento\Backend\Block\Template\Context;
89
use Magento\Framework\App\ObjectManager;
910
use Magento\Framework\Math\Random;
10-
use Magento\Backend\Block\Template\Context;
1111
use Magento\Framework\View\Helper\SecureHtmlRenderer;
1212

1313
/**
@@ -125,6 +125,9 @@ protected function _prepareAttributes($title, $classes, $disabled)
125125
'value' => $this->getValue(),
126126
'disabled' => $disabled,
127127
];
128+
if ($this->hasData('onclick_attribute')) {
129+
$attributes['onclick'] = $this->getData('onclick_attribute');
130+
}
128131
if ($this->hasData('backend_button_widget_hook_id')) {
129132
$attributes['backend-button-widget-hook-id'] = $this->getData('backend_button_widget_hook_id');
130133
}

app/code/Magento/Backend/Test/Unit/Block/Widget/ButtonTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,16 @@ public function getAttributesHtmlDataProvider()
9494
]
9595
];
9696
}
97+
98+
/**
99+
* Verifies ability of adding button onclick attribute
100+
*
101+
* @return void
102+
*/
103+
public function testOnClickAttribute(): void
104+
{
105+
$this->_blockMock->setData(['onclick_attribute' => 'value']);
106+
$attributes = $this->_blockMock->getAttributesHtml();
107+
$this->assertStringContainsString('onclick', $attributes);
108+
}
97109
}

app/code/Magento/Bundle/Model/ResourceModel/Selection.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ public function getParentIdsByChild($childId)
145145
['e.entity_id as parent_product_id']
146146
)->where(
147147
$this->getMainTable() . '.product_id IN(?)',
148-
$childId
148+
$childId,
149+
\Zend_Db::INT_TYPE
149150
);
150151

151152
return $connection->fetchCol($select);

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@
4848
<argument name="productId" value="$createFixedBundleProduct.id$"/>
4949
</actionGroup>
5050
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/>
51-
<!--Perform reindex and flush cache-->
52-
<actionGroup ref="AdminReindexAndFlushCache" stepKey="reindexAndFlushCache"/>
51+
<comment userInput="Adding the comment to replace AdminReindexAndFlushCache action group ('indexer:reindex', 'cache:flush' commands) for preserving Backward Compatibility" stepKey="reindexAndFlushCache"/>
5352
</before>
5453
<after>
5554
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProductForBundleItem"/>

app/code/Magento/Catalog/Model/Indexer/Product/Price/AbstractAction.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -465,10 +465,11 @@ protected function _copyRelationIndexData($parentIds, $excludeIds = null)
465465
[]
466466
)->where(
467467
'e.entity_id IN(?)',
468-
$parentIds
468+
$parentIds,
469+
\Zend_Db::INT_TYPE
469470
);
470471
if (!empty($excludeIds)) {
471-
$select->where('child_id NOT IN(?)', $excludeIds);
472+
$select->where('child_id NOT IN(?)', $excludeIds, \Zend_Db::INT_TYPE);
472473
}
473474

474475
$children = $this->getConnection()->fetchCol($select);
@@ -479,7 +480,8 @@ protected function _copyRelationIndexData($parentIds, $excludeIds = null)
479480
$this->getIndexTargetTableByDimension($dimensions)
480481
)->where(
481482
'entity_id IN(?)',
482-
$children
483+
$children,
484+
\Zend_Db::INT_TYPE
483485
);
484486
$query = $select->insertFromSelect($this->_defaultIndexerResource->getIdxTable(), [], false);
485487
$this->getConnection()->query($query);
@@ -578,13 +580,14 @@ private function getParentProductsTypes(array $productsIds)
578580
['e.entity_id as parent_id', 'type_id']
579581
)->where(
580582
'l.child_id IN(?)',
581-
$productsIds
583+
$productsIds,
584+
\Zend_Db::INT_TYPE
582585
);
583586
$pairs = $this->getConnection()->fetchPairs($select);
584587

585588
$byType = [];
586589
foreach ($pairs as $productId => $productType) {
587-
$byType[$productType][$productId] = $productId;
590+
$byType[$productType][$productId] = (int)$productId;
588591
}
589592

590593
return $byType;

app/code/Magento/Catalog/Model/Product/Type/Price.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ public function getTierPrices($product)
379379
if (array_key_exists('website_price', $price)) {
380380
$value = $price['website_price'];
381381
} else {
382-
$value = $price['price'];
382+
$value = $price['price'] ?? 0;
383383
}
384384
$tierPrice->setValue($value);
385385
$tierPrice->setQty($price['price_qty']);

app/code/Magento/Catalog/Model/ResourceModel/Attribute.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ protected function _clearUselessAttributeValues(\Magento\Framework\Model\Abstrac
101101
$attributeStoreIds = array_keys($this->_storeManager->getStores());
102102
if (!empty($attributeStoreIds)) {
103103
$delCondition = [
104-
'attribute_id = ?' => $object->getId(),
104+
'attribute_id = ?' => (int)$object->getId(),
105105
'store_id IN(?)' => $attributeStoreIds,
106106
];
107107
$this->getConnection()->delete($object->getBackendTable(), $delCondition);

app/code/Magento/Catalog/Model/ResourceModel/Category.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,8 @@ public function verifyIds(array $ids)
575575
'entity_id'
576576
)->where(
577577
'entity_id IN(?)',
578-
$ids
578+
$ids,
579+
\Zend_Db::INT_TYPE
579580
);
580581

581582
return $this->getConnection()->fetchCol($select);

0 commit comments

Comments
 (0)