Skip to content

Commit 323676f

Browse files
🔃 [Magento Community Engineering] Community Contributions - 2.4-develop latest changes
Accepted Community Pull Requests: - #30167: Set correct discount package value for tablerate (by @basvanpoppel) - #30320: Fix #11175 - i18n:collect-phrases -m can't find many important magento phrases (by @Bartlomiejsz) - #27574: Fix wrong position of button list when load "New Attribute" page (by @edenduong) - #30002: Use one format in all places for array_merge (by @ihor-sviziev) - #30023: Fix URL generation for new store when it created with setup:config:import (by @ihor-sviziev) - #27454: Add missing order_data array to EmailSender classes (by @kassner) Fixed GitHub Issues: - #30169: [Issue] Set correct discount package value for tablerate (reported by @m2-assistant[bot]) has been fixed in #30167 by @basvanpoppel in 2.4-develop branch Related commits: 1. 5ce73ab 2. 29a60c5 3. d3fc301 4. 6c11aeb 5. 2602b9f 6. 09d13b8 7. 460252f 8. 353097e 9. 997ab12 10. 88f63a6 11. 43fb133 12. af06eab - #11175: i18n:collect-phrases -m can't find many important magento phrases (reported by @scholtz) has been fixed in #30320 by @Bartlomiejsz in 2.4-develop branch Related commits: 1. 48216f3 - #29597: [Issue] Fix wrong position of button list when load "New Attribute" page (reported by @m2-assistant[bot]) has been fixed in #27574 by @edenduong in 2.4-develop branch Related commits: 1. 59dd0db 2. 1dd4e1b 3. 037e4c5 - #30005: [Issue] Use one format in all places for array_merge (reported by @m2-assistant[bot]) has been fixed in #30002 by @ihor-sviziev in 2.4-develop branch Related commits: 1. a2b9380 2. f6c4cbd 3. 7f9c334 - #30025: [Issue] Fix URL generation for new store when it created with setup:config:import (reported by @m2-assistant[bot]) has been fixed in #30023 by @ihor-sviziev in 2.4-develop branch Related commits: 1. 075ddb4 - #29604: [Issue] Add missing order_data array to EmailSender classes (reported by @m2-assistant[bot]) has been fixed in #27454 by @kassner in 2.4-develop branch Related commits: 1. 1000822 2. 56f8bf8 3. 145d189
2 parents bc8e51d + 240805e commit 323676f

File tree

85 files changed

+541
-233
lines changed

Some content is hidden

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

85 files changed

+541
-233
lines changed

app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit.php

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ public function __construct(
4242
}
4343

4444
/**
45+
* Construct block
46+
*
4547
* @return void
4648
*/
4749
protected function _construct()
@@ -51,6 +53,14 @@ protected function _construct()
5153

5254
parent::_construct();
5355

56+
$this->buttonList->update('save', 'label', __('Save Attribute'));
57+
$this->buttonList->update('save', 'class', 'save primary');
58+
$this->buttonList->update(
59+
'save',
60+
'data_attribute',
61+
['mage-init' => ['button' => ['event' => 'save', 'target' => '#edit_form']]]
62+
);
63+
5464
if ($this->getRequest()->getParam('popup')) {
5565
$this->buttonList->remove('back');
5666
if ($this->getRequest()->getParam('product_tab') != 'variations') {
@@ -64,6 +74,8 @@ protected function _construct()
6474
100
6575
);
6676
}
77+
$this->buttonList->update('reset', 'level', 10);
78+
$this->buttonList->update('save', 'class', 'save action-secondary');
6779
} else {
6880
$this->addButton(
6981
'save_and_edit_button',
@@ -79,14 +91,6 @@ protected function _construct()
7991
);
8092
}
8193

82-
$this->buttonList->update('save', 'label', __('Save Attribute'));
83-
$this->buttonList->update('save', 'class', 'save primary');
84-
$this->buttonList->update(
85-
'save',
86-
'data_attribute',
87-
['mage-init' => ['button' => ['event' => 'save', 'target' => '#edit_form']]]
88-
);
89-
9094
$entityAttribute = $this->_coreRegistry->registry('entity_attribute');
9195
if (!$entityAttribute || !$entityAttribute->getIsUserDefined()) {
9296
$this->buttonList->remove('delete');
@@ -96,14 +100,14 @@ protected function _construct()
96100
}
97101

98102
/**
99-
* {@inheritdoc}
103+
* @inheritdoc
100104
*/
101105
public function addButton($buttonId, $data, $level = 0, $sortOrder = 0, $region = 'toolbar')
102106
{
103107
if ($this->getRequest()->getParam('popup')) {
104108
$region = 'header';
105109
}
106-
parent::addButton($buttonId, $data, $level, $sortOrder, $region);
110+
return parent::addButton($buttonId, $data, $level, $sortOrder, $region);
107111
}
108112

109113
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ public function getIdentities()
367367
$identities[] = $item->getIdentities();
368368
}
369369
}
370-
$identities = array_merge(...$identities);
370+
$identities = array_merge([], ...$identities);
371371

372372
return $identities;
373373
}

app/code/Magento/Catalog/Block/Product/ProductList/Related.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,11 @@ public function getItems()
143143
*/
144144
public function getIdentities()
145145
{
146-
$identities = [[]];
146+
$identities = [];
147147
foreach ($this->getItems() as $item) {
148148
$identities[] = $item->getIdentities();
149149
}
150-
return array_merge(...$identities);
150+
return array_merge([], ...$identities);
151151
}
152152

153153
/**

app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,10 @@ public function getItemLimit($type = '')
267267
*/
268268
public function getIdentities()
269269
{
270-
$identities = array_map(function (DataObject $item) {
271-
return $item->getIdentities();
272-
}, $this->getItems()) ?: [[]];
273-
274-
return array_merge(...$identities);
270+
$identities = [];
271+
foreach ($this->getItems() as $item) {
272+
$identities[] = $item->getIdentities();
273+
}
274+
return array_merge([], ...$identities);
275275
}
276276
}

app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/Rows.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,14 +270,14 @@ private function getCategoryIdsFromIndex(array $productIds): array
270270
);
271271
$categoryIds[] = $storeCategories;
272272
}
273-
$categoryIds = array_merge(...$categoryIds);
273+
$categoryIds = array_merge([], ...$categoryIds);
274274

275275
$parentCategories = [$categoryIds];
276276
foreach ($categoryIds as $categoryId) {
277277
$parentIds = explode('/', $this->getPathFromCategoryId($categoryId));
278278
$parentCategories[] = $parentIds;
279279
}
280-
$categoryIds = array_unique(array_merge(...$parentCategories));
280+
$categoryIds = array_unique(array_merge([], ...$parentCategories));
281281

282282
return $categoryIds;
283283
}

app/code/Magento/Catalog/Model/Indexer/Product/Flat/FlatTableBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ protected function _fillTemporaryFlatTable(array $tables, $storeId, $valueFieldS
261261

262262
$select->from(
263263
['et' => $entityTemporaryTableName],
264-
array_merge(...$allColumns)
264+
array_merge([], ...$allColumns)
265265
)->joinInner(
266266
['e' => $this->resource->getTableName('catalog_product_entity')],
267267
'e.entity_id = et.entity_id',
@@ -306,7 +306,7 @@ protected function _fillTemporaryFlatTable(array $tables, $storeId, $valueFieldS
306306
$allColumns[] = $columnValueNames;
307307
}
308308
}
309-
$sql = $select->insertFromSelect($temporaryFlatTableName, array_merge(...$allColumns), false);
309+
$sql = $select->insertFromSelect($temporaryFlatTableName, array_merge([], ...$allColumns), false);
310310
$this->_connection->query($sql);
311311
}
312312

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -836,10 +836,7 @@ public function getStoreIds()
836836
$storeIds[] = $websiteStores;
837837
}
838838
}
839-
if ($storeIds) {
840-
$storeIds = array_merge(...$storeIds);
841-
}
842-
$this->setStoreIds($storeIds);
839+
$this->setStoreIds(array_merge([], ...$storeIds));
843840
}
844841
return $this->getData('store_ids');
845842
}

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
use Magento\Catalog\Model\Product\Price\Validation\TierPriceValidator;
1313
use Magento\Catalog\Model\ProductIdLocatorInterface;
1414

15-
/**
16-
* Tier price storage.
17-
*/
1815
class TierPriceStorage implements TierPriceStorageInterface
1916
{
2017
/**
@@ -220,7 +217,7 @@ private function retrieveAffectedIds(array $skus): array
220217
$affectedIds[] = array_keys($productId);
221218
}
222219

223-
return $affectedIds ? array_unique(array_merge(...$affectedIds)) : [];
220+
return array_unique(array_merge([], ...$affectedIds));
224221
}
225222

226223
/**

app/code/Magento/Catalog/Model/ProductLink/ProductLinkQuery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ private function extractRequestedLinkTypes(array $criteria): array
103103
if (count($linkTypesToLoad) === 1) {
104104
$linkTypesToLoad = $linkTypesToLoad[0];
105105
} else {
106-
$linkTypesToLoad = array_merge(...$linkTypesToLoad);
106+
$linkTypesToLoad = array_merge([], ...$linkTypesToLoad);
107107
}
108108
$linkTypesToLoad = array_flip($linkTypesToLoad);
109109
$linkTypes = array_filter(

app/code/Magento/Catalog/Model/ResourceModel/Product/LinkedProductSelectBuilderComposite.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function build(int $productId, int $storeId) : array
3333
foreach ($this->linkedProductSelectBuilder as $productSelectBuilder) {
3434
$selects[] = $productSelectBuilder->build($productId, $storeId);
3535
}
36-
$selects = array_merge(...$selects);
36+
$selects = array_merge([], ...$selects);
3737

3838
return $selects;
3939
}

0 commit comments

Comments
 (0)