Skip to content

Commit 088c14e

Browse files
Merge branch 2.3-develop into ENGCOM-4190-magento-magento2-21097
2 parents 269902a + 49a25f2 commit 088c14e

File tree

259 files changed

+7042
-1294
lines changed

Some content is hidden

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

259 files changed

+7042
-1294
lines changed

app/code/Magento/Backend/Controller/Adminhtml/Dashboard/RefreshStatistics.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@
66

77
namespace Magento\Backend\Controller\Adminhtml\Dashboard;
88

9-
class RefreshStatistics extends \Magento\Reports\Controller\Adminhtml\Report\Statistics
9+
use Magento\Framework\App\Action\HttpPostActionInterface;
10+
use Magento\Reports\Controller\Adminhtml\Report\Statistics;
11+
12+
/**
13+
* Refresh Dashboard statistics action.
14+
*/
15+
class RefreshStatistics extends Statistics implements HttpPostActionInterface
1016
{
1117
/**
1218
* @param \Magento\Backend\App\Action\Context $context
@@ -25,6 +31,8 @@ public function __construct(
2531
}
2632

2733
/**
34+
* Refresh statistics.
35+
*
2836
* @return \Magento\Backend\Model\View\Result\Redirect
2937
*/
3038
public function execute()

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/BundleGraphQl/Model/BundleProductTypeResolver.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,22 @@
88
namespace Magento\BundleGraphQl\Model;
99

1010
use Magento\Framework\GraphQl\Query\Resolver\TypeResolverInterface;
11+
use Magento\Bundle\Model\Product\Type as Type;
1112

1213
/**
13-
* {@inheritdoc}
14+
* @inheritdoc
1415
*/
1516
class BundleProductTypeResolver implements TypeResolverInterface
1617
{
18+
const BUNDLE_PRODUCT = 'BundleProduct';
19+
1720
/**
18-
* {@inheritdoc}
21+
* @inheritdoc
1922
*/
2023
public function resolveType(array $data) : string
2124
{
22-
if (isset($data['type_id']) && $data['type_id'] == 'bundle') {
23-
return 'BundleProduct';
25+
if (isset($data['type_id']) && $data['type_id'] == Type::TYPE_CODE) {
26+
return self::BUNDLE_PRODUCT;
2427
}
2528
return '';
2629
}

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/Block/Adminhtml/Form/Renderer/Fieldset/Element.php

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

7+
namespace Magento\Catalog\Block\Adminhtml\Form\Renderer\Fieldset;
8+
79
/**
810
* Catalog fieldset element renderer
911
*
1012
* @author Magento Core Team <core@magentocommerce.com>
1113
*/
12-
namespace Magento\Catalog\Block\Adminhtml\Form\Renderer\Fieldset;
13-
1414
class Element extends \Magento\Backend\Block\Widget\Form\Renderer\Fieldset\Element
1515
{
1616
/**
@@ -29,7 +29,7 @@ public function getDataObject()
2929
}
3030

3131
/**
32-
* Retireve associated with element attribute object
32+
* Retrieve associated with element attribute object
3333
*
3434
* @return \Magento\Catalog\Model\ResourceModel\Eav\Attribute
3535
*/

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

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,10 +1119,15 @@ public function reindex()
11191119
}
11201120
}
11211121
$productIndexer = $this->indexerRegistry->get(Indexer\Category\Product::INDEXER_ID);
1122-
if (!$productIndexer->isScheduled()
1123-
&& (!empty($this->getAffectedProductIds()) || $this->dataHasChangedFor('is_anchor'))
1124-
) {
1125-
$productIndexer->reindexList($this->getPathIds());
1122+
1123+
if (!empty($this->getAffectedProductIds())
1124+
|| $this->dataHasChangedFor('is_anchor')
1125+
|| $this->dataHasChangedFor('is_active')) {
1126+
if (!$productIndexer->isScheduled()) {
1127+
$productIndexer->reindexList($this->getPathIds());
1128+
} else {
1129+
$productIndexer->invalidate();
1130+
}
11261131
}
11271132
}
11281133

@@ -1147,9 +1152,17 @@ public function getIdentities()
11471152
$identities = [
11481153
self::CACHE_TAG . '_' . $this->getId(),
11491154
];
1155+
11501156
if ($this->hasDataChanges()) {
11511157
$identities[] = Product::CACHE_PRODUCT_CATEGORY_TAG . '_' . $this->getId();
11521158
}
1159+
1160+
if ($this->dataHasChangedFor('is_anchor') || $this->dataHasChangedFor('is_active')) {
1161+
foreach ($this->getPathIds() as $id) {
1162+
$identities[] = Product::CACHE_PRODUCT_CATEGORY_TAG . '_' . $id;
1163+
}
1164+
}
1165+
11531166
if (!$this->getId() || $this->isDeleted() || $this->dataHasChangedFor(self::KEY_INCLUDE_IN_MENU)) {
11541167
$identities[] = self::CACHE_TAG;
11551168
$identities[] = Product::CACHE_PRODUCT_CATEGORY_TAG . '_' . $this->getId();

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 */

0 commit comments

Comments
 (0)