File tree 2 files changed +5
-2
lines changed
app/code/Magento/CmsGraphQl/Model/Resolver
2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,10 @@ private function getBlocksData(array $blockIdentifiers): array
78
78
$ blocksData = [];
79
79
try {
80
80
foreach ($ blockIdentifiers as $ blockIdentifier ) {
81
- $ blocksData [$ blockIdentifier ] = $ this ->blockDataProvider ->getData ($ blockIdentifier );
81
+ $ blockData = $ this ->blockDataProvider ->getData ($ blockIdentifier );
82
+ if (!empty ($ blockData )) {
83
+ $ blocksData [$ blockIdentifier ] = $ blockData ;
84
+ }
82
85
}
83
86
} catch (NoSuchEntityException $ e ) {
84
87
throw new GraphQlNoSuchEntityException (__ ($ e ->getMessage ()), $ e );
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ public function getData(string $blockIdentifier): array
49
49
$ block = $ this ->blockRepository ->getById ($ blockIdentifier );
50
50
51
51
if (false === $ block ->isActive ()) {
52
- throw new NoSuchEntityException () ;
52
+ return [] ;
53
53
}
54
54
55
55
$ renderedContent = $ this ->widgetFilter ->filter ($ block ->getContent ());
You can’t perform that action at this time.
0 commit comments