Skip to content

Commit b7f2a66

Browse files
[EngCom] Public Pull Requests - 2.3-develop
- merged latest code from mainline branch
2 parents a312aae + 4e11084 commit b7f2a66

File tree

183 files changed

+4887
-618
lines changed

Some content is hidden

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

183 files changed

+4887
-618
lines changed

app/code/Magento/Bundle/Block/Adminhtml/Sales/Order/Items/Renderer.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ public function getChildren($item)
100100
}
101101

102102
/**
103+
* Check if item can be shipped separately
104+
*
103105
* @param mixed $item
104106
* @return bool
105107
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
@@ -136,6 +138,8 @@ public function isShipmentSeparately($item = null)
136138
}
137139

138140
/**
141+
* Check if child items calculated
142+
*
139143
* @param mixed $item
140144
* @return bool
141145
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
@@ -174,6 +178,8 @@ public function isChildCalculated($item = null)
174178
}
175179

176180
/**
181+
* Retrieve selection attributes values
182+
*
177183
* @param mixed $item
178184
* @return mixed|null
179185
*/
@@ -191,6 +197,8 @@ public function getSelectionAttributes($item)
191197
}
192198

193199
/**
200+
* Retrieve order item options array
201+
*
194202
* @return array
195203
*/
196204
public function getOrderOptions()
@@ -212,6 +220,8 @@ public function getOrderOptions()
212220
}
213221

214222
/**
223+
* Retrieve order item
224+
*
215225
* @return mixed
216226
*/
217227
public function getOrderItem()
@@ -223,6 +233,8 @@ public function getOrderItem()
223233
}
224234

225235
/**
236+
* Get html info for item
237+
*
226238
* @param mixed $item
227239
* @return string
228240
*/
@@ -245,6 +257,8 @@ public function getValueHtml($item)
245257
}
246258

247259
/**
260+
* Check if we can show price info for this item
261+
*
248262
* @param object $item
249263
* @return bool
250264
*/

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,17 @@
2828
<?php endif; ?>
2929

3030
<?php foreach ($items as $_item): ?>
31+
<?php
32+
$shipTogether = ($_item->getOrderItem()->getProductType() == \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE) ?
33+
!$_item->getOrderItem()->isShipSeparately() : !$_item->getOrderItem()->getParentItem()->isShipSeparately()
34+
?>
3135
<?php $block->setPriceDataObject($_item) ?>
3236
<?php if ($_item->getOrderItem()->getParentItem()): ?>
37+
<?php
38+
if ($shipTogether) {
39+
continue;
40+
}
41+
?>
3342
<?php $attributes = $block->getSelectionAttributes($_item) ?>
3443
<?php if ($_prevOptionId != $attributes['option_id']): ?>
3544
<tr>
@@ -60,14 +69,14 @@
6069
</td>
6170
<?php endif; ?>
6271
<td class="col-price">
63-
<?php if ($block->canShowPriceInfo($_item)): ?>
72+
<?php if ($block->canShowPriceInfo($_item) || $shipTogether): ?>
6473
<?= $block->getColumnHtml($_item, 'price') ?>
6574
<?php else: ?>
6675
&nbsp;
6776
<?php endif; ?>
6877
</td>
6978
<td class="col-qty">
70-
<?php if ($block->canShowPriceInfo($_item)): ?>
79+
<?php if ($block->canShowPriceInfo($_item) || $shipTogether): ?>
7180
<table class="qty-table">
7281
<tr>
7382
<th><?= /* @escapeNotVerified */ __('Ordered') ?></th>
@@ -116,7 +125,7 @@
116125
<?php endif; ?>
117126
</td>
118127
<td class="col-qty-invoice">
119-
<?php if ($block->canShowPriceInfo($_item)): ?>
128+
<?php if ($block->canShowPriceInfo($_item) || $shipTogether): ?>
120129
<?php if ($block->canEditQty()) : ?>
121130
<input type="text"
122131
class="input-text admin__control-text qty-input"

app/code/Magento/Catalog/Block/Adminhtml/Category/AbstractCategory.php

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ public function getCategory()
6767
}
6868

6969
/**
70+
* Get category id
71+
*
7072
* @return int|string|null
7173
*/
7274
public function getCategoryId()
@@ -78,6 +80,8 @@ public function getCategoryId()
7880
}
7981

8082
/**
83+
* Get category name
84+
*
8185
* @return string
8286
*/
8387
public function getCategoryName()
@@ -86,6 +90,8 @@ public function getCategoryName()
8690
}
8791

8892
/**
93+
* Get category path
94+
*
8995
* @return mixed
9096
*/
9197
public function getCategoryPath()
@@ -97,6 +103,8 @@ public function getCategoryPath()
97103
}
98104

99105
/**
106+
* Check store root category
107+
*
100108
* @return bool
101109
*/
102110
public function hasStoreRootCategory()
@@ -109,6 +117,8 @@ public function hasStoreRootCategory()
109117
}
110118

111119
/**
120+
* Get store from request
121+
*
112122
* @return Store
113123
*/
114124
public function getStore()
@@ -118,6 +128,8 @@ public function getStore()
118128
}
119129

120130
/**
131+
* Get root category for tree
132+
*
121133
* @param mixed|null $parentNodeCategory
122134
* @param int $recursionLevel
123135
* @return Node|array|null
@@ -149,10 +161,11 @@ public function getRoot($parentNodeCategory = null, $recursionLevel = 3)
149161

150162
$root = $tree->getNodeById($rootId);
151163

152-
if ($root && $rootId != \Magento\Catalog\Model\Category::TREE_ROOT_ID) {
164+
if ($root) {
153165
$root->setIsVisible(true);
154-
} elseif ($root && $root->getId() == \Magento\Catalog\Model\Category::TREE_ROOT_ID) {
155-
$root->setName(__('Root'));
166+
if ($root->getId() == \Magento\Catalog\Model\Category::TREE_ROOT_ID) {
167+
$root->setName(__('Root'));
168+
}
156169
}
157170

158171
$this->_coreRegistry->register('root', $root);
@@ -162,6 +175,8 @@ public function getRoot($parentNodeCategory = null, $recursionLevel = 3)
162175
}
163176

164177
/**
178+
* Get Default Store Id
179+
*
165180
* @return int
166181
*/
167182
protected function _getDefaultStoreId()
@@ -170,6 +185,8 @@ protected function _getDefaultStoreId()
170185
}
171186

172187
/**
188+
* Get category collection
189+
*
173190
* @return \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
174191
*/
175192
public function getCategoryCollection()
@@ -227,6 +244,8 @@ public function getRootByIds($ids)
227244
}
228245

229246
/**
247+
* Get category node for tree
248+
*
230249
* @param mixed $parentNodeCategory
231250
* @param int $recursionLevel
232251
* @return Node
@@ -249,6 +268,8 @@ public function getNode($parentNodeCategory, $recursionLevel = 2)
249268
}
250269

251270
/**
271+
* Get category save url
272+
*
252273
* @param array $args
253274
* @return string
254275
*/
@@ -260,6 +281,8 @@ public function getSaveUrl(array $args = [])
260281
}
261282

262283
/**
284+
* Get category edit url
285+
*
263286
* @return string
264287
*/
265288
public function getEditUrl()

app/code/Magento/Catalog/Model/Api/SearchCriteria/CollectionProcessor/ConditionProcessor/ConditionBuilder/EavAttributeCondition.php

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -58,22 +58,38 @@ public function build(Filter $filter): string
5858
$conditionValue = $this->mapConditionValue($conditionType, $filter->getValue());
5959

6060
// NOTE: store scope was ignored intentionally to perform search across all stores
61-
$attributeSelect = $this->resourceConnection->getConnection()
62-
->select()
63-
->from(
64-
[$tableAlias => $attribute->getBackendTable()],
65-
$tableAlias . '.' . $attribute->getEntityIdField()
66-
)->where(
67-
$this->resourceConnection->getConnection()->prepareSqlCondition(
68-
$tableAlias . '.' . $attribute->getIdFieldName(),
69-
['eq' => $attribute->getAttributeId()]
70-
)
71-
)->where(
72-
$this->resourceConnection->getConnection()->prepareSqlCondition(
73-
$tableAlias . '.value',
74-
[$conditionType => $conditionValue]
75-
)
76-
);
61+
if ($conditionType == 'is_null') {
62+
$entityResourceModel = $attribute->getEntity();
63+
$attributeSelect = $this->resourceConnection->getConnection()
64+
->select()
65+
->from(
66+
[Collection::MAIN_TABLE_ALIAS => $entityResourceModel->getEntityTable()],
67+
Collection::MAIN_TABLE_ALIAS . '.' . $entityResourceModel->getEntityIdField()
68+
)->joinLeft(
69+
[$tableAlias => $attribute->getBackendTable()],
70+
$tableAlias . '.' . $attribute->getEntityIdField() . '=' . Collection::MAIN_TABLE_ALIAS .
71+
'.' . $entityResourceModel->getEntityIdField() . ' AND ' . $tableAlias . '.' .
72+
$attribute->getIdFieldName() . '=' . $attribute->getAttributeId(),
73+
''
74+
)->where($tableAlias . '.value is null');
75+
} else {
76+
$attributeSelect = $this->resourceConnection->getConnection()
77+
->select()
78+
->from(
79+
[$tableAlias => $attribute->getBackendTable()],
80+
$tableAlias . '.' . $attribute->getEntityIdField()
81+
)->where(
82+
$this->resourceConnection->getConnection()->prepareSqlCondition(
83+
$tableAlias . '.' . $attribute->getIdFieldName(),
84+
['eq' => $attribute->getAttributeId()]
85+
)
86+
)->where(
87+
$this->resourceConnection->getConnection()->prepareSqlCondition(
88+
$tableAlias . '.value',
89+
[$conditionType => $conditionValue]
90+
)
91+
);
92+
}
7793

7894
return $this->resourceConnection
7995
->getConnection()
@@ -86,6 +102,8 @@ public function build(Filter $filter): string
86102
}
87103

88104
/**
105+
* Get attribute entity by its code
106+
*
89107
* @param string $field
90108
* @return Attribute
91109
* @throws \Magento\Framework\Exception\LocalizedException

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
use Magento\Framework\Api\SearchCriteriaInterface;
1616
use Magento\Framework\Api\SearchCriteria\CollectionProcessorInterface;
1717

18+
/**
19+
* Class for getting category list.
20+
*/
1821
class CategoryList implements CategoryListInterface
1922
{
2023
/**
@@ -64,7 +67,7 @@ public function __construct(
6467
}
6568

6669
/**
67-
* {@inheritdoc}
70+
* @inheritdoc
6871
*/
6972
public function getList(SearchCriteriaInterface $searchCriteria)
7073
{
@@ -73,10 +76,11 @@ public function getList(SearchCriteriaInterface $searchCriteria)
7376
$this->extensionAttributesJoinProcessor->process($collection);
7477

7578
$this->collectionProcessor->process($searchCriteria, $collection);
79+
$collection->load();
7680

7781
$items = [];
78-
foreach ($collection->getAllIds() as $id) {
79-
$items[] = $this->categoryRepository->get($id);
82+
foreach ($collection->getItems() as $category) {
83+
$items[] = $this->categoryRepository->get($category->getId());
8084
}
8185

8286
/** @var CategorySearchResultsInterface $searchResult */

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

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -113,27 +113,28 @@ private function customizeAttributeCode($meta)
113113
*/
114114
private function customizeFrontendLabels($meta)
115115
{
116+
$labelConfigs = [];
117+
116118
foreach ($this->storeRepository->getList() as $store) {
117119
$storeId = $store->getId();
118120

119121
if (!$storeId) {
120122
continue;
121123
}
122-
123-
$meta['manage-titles']['children'] = [
124-
'frontend_label[' . $storeId . ']' => $this->arrayManager->set(
125-
'arguments/data/config',
126-
[],
127-
[
128-
'formElement' => Input::NAME,
129-
'componentType' => Field::NAME,
130-
'label' => $store->getName(),
131-
'dataType' => Text::NAME,
132-
'dataScope' => 'frontend_label[' . $storeId . ']'
133-
]
134-
),
135-
];
124+
$labelConfigs['frontend_label[' . $storeId . ']'] = $this->arrayManager->set(
125+
'arguments/data/config',
126+
[],
127+
[
128+
'formElement' => Input::NAME,
129+
'componentType' => Field::NAME,
130+
'label' => $store->getName(),
131+
'dataType' => Text::NAME,
132+
'dataScope' => 'frontend_label[' . $storeId . ']'
133+
]
134+
);
136135
}
136+
$meta['manage-titles']['children'] = $labelConfigs;
137+
137138
return $meta;
138139
}
139140

0 commit comments

Comments
 (0)