Skip to content

Commit 36268c6

Browse files
committed
Allow directory to be not set for non-module types.
1 parent ae3cbb9 commit 36268c6

File tree

1 file changed

+3
-2
lines changed
  • lib/internal/Magento/Framework/Module

1 file changed

+3
-2
lines changed

lib/internal/Magento/Framework/Module/Dir.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ public function getDir($moduleName, $type = '')
4545
{
4646
$path = $this->componentRegistrar->getPath(ComponentRegistrar::MODULE, $moduleName);
4747

48-
if (!isset($path)) {
49-
// (Do not throw \LogicException, as it would break backwards-compatibility.)
48+
// An empty $type means it's gettind the directory of the module itself.
49+
if (empty($type) && !isset($path)) {
50+
// Note: do not throw \LogicException, as it would break backwards-compatibility.
5051
throw new \InvalidArgumentException("Component '$moduleName' of type '$type' is not correctly registered.");
5152
}
5253

0 commit comments

Comments
 (0)