diff --git a/core/lib/Drupal/Core/Asset/LibraryDiscovery.php b/core/lib/Drupal/Core/Asset/LibraryDiscovery.php index f651c7f..968cd00 100644 --- a/core/lib/Drupal/Core/Asset/LibraryDiscovery.php +++ b/core/lib/Drupal/Core/Asset/LibraryDiscovery.php @@ -267,9 +267,7 @@ protected function buildLibrariesByExtension($extension) { // @todo Convert all uses of #attached[library][]=array('provider','name') // into #attached[library][]='provider/name' and remove this. foreach ($library['dependencies'] as $i => $dependency) { - if (!is_array($dependency)) { - $library['dependencies'][$i] = explode('/', $dependency, 2); - } + $library['dependencies'][$i] = explode('/', $dependency, 2); } } return $this->libraries[$extension]; diff --git a/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryTest.php b/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryTest.php index f8cd82c..fcbb15f 100644 --- a/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryTest.php +++ b/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryTest.php @@ -340,10 +340,9 @@ public function testLibraryWithDependencies() { $this->libraryDiscovery->setPaths('module', 'dependencies', $path); $library = $this->libraryDiscovery->getLibraryByName('dependencies', 'example'); - $this->assertCount(3, $library['dependencies']); + $this->assertCount(2, $library['dependencies']); $this->assertEquals(array('external', 'example_external'), $library['dependencies'][0]); $this->assertEquals(array('example_module', 'example'), $library['dependencies'][1]); - $this->assertEquals(array('example_theme', 'example'), $library['dependencies'][2]); } /** diff --git a/core/tests/Drupal/Tests/Core/Asset/library_test_files/dependencies.libraries.yml b/core/tests/Drupal/Tests/Core/Asset/library_test_files/dependencies.libraries.yml index 537e0c3..9a8b4dd 100644 --- a/core/tests/Drupal/Tests/Core/Asset/library_test_files/dependencies.libraries.yml +++ b/core/tests/Drupal/Tests/Core/Asset/library_test_files/dependencies.libraries.yml @@ -4,6 +4,3 @@ example: dependencies: - external/example_external - example_module/example - - - - example_theme - - example