From 0ec2c916c5c8cb6464b3ddd5f3b20b4e27e1f331 Mon Sep 17 00:00:00 2001 From: Johan Lindahl Date: Mon, 29 Jun 2020 11:07:20 +0200 Subject: [PATCH 1/2] AppState emulateAreaCode was not respected by file collector --- lib/internal/Magento/Framework/View/File/Collector/Base.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/View/File/Collector/Base.php b/lib/internal/Magento/Framework/View/File/Collector/Base.php index a5824b7321e84..f82ba6b0d7fab 100644 --- a/lib/internal/Magento/Framework/View/File/Collector/Base.php +++ b/lib/internal/Magento/Framework/View/File/Collector/Base.php @@ -65,7 +65,7 @@ public function getFiles(ThemeInterface $theme, $filePath) foreach ($sharedFiles as $file) { $result[] = $this->fileFactory->create($file->getFullPath(), $file->getComponentName(), null, true); } - $area = $theme->getData('area'); + $area = $theme->getArea(); $themeFiles = $this->componentDirSearch->collectFilesWithContext( ComponentRegistrar::MODULE, "view/{$area}/{$this->subDir}{$filePath}" From e72478890ecbd2296789551fd2f46927d69750fc Mon Sep 17 00:00:00 2001 From: Johan Lindahl Date: Wed, 1 Jul 2020 17:29:56 +0200 Subject: [PATCH 2/2] Fixed broken unit test --- .../Framework/View/Test/Unit/File/Collector/BaseTest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/BaseTest.php b/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/BaseTest.php index 0edafcb125dd3..ea0ef1cc69e87 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/BaseTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/BaseTest.php @@ -85,8 +85,7 @@ public function testGetFiles() ->method('create') ->willReturn($this->createFileMock()); $this->themeMock->expects($this->once()) - ->method('getData') - ->with('area') + ->method('getArea') ->willReturn('frontend'); $result = $this->fileCollector->getFiles($this->themeMock, '*.xml');