Skip to content

Commit d4115bf

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-54200' into pr_branch
2 parents db987b2 + ec058d7 commit d4115bf

File tree

4 files changed

+18
-9
lines changed

4 files changed

+18
-9
lines changed

app/code/Magento/CatalogImportExport/Model/Export/Product.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ class Product extends \Magento\ImportExport\Model\Export\Entity\AbstractEntity
8585
*/
8686
protected $_indexValueAttributes = [
8787
'status',
88-
'gift_message_available',
8988
];
9089

9190
/**

app/code/Magento/CatalogImportExport/Model/Import/Product.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity
196196
protected $_indexValueAttributes = [
197197
'status',
198198
'tax_class_id',
199-
'gift_message_available',
200199
];
201200

202201
/**

app/code/Magento/GiftMessage/Setup/InstallData.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function install(ModuleDataSetupInterface $setup, ModuleContextInterface
9494
'label' => 'Allow Gift Message',
9595
'input' => 'select',
9696
'class' => '',
97-
'source' => 'Magento\Eav\Model\Entity\Attribute\Source\Boolean',
97+
'source' => 'Magento\Catalog\Model\Product\Attribute\Source\Boolean',
9898
'global' => true,
9999
'visible' => true,
100100
'required' => false,

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

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,20 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
3535
{
3636
$setup->startSetup();
3737

38+
/** @var \Magento\Catalog\Setup\CategorySetup $categorySetup */
39+
$categorySetup = $this->categorySetupFactory->create(['setup' => $setup]);
40+
$entityTypeId = $categorySetup->getEntityTypeId(Product::ENTITY);
41+
$attributeSetId = $categorySetup->getAttributeSetId($entityTypeId, 'Default');
42+
$attribute = $categorySetup->getAttribute($entityTypeId, 'gift_message_available');
43+
3844
if (version_compare($context->getVersion(), '2.0.1', '<')) {
39-
/** @var \Magento\Catalog\Setup\CategorySetup $categorySetup */
40-
$categorySetup = $this->categorySetupFactory->create(['setup' => $setup]);
45+
4146
$groupName = 'Gift Options';
4247

4348
if (!$categorySetup->getAttributeGroup(Product::ENTITY, 'Default', $groupName)) {
4449
$categorySetup->addAttributeGroup(Product::ENTITY, 'Default', $groupName, 60);
4550
}
4651

47-
$entityTypeId = $categorySetup->getEntityTypeId(Product::ENTITY);
48-
$attributeSetId = $categorySetup->getAttributeSetId($entityTypeId, 'Default');
49-
$attribute = $categorySetup->getAttribute($entityTypeId, 'gift_message_available');
50-
5152
$categorySetup->addAttributeToGroup(
5253
$entityTypeId,
5354
$attributeSetId,
@@ -57,6 +58,16 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
5758
);
5859
}
5960

61+
if (version_compare($context->getVersion(), '2.1.0', '<')) {
62+
63+
$categorySetup->updateAttribute(
64+
$entityTypeId,
65+
$attribute['attribute_id'],
66+
'source_model',
67+
'Magento\Catalog\Model\Product\Attribute\Source\Boolean'
68+
);
69+
}
70+
6071
$setup->endSetup();
6172
}
6273
}

0 commit comments

Comments
 (0)