File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
app/code/Magento/CmsGraphQl/Model/Resolver Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 1414use Magento \Framework \GraphQl \Exception \GraphQlNoSuchEntityException ;
1515use Magento \Framework \GraphQl \Query \ResolverInterface ;
1616use Magento \Framework \GraphQl \Schema \Type \ResolveInfo ;
17+ use Psr \Log \LoggerInterface ;
1718
1819/**
1920 * CMS blocks field resolver, used for GraphQL request processing
@@ -25,13 +26,20 @@ class Blocks implements ResolverInterface
2526 */
2627 private $ blockDataProvider ;
2728
29+ /**
30+ * @var LoggerInterface
31+ */
32+ private $ logger ;
33+
2834 /**
2935 * @param BlockDataProvider $blockDataProvider
3036 */
3137 public function __construct (
32- BlockDataProvider $ blockDataProvider
38+ BlockDataProvider $ blockDataProvider ,
39+ LoggerInterface $ logger
3340 ) {
3441 $ this ->blockDataProvider = $ blockDataProvider ;
42+ $ this ->logger = $ logger ;
3543 }
3644
3745 /**
@@ -81,6 +89,10 @@ private function getBlocksData(array $blockIdentifiers): array
8189 $ blockData = $ this ->blockDataProvider ->getData ($ blockIdentifier );
8290 if (!empty ($ blockData )) {
8391 $ blocksData [$ blockIdentifier ] = $ blockData ;
92+ } else {
93+ $ this ->logger ->warning (
94+ sprintf ('The CMS block with the "%s" Identifier is disabled. ' , $ blockIdentifier )
95+ );
8496 }
8597 }
8698 } catch (NoSuchEntityException $ e ) {
You can’t perform that action at this time.
0 commit comments