Skip to content

Commit 19b7122

Browse files
author
Oleksandr Gorkun
committed
MC-18685: Remove custom layout updates from admin
1 parent 231f039 commit 19b7122

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

app/code/Magento/CatalogSampleData/Model/Product.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ public function install(array $productFixtures, array $galleryFixtures)
103103
$this->eavConfig->clear();
104104
$this->setGalleryFixtures($galleryFixtures);
105105

106+
/** @var \Magento\Catalog\Model\Product $product */
106107
$product = $this->productFactory->create();
107108
foreach ($productFixtures as $fileName) {
108109
$fileName = $this->fixtureManager->getFixture($fileName);
@@ -138,6 +139,10 @@ public function install(array $productFixtures, array $galleryFixtures)
138139
}
139140

140141
$this->prepareProduct($product, $data);
142+
$product->setData('custom_layout_update', null);
143+
if ($product->hasData(\Magento\Catalog\Model\Product::CUSTOM_ATTRIBUTES)) {
144+
$product->setCustomAttribute('custom_layout_update', null);
145+
}
141146

142147
$product->save();
143148
$this->installGallery($product);

app/code/Magento/CmsSampleData/Model/Page.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,13 @@ public function install(array $fixtures)
6060
}
6161
$row = $data;
6262

63-
$this->pageFactory->create()
64-
->load($row['identifier'], 'identifier')
65-
->addData($row)
66-
->setStores([\Magento\Store\Model\Store::DEFAULT_STORE_ID])
67-
->save();
63+
/** @var \Magento\Cms\Model\Page $page */
64+
$page = $this->pageFactory->create();
65+
$page->load($row['identifier'], 'identifier');
66+
$page->addData($row);
67+
$page->setCustomLayoutUpdateXml(null);
68+
$page->setStores([\Magento\Store\Model\Store::DEFAULT_STORE_ID]);
69+
$page->save();
6870
}
6971
}
7072
}

0 commit comments

Comments
 (0)