Skip to content

Commit f15e9ca

Browse files
authored
Merge f797367 into MAGETWO-67358
2 parents 915e480 + f797367 commit f15e9ca

File tree

142 files changed

+3769
-881
lines changed

Some content is hidden

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

142 files changed

+3769
-881
lines changed

app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
* See COPYING.txt for license details.
77
*/
88

9-
// @codingStandardsIgnoreFile
10-
119
namespace Magento\AdminNotification\Block\Grid\Renderer;
1210

1311
class Actions extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer
@@ -39,9 +37,8 @@ public function __construct(
3937
*/
4038
public function render(\Magento\Framework\DataObject $row)
4139
{
42-
$readDetailsHtml = $row->getUrl() ? '<a class="action-details" target="_blank" href="' . $row->getUrl() . '">' . __(
43-
'Read Details'
44-
) . '</a>' : '';
40+
$readDetailsHtml = $row->getUrl() ? '<a class="action-details" target="_blank" href="' . $row->getUrl() . '">' .
41+
__('Read Details') . '</a>' : '';
4542

4643
$markAsReadHtml = !$row->getIsRead() ? '<a class="action-mark" href="' . $this->getUrl(
4744
'*/*/markAsRead/',

app/code/Magento/AdminNotification/Block/ToolbarEntry.php

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

7-
// @codingStandardsIgnoreFile
8-
97
namespace Magento\AdminNotification\Block;
108

119
/**

app/code/Magento/AdminNotification/Model/ResourceModel/Grid/Collection.php

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

7-
// @codingStandardsIgnoreFile
8-
97
/**
108
* AdminNotification Inbox model
119
*
@@ -18,7 +16,7 @@ class Collection extends \Magento\AdminNotification\Model\ResourceModel\Inbox\Co
1816
/**
1917
* Add remove filter
2018
*
21-
* @return \Magento\AdminNotification\Model\ResourceModel\Grid\Collection|\Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
19+
* @return Collection|\Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
2220
*/
2321
protected function _initSelect()
2422
{

app/code/Magento/AdminNotification/Test/Unit/Block/ToolbarEntryTest.php

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

7-
// @codingStandardsIgnoreFile
8-
97
/**
108
* Test class for \Magento\AdminNotification\Block\ToolbarEntry
119
*/
@@ -53,7 +51,8 @@ public function testGetLatestUnreadNotifications()
5351

5452
// 1. Create mocks
5553
$notificationList = $this->getMockBuilder(
56-
\Magento\AdminNotification\Model\ResourceModel\Inbox\Collection\Unread::class)
54+
\Magento\AdminNotification\Model\ResourceModel\Inbox\Collection\Unread::class
55+
)
5756
->disableOriginalConstructor()
5857
->getMock();
5958

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public function getParentIdsByChild($childId)
126126
'e.' . $metadata->getLinkField() . ' = ' . $this->getMainTable() . '.parent_product_id',
127127
['e.entity_id as parent_product_id']
128128
)->where(
129-
'e.entity_id IN(?)',
129+
$this->getMainTable() . '.product_id IN(?)',
130130
$childId
131131
);
132132

app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundleAdvancedPricing.php

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,32 @@
77

88
use Magento\Catalog\Api\Data\ProductAttributeInterface;
99
use Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\AbstractModifier;
10+
use Magento\Framework\Stdlib\ArrayManager;
1011

1112
/**
1213
* Customize Advanced Pricing modal panel
1314
*/
1415
class BundleAdvancedPricing extends AbstractModifier
1516
{
17+
const CODE_PRICE_TYPE = 'price_type';
1618
const CODE_MSRP = 'msrp';
1719
const CODE_MSRP_DISPLAY_ACTUAL_PRICE_TYPE = 'msrp_display_actual_price_type';
1820
const CODE_ADVANCED_PRICING = 'advanced-pricing';
1921
const CODE_RECORD = 'record';
2022

23+
/**
24+
* @var ArrayManager
25+
*/
26+
private $arrayManager;
27+
28+
/**
29+
* @param ArrayManager $arrayManager
30+
*/
31+
public function __construct(ArrayManager $arrayManager)
32+
{
33+
$this->arrayManager = $arrayManager;
34+
}
35+
2136
/**
2237
* {@inheritdoc}
2338
*/
@@ -29,8 +44,7 @@ public function modifyMeta(array $meta)
2944
if (isset($parentNode['container_' . self::CODE_MSRP])
3045
&& isset($parentNode['container_' . self::CODE_MSRP_DISPLAY_ACTUAL_PRICE_TYPE])
3146
) {
32-
unset($parentNode['container_' . self::CODE_MSRP]);
33-
unset($parentNode['container_' . self::CODE_MSRP_DISPLAY_ACTUAL_PRICE_TYPE]);
47+
$parentNode = $this->modifyMsrpMeta($parentNode);
3448
}
3549
if (isset($parentNode['container_' . ProductAttributeInterface::CODE_SPECIAL_PRICE])) {
3650
$currentNode = &$parentNode['container_' . ProductAttributeInterface::CODE_SPECIAL_PRICE]['children'];
@@ -55,4 +69,45 @@ public function modifyData(array $data)
5569
{
5670
return $data;
5771
}
72+
73+
/**
74+
* Modify meta for MSRP fields.
75+
*
76+
* @param array $meta
77+
* @return array
78+
*/
79+
private function modifyMsrpMeta(array $meta)
80+
{
81+
$meta = $this->arrayManager->merge(
82+
$this->arrayManager->findPath(
83+
static::CODE_MSRP,
84+
$meta,
85+
null,
86+
'children'
87+
) . static::META_CONFIG_PATH,
88+
$meta,
89+
[
90+
'imports' => [
91+
'disabled' => 'ns = ${ $.ns }, index = ' . static::CODE_PRICE_TYPE . ':checked'
92+
]
93+
]
94+
);
95+
96+
$meta = $this->arrayManager->merge(
97+
$this->arrayManager->findPath(
98+
static::CODE_MSRP_DISPLAY_ACTUAL_PRICE_TYPE,
99+
$meta,
100+
null,
101+
'children'
102+
) . static::META_CONFIG_PATH,
103+
$meta,
104+
[
105+
'imports' => [
106+
'disabled' => 'ns = ${ $.ns }, index = ' . static::CODE_PRICE_TYPE . ':checked'
107+
]
108+
]
109+
);
110+
111+
return $meta;
112+
}
58113
}

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,13 @@ protected function syncData($indexer, $destinationTable, $ids)
148148
* @param \Magento\Catalog\Model\ResourceModel\Product\Indexer\Eav\AbstractEav $indexer
149149
* @param array $ids
150150
*
151-
* @return $ids
151+
* @param bool $onlyParents
152+
* @return array $ids
152153
*/
153-
protected function processRelations($indexer, $ids)
154+
protected function processRelations($indexer, $ids, $onlyParents = false)
154155
{
155156
$parentIds = $indexer->getRelationsByChild($ids);
156-
$childIds = $indexer->getRelationsByParent($ids);
157+
$childIds = $onlyParents ? [] : $indexer->getRelationsByParent($ids);
157158
return array_unique(array_merge($ids, $childIds, $parentIds));
158159
}
159160
}

app/code/Magento/Catalog/Model/Indexer/Product/Eav/Action/Full.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function execute($ids = null)
8383
$select->from(['e' => $entityMetadata->getEntityTable()], $entityMetadata->getIdentifierField());
8484
$entityIds = $this->batchProvider->getBatchIds($connection, $select, $batch);
8585
if (!empty($entityIds)) {
86-
$indexer->reindexEntities($this->processRelations($indexer, $entityIds));
86+
$indexer->reindexEntities($this->processRelations($indexer, $entityIds, true));
8787
$this->syncData($indexer, $mainTable);
8888
}
8989
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ private function cacheProduct($cacheKey, \Magento\Catalog\Api\Data\ProductInterf
308308

309309
if ($this->cacheLimit && count($this->instances) > $this->cacheLimit) {
310310
$offset = round($this->cacheLimit / -2);
311-
$this->instancesById = array_slice($this->instancesById, $offset);
311+
$this->instancesById = array_slice($this->instancesById, $offset, null, true);
312312
$this->instances = array_slice($this->instances, $offset);
313313
}
314314
}

app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/AbstractIndexer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ public function getRelationsByChild($childIds)
196196
$childIds
197197
);
198198

199-
return $connection->fetchCol($select);
199+
return array_map('intval', (array) $connection->fetchCol($select));
200200
}
201201

202202
/**
@@ -228,7 +228,7 @@ public function getRelationsByParent($parentIds)
228228
$result = $connection->fetchCol($select);
229229
}
230230

231-
return $result;
231+
return array_map('intval', $result);
232232
}
233233

234234
/**

0 commit comments

Comments
 (0)