Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 298403

[PP-1] Library discovery Parser tries to guess extension type assuming 'theme' for non-existing modules

$
0
0

Problem/Motivation

We currently have this in our LibraryDiscoveryParser class:

    if ($extension === 'core') {
      $path = 'core';
      $extension_type = 'core';
    }
    else {
      if ($this->moduleHandler->moduleExists($extension)) {
        $extension_type = 'module';
      }
      else {
        $extension_type = 'theme';
      }
      $path = $this->drupalGetPath($extension_type, $extension);
    }

This was only meant as a temporary 'hack' with the plan to remove this in favour of getting this from a parameter instead.

Proposed resolution

Either:

1. Pass the $type into LibraryDiscoveryInterface::getLibrariesByExtension/getLibraryByName
2. Pass an Extension object around instead, as this hold the extension type ($extension->getType())
3. Determine the extension type another way?

Remaining tasks

Discuss, decide, patch, tests.

User interface changes

None

API changes

None


Viewing all articles
Browse latest Browse all 298403

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>