Skip to content

Commit fda77d0

Browse files
committed
Fix rename tab Image Management
1 parent 43f1fbc commit fda77d0

File tree

3 files changed

+72
-26
lines changed

3 files changed

+72
-26
lines changed

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

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -40,31 +40,6 @@ public function __construct(CategorySetupFactory $categorySetupFactory)
4040
public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
4141
{
4242
$setup->startSetup();
43-
if (version_compare($context->getVersion(), '2.0.1') < 0) {
44-
/** @var \Magento\Catalog\Setup\CategorySetup $categorySetup */
45-
$categorySetup = $this->categorySetupFactory->create(['setup' => $setup]);
46-
47-
$entityTypeId = $categorySetup->getEntityTypeId(\Magento\Catalog\Model\Product::ENTITY);
48-
$attributeSetId = $categorySetup->getDefaultAttributeSetId($entityTypeId);
49-
50-
$attributeGroup = $categorySetup->getAttributeGroup(
51-
$entityTypeId,
52-
$attributeSetId,
53-
'Images',
54-
'attribute_group_name'
55-
);
56-
if (isset($attributeGroup['attribute_group_name']) && $attributeGroup['attribute_group_name'] == 'Images') {
57-
// update General Group
58-
$categorySetup->updateAttributeGroup(
59-
$entityTypeId,
60-
$attributeSetId,
61-
$attributeGroup['attribute_group_id'],
62-
'attribute_group_name',
63-
'Images and Videos'
64-
);
65-
}
66-
}
67-
6843
if ($context->getVersion()
6944
&& version_compare($context->getVersion(), '2.0.1') < 0
7045
) {
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\ProductVideo\Setup;
8+
9+
use Magento\Catalog\Setup\CategorySetupFactory;
10+
use Magento\Framework\Setup\UpgradeDataInterface;
11+
use Magento\Framework\Setup\ModuleContextInterface;
12+
use Magento\Framework\Setup\ModuleDataSetupInterface;
13+
14+
/**
15+
* Upgrade Data script
16+
* @codeCoverageIgnore
17+
*/
18+
class UpgradeData implements UpgradeDataInterface
19+
{
20+
/**
21+
* Category setup factory
22+
*
23+
* @var CategorySetupFactory
24+
*/
25+
private $categorySetupFactory;
26+
27+
/**
28+
* Init
29+
*
30+
* @param CategorySetupFactory $categorySetupFactory
31+
*/
32+
public function __construct(CategorySetupFactory $categorySetupFactory)
33+
{
34+
$this->categorySetupFactory = $categorySetupFactory;
35+
}
36+
37+
/**
38+
* {@inheritdoc}
39+
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
40+
*/
41+
public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
42+
{
43+
$setup->startSetup();
44+
if (version_compare($context->getVersion(), '2.0.0.2') < 0) {
45+
/** @var \Magento\Catalog\Setup\CategorySetup $categorySetup */
46+
$categorySetup = $this->categorySetupFactory->create(['setup' => $setup]);
47+
48+
$entityTypeId = $categorySetup->getEntityTypeId(\Magento\Catalog\Model\Product::ENTITY);
49+
$attributeSetId = $categorySetup->getDefaultAttributeSetId($entityTypeId);
50+
51+
$attributeGroup = $categorySetup->getAttributeGroup(
52+
$entityTypeId,
53+
$attributeSetId,
54+
'Image Management'
55+
);
56+
if (isset($attributeGroup['attribute_group_name']) && $attributeGroup['attribute_group_name'] == 'Image Management') {
57+
// update General Group
58+
$categorySetup->updateAttributeGroup(
59+
$entityTypeId,
60+
$attributeSetId,
61+
$attributeGroup['attribute_group_id'],
62+
'attribute_group_name',
63+
'Images and Videos'
64+
);
65+
}
66+
67+
}
68+
69+
$setup->endSetup();
70+
}
71+
}

app/code/Magento/ProductVideo/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_ProductVideo" setup_version="2.0.0.1">
9+
<module name="Magento_ProductVideo" setup_version="2.0.0.2">
1010
<sequence>
1111
<module name="Magento_Catalog"/>
1212
<module name="Magento_Backend"/>

0 commit comments

Comments
 (0)