We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6e2f90b commit 476a551Copy full SHA for 476a551
app/code/Magento/Cms/Block/BlockByIdentifier.php
@@ -107,6 +107,7 @@ private function filterOutput(string $content): string
107
*
108
* @return BlockInterface|BlockModel
109
* @throws \InvalidArgumentException
110
+ * @throws NoSuchEntityException
111
*/
112
private function getCmsBlock(): BlockInterface
113
{
@@ -119,6 +120,12 @@ private function getCmsBlock(): BlockInterface
119
120
(string)$this->getIdentifier(),
121
$this->getCurrentStoreId()
122
);
123
+
124
+ if (!$this->cmsBlock->isActive()) {
125
+ throw new NoSuchEntityException(
126
+ __('The CMS block with identifier "%identifier" is not enabled.', $this->getIdentifier())
127
+ );
128
+ }
129
}
130
131
return $this->cmsBlock;
0 commit comments