diff --git a/lib/internal/Magento/Framework/View/Asset/Repository.php b/lib/internal/Magento/Framework/View/Asset/Repository.php index c898d57c11e7a..00db0627fcfdb 100644 --- a/lib/internal/Magento/Framework/View/Asset/Repository.php +++ b/lib/internal/Magento/Framework/View/Asset/Repository.php @@ -146,8 +146,13 @@ public function updateDesignParams(array &$params) } if ($theme) { - $params['themeModel'] = $this->getThemeProvider()->getThemeByFullPath($area . '/' . $theme); - if (!$params['themeModel']) { + if (is_numeric($theme)) { + $params['themeModel'] = $this->getThemeProvider()->getThemeById($theme); + } else { + $params['themeModel'] = $this->getThemeProvider()->getThemeByFullPath($area . '/' . $theme); + } + + if (!$params['themeModel']->getId()) { throw new \UnexpectedValueException("Could not find theme '$theme' for area '$area'"); } } elseif (empty($params['themeModel'])) {