Skip to content

Commit 47ad2c7

Browse files
author
Hiep Ho Minh
committed
Correct the error message in case $block is still created but is not an AbstractBlock
1 parent 041b816 commit 47ad2c7

File tree

1 file changed

+1
-1
lines changed
  • lib/internal/Magento/Framework/View/Layout/Generator

1 file changed

+1
-1
lines changed

lib/internal/Magento/Framework/View/Layout/Generator/Block.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ protected function getBlockInstance($block, array $arguments = [])
261261
}
262262
if (!$block instanceof \Magento\Framework\View\Element\AbstractBlock) {
263263
throw new \Magento\Framework\Exception\LocalizedException(
264-
new \Magento\Framework\Phrase('Invalid block type: %1', [$block]),
264+
new \Magento\Framework\Phrase('Invalid block type: %1', [is_object($block) ? get_class($block) : (string) $block]),
265265
$e
266266
);
267267
}

0 commit comments

Comments
 (0)