Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
My Problem was that my theme didn't load its libraries. I searched al lot till I discovered, that LibraryDiscoveryParser considers my installation profile (having the same name than the theme) is considered as a module (regardless of it's type "profile").
I commented the original code here:
public function buildByExtension($extension) {
$libraries = array();
if ($extension === 'core') {
$path = 'core';
$extension_type = 'core';
}
else {
if ($this->moduleHandler->moduleExists($extension)) {
$extension_type = 'module'; // <-- Regardless of the module type if exists this will be considered a module.
}
else {
$extension_type = 'theme';
}
$path = $this->drupalGetPath($extension_type, $extension);
}
core/lib/Drupal/Core/Asset/LibraryDiscoveryParser.php:71
Comments
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedI'm not undestand very well this issue, but maybe it will helpful:
stack:
Comment #3
Chi CreditAttribution: Chi commentedComment #4
Wim Leers#2808063: LibraryDiscoveryParser::buildByExtension() doesn't validate that extensions exist improves that code. But really, install profiles cannot define libraries, so this suggests that the real problem is that it's not complaining that the libraries of an install profile are being requested.
Comment #11
larowlanTriaged as part of bugsmash initiative
This is a duplicate of #2279551: Library discovery Parser tries to guess extension type assuming 'theme' for non-existing modules