Skip to content

Commit

Permalink
https://github.com/cabinetsbay/site/issues/49
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrii-fediuk committed Dec 31, 2023
1 parent bd17597 commit bd10d49
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions vendor/magento/module-cms/Model/Page/DataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,17 +214,21 @@ public function getMeta()
$options = [['label' => 'No update', 'value' => '_no_update_']];

$page = null;
try {
$page = $this->pageRepository->getById($this->getPageId());
if ($page->getCustomLayoutUpdateXml() || $page->getLayoutUpdateXml()) {
$options[] = ['label' => 'Use existing layout update XML', 'value' => '_existing_'];
}
foreach ($this->customLayoutManager->fetchAvailableFiles($page) as $layoutFile) {
$options[] = ['label' => $layoutFile, 'value' => $layoutFile];
}
} catch (LocalizedException $e) {
$this->logger->error($e->getMessage());
}
# 2023-12-31 Dmitrii Fediuk https://upwork.com/fl/mage2pro
# «The CMS page with the "0" ID doesn't exist»: https://github.com/cabinetsbay/site/issues/49
if ($this->getPageId()) {
try {
$page = $this->pageRepository->getById($this->getPageId());
if ($page->getCustomLayoutUpdateXml() || $page->getLayoutUpdateXml()) {
$options[] = ['label' => 'Use existing layout update XML', 'value' => '_existing_'];
}
foreach ($this->customLayoutManager->fetchAvailableFiles($page) as $layoutFile) {
$options[] = ['label' => $layoutFile, 'value' => $layoutFile];
}
} catch (LocalizedException $e) {
$this->logger->error($e->getMessage());
}
}

$customLayoutMeta = [
'design' => [
Expand Down

0 comments on commit bd10d49

Please sign in to comment.