File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
app/code/Magento/Cms/Model/Page Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change 11<?php
22/**
3- * Copyright © Magento, Inc. All rights reserved.
4- * See COPYING.txt for license details .
3+ * Copyright 2015 Adobe
4+ * All Rights Reserved .
55 */
66namespace Magento \Cms \Model \Page ;
77
@@ -215,12 +215,15 @@ public function getMeta()
215215
216216 $ page = null ;
217217 try {
218- $ page = $ this ->pageRepository ->getById ($ this ->getPageId ());
219- if ($ page ->getCustomLayoutUpdateXml () || $ page ->getLayoutUpdateXml ()) {
220- $ options [] = ['label ' => 'Use existing layout update XML ' , 'value ' => '_existing_ ' ];
221- }
222- foreach ($ this ->customLayoutManager ->fetchAvailableFiles ($ page ) as $ layoutFile ) {
223- $ options [] = ['label ' => $ layoutFile , 'value ' => $ layoutFile ];
218+ $ pageId = $ this ->getPageId ();
219+ if ($ pageId ) {
220+ $ page = $ this ->pageRepository ->getById ($ pageId );
221+ if ($ page ->getCustomLayoutUpdateXml () || $ page ->getLayoutUpdateXml ()) {
222+ $ options [] = ['label ' => 'Use existing layout update XML ' , 'value ' => '_existing_ ' ];
223+ }
224+ foreach ($ this ->customLayoutManager ->fetchAvailableFiles ($ page ) as $ layoutFile ) {
225+ $ options [] = ['label ' => $ layoutFile , 'value ' => $ layoutFile ];
226+ }
224227 }
225228 } catch (LocalizedException $ e ) {
226229 $ this ->logger ->error ($ e ->getMessage ());
You can’t perform that action at this time.
0 commit comments