Skip to content

Commit bcedaf5

Browse files
Fix automatic identification of module name in AbstractBlock when module namespace is not explicit in template file location
This issue affects all modules starting with word Block Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: 'template.phtml' in module: 'Vendor' block's name: 'my-block'
1 parent d6ef3ef commit bcedaf5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/Magento/Framework/View/Element/AbstractBlock.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,7 @@ public static function extractModuleName($className)
874874
$namespace = substr(
875875
$className,
876876
0,
877-
strpos($className, '\\' . 'Block')
877+
strpos($className, '\\' . 'Block' . '\\')
878878
);
879879
return str_replace('\\', '_', $namespace);
880880
}

0 commit comments

Comments
 (0)