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 1
1
<?php
2
2
/**
3
- * Copyright © Magento, Inc. All rights reserved.
4
- * See COPYING.txt for license details .
3
+ * Copyright 2015 Adobe
4
+ * All Rights Reserved .
5
5
*/
6
6
namespace Magento \Cms \Model \Page ;
7
7
@@ -215,12 +215,15 @@ public function getMeta()
215
215
216
216
$ page = null ;
217
217
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
+ }
224
227
}
225
228
} catch (LocalizedException $ e ) {
226
229
$ this ->logger ->error ($ e ->getMessage ());
You can’t perform that action at this time.
0 commit comments