Skip to content

Commit 809da32

Browse files
committed
Merge remote-tracking branch 'mainline/develop' into MAGETWO-53550
2 parents 985fb3f + 0c6227d commit 809da32

File tree

63 files changed

+1397
-415
lines changed

Some content is hidden

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

63 files changed

+1397
-415
lines changed

app/code/Magento/Bundle/Setup/InstallSchema.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con
2424
$installer = $setup;
2525

2626
$installer->startSetup();
27-
27+
$customerGroupTable = $setup->getConnection()->describeTable($setup->getTable('customer_group'));
28+
$customerGroupIdType = $customerGroupTable['customer_group_id']['DATA_TYPE'] == 'int'
29+
? \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER : $customerGroupTable['customer_group_id']['DATA_TYPE'];
2830
/**
2931
* Create table 'catalog_product_bundle_option'
3032
*/
@@ -340,7 +342,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con
340342
)
341343
->addColumn(
342344
'customer_group_id',
343-
\Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT,
345+
$customerGroupIdType,
344346
null,
345347
['unsigned' => true, 'nullable' => false, 'primary' => true],
346348
'Customer Group Id'

app/code/Magento/Bundle/Setup/UpgradeSchema.php

100644100755
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,24 @@ public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $con
4444
}
4545
}
4646

47+
if (version_compare($context->getVersion(), '2.0.3', '<')) {
48+
$tables = [
49+
'catalog_product_index_price_bundle_idx',
50+
'catalog_product_index_price_bundle_opt_idx',
51+
'catalog_product_index_price_bundle_opt_tmp',
52+
'catalog_product_index_price_bundle_sel_idx',
53+
'catalog_product_index_price_bundle_sel_tmp',
54+
'catalog_product_index_price_bundle_tmp',
55+
];
56+
foreach ($tables as $table) {
57+
$setup->getConnection()->modifyColumn(
58+
$setup->getTable($table),
59+
'customer_group_id',
60+
['type' => 'integer', 'nullable' => false]
61+
);
62+
}
63+
}
64+
4765
$setup->endSetup();
4866
}
4967
}

app/code/Magento/Bundle/etc/module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
9-
<module name="Magento_Bundle" setup_version="2.0.2">
9+
<module name="Magento_Bundle" setup_version="2.0.3">
1010
<sequence>
1111
<module name="Magento_Catalog"/>
1212
</sequence>

app/code/Magento/Catalog/Controller/Adminhtml/Product/AddAttributeToTemplate.php

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use Magento\Eav\Api\Data\AttributeInterface;
1717
use Magento\Eav\Api\Data\AttributeSetInterface;
1818
use Magento\Framework\Api\SearchCriteriaBuilder;
19-
use Magento\Framework\Api\SortOrderBuilder;
2019
use Magento\Framework\Exception\LocalizedException;
2120
use Psr\Log\LoggerInterface;
2221
use Magento\Framework\Api\ExtensionAttributesFactory;
@@ -53,11 +52,6 @@ class AddAttributeToTemplate extends \Magento\Catalog\Controller\Adminhtml\Produ
5352
*/
5453
protected $searchCriteriaBuilder;
5554

56-
/**
57-
* @var SortOrderBuilder
58-
*/
59-
protected $sortOrderBuilder;
60-
6155
/**
6256
* @var AttributeGroupInterfaceFactory
6357
*/
@@ -115,7 +109,6 @@ public function execute()
115109
$attributeGroupSearchCriteria = $this->getSearchCriteriaBuilder()
116110
->addFilter('attribute_set_id', $attributeSet->getAttributeSetId())
117111
->addFilter('attribute_group_code', $groupCode)
118-
->addSortOrder($this->getSortOrderBuilder()->setAscendingDirection()->create())
119112
->setPageSize(1)
120113
->create();
121114

@@ -252,18 +245,6 @@ private function getSearchCriteriaBuilder()
252245
return $this->searchCriteriaBuilder;
253246
}
254247

255-
/**
256-
* @return SortOrderBuilder
257-
*/
258-
private function getSortOrderBuilder()
259-
{
260-
if (null === $this->sortOrderBuilder) {
261-
$this->sortOrderBuilder = \Magento\Framework\App\ObjectManager::getInstance()
262-
->get(\Magento\Framework\Api\SortOrderBuilder::class);
263-
}
264-
return $this->sortOrderBuilder;
265-
}
266-
267248
/**
268249
* @return AttributeManagementInterface
269250
*/

app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Url/Rewrite/Suffix.php

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ class Suffix extends \Magento\Framework\App\Config\Value
4040
*/
4141
protected $resource;
4242

43+
/**
44+
* @var \Magento\Framework\App\Config\ScopePool
45+
*/
46+
private $scopePool;
47+
4348
/**
4449
* @param \Magento\Framework\Model\Context $context
4550
* @param \Magento\Framework\Registry $registry
@@ -75,6 +80,22 @@ public function __construct(
7580
$this->resource = $appResource;
7681
}
7782

83+
/**
84+
* Get instance of ScopePool
85+
*
86+
* @return \Magento\Framework\App\Config\ScopePool
87+
* @deprecated
88+
*/
89+
private function getScopePool()
90+
{
91+
if ($this->scopePool === null) {
92+
$this->scopePool = \Magento\Framework\App\ObjectManager::getInstance()->get(
93+
\Magento\Framework\App\Config\ScopePool::class
94+
);
95+
}
96+
return $this->scopePool;
97+
}
98+
7899
/**
79100
* Check url rewrite suffix - whether we can support it
80101
*
@@ -103,6 +124,24 @@ public function afterSave()
103124
return parent::afterSave();
104125
}
105126

127+
/**
128+
* {@inheritdoc}
129+
*/
130+
public function afterDeleteCommit()
131+
{
132+
if ($this->isValueChanged()) {
133+
$this->updateSuffixForUrlRewrites();
134+
if ($this->isCategorySuffixChanged()) {
135+
$this->cacheTypeList->invalidate([
136+
\Magento\Framework\App\Cache\Type\Block::TYPE_IDENTIFIER,
137+
\Magento\Framework\App\Cache\Type\Collection::TYPE_IDENTIFIER
138+
]);
139+
}
140+
}
141+
142+
return parent::afterDeleteCommit();
143+
}
144+
106145
/**
107146
* Check is category suffix changed
108147
*
@@ -135,7 +174,12 @@ protected function updateSuffixForUrlRewrites()
135174
}
136175
$entities = $this->urlFinder->findAllByData($dataFilter);
137176
$oldSuffixPattern = '~' . preg_quote($this->getOldValue()) . '$~';
138-
$suffix = $this->getValue();
177+
if ($this->getValue() !== null) {
178+
$suffix = $this->getValue();
179+
} else {
180+
$this->getScopePool()->clean();
181+
$suffix = $this->_config->getValue($this->getPath());
182+
}
139183
foreach ($entities as $urlRewrite) {
140184
$bind = $urlRewrite->getIsAutogenerated()
141185
? [UrlRewrite::REQUEST_PATH => preg_replace($oldSuffixPattern, $suffix, $urlRewrite->getRequestPath())]

app/code/Magento/Catalog/Setup/InstallSchema.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1853,6 +1853,9 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con
18531853
$installer->getConnection()
18541854
->createTable($table);
18551855

1856+
$customerGroupTable = $setup->getConnection()->describeTable($setup->getTable('customer_group'));
1857+
$customerGroupIdType = $customerGroupTable['customer_group_id']['DATA_TYPE'] == 'int'
1858+
? \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER : $customerGroupTable['customer_group_id']['DATA_TYPE'];
18561859
/**
18571860
* Create table 'catalog_product_entity_tier_price'
18581861
*/
@@ -1883,7 +1886,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con
18831886
)
18841887
->addColumn(
18851888
'customer_group_id',
1886-
\Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT,
1889+
$customerGroupIdType,
18871890
null,
18881891
['unsigned' => true, 'nullable' => false, 'default' => '0'],
18891892
'Customer Group ID'
@@ -2937,7 +2940,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con
29372940
)
29382941
->addColumn(
29392942
'customer_group_id',
2940-
\Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT,
2943+
$customerGroupIdType,
29412944
null,
29422945
['unsigned' => true, 'nullable' => false, 'primary' => true],
29432946
'Customer Group ID'
@@ -3056,7 +3059,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con
30563059
)
30573060
->addColumn(
30583061
'customer_group_id',
3059-
\Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT,
3062+
$customerGroupIdType,
30603063
null,
30613064
['unsigned' => true, 'nullable' => false, 'primary' => true],
30623065
'Customer Group ID'

app/code/Magento/Catalog/Setup/UpgradeSchema.php

100644100755
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,31 @@ public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $con
3636
if (version_compare($context->getVersion(), '2.1.0', '<')) {
3737
$this->addPercentageValueColumn($setup);
3838
}
39+
40+
if (version_compare($context->getVersion(), '2.1.1', '<')) {
41+
$tables = [
42+
'catalog_product_index_price_cfg_opt_agr_idx',
43+
'catalog_product_index_price_cfg_opt_agr_tmp',
44+
'catalog_product_index_price_cfg_opt_idx',
45+
'catalog_product_index_price_cfg_opt_tmp',
46+
'catalog_product_index_price_final_idx',
47+
'catalog_product_index_price_final_tmp',
48+
'catalog_product_index_price_idx',
49+
'catalog_product_index_price_opt_agr_idx',
50+
'catalog_product_index_price_opt_agr_tmp',
51+
'catalog_product_index_price_opt_idx',
52+
'catalog_product_index_price_opt_tmp',
53+
'catalog_product_index_price_tmp',
54+
];
55+
foreach ($tables as $table) {
56+
$setup->getConnection()->modifyColumn(
57+
$setup->getTable($table),
58+
'customer_group_id',
59+
['type' => 'integer', 'nullable' => false]
60+
);
61+
}
62+
}
63+
3964
$setup->endSetup();
4065
}
4166

0 commit comments

Comments
 (0)