File tree 1 file changed +13
-1
lines changed
app/code/Magento/CmsGraphQl/Model/Resolver
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 14
14
use Magento \Framework \GraphQl \Exception \GraphQlNoSuchEntityException ;
15
15
use Magento \Framework \GraphQl \Query \ResolverInterface ;
16
16
use Magento \Framework \GraphQl \Schema \Type \ResolveInfo ;
17
+ use Psr \Log \LoggerInterface ;
17
18
18
19
/**
19
20
* CMS blocks field resolver, used for GraphQL request processing
@@ -25,13 +26,20 @@ class Blocks implements ResolverInterface
25
26
*/
26
27
private $ blockDataProvider ;
27
28
29
+ /**
30
+ * @var LoggerInterface
31
+ */
32
+ private $ logger ;
33
+
28
34
/**
29
35
* @param BlockDataProvider $blockDataProvider
30
36
*/
31
37
public function __construct (
32
- BlockDataProvider $ blockDataProvider
38
+ BlockDataProvider $ blockDataProvider ,
39
+ LoggerInterface $ logger
33
40
) {
34
41
$ this ->blockDataProvider = $ blockDataProvider ;
42
+ $ this ->logger = $ logger ;
35
43
}
36
44
37
45
/**
@@ -81,6 +89,10 @@ private function getBlocksData(array $blockIdentifiers): array
81
89
$ blockData = $ this ->blockDataProvider ->getData ($ blockIdentifier );
82
90
if (!empty ($ blockData )) {
83
91
$ blocksData [$ blockIdentifier ] = $ blockData ;
92
+ } else {
93
+ $ this ->logger ->warning (
94
+ sprintf ('The CMS block with the "%s" Identifier is disabled. ' , $ blockIdentifier )
95
+ );
84
96
}
85
97
}
86
98
} catch (NoSuchEntityException $ e ) {
You can’t perform that action at this time.
0 commit comments