- Issue created by @arunkumark
Non-existing attachment declarations in Twig file throwing Warning error.
if ($extension === 'core') {
$path = 'core';
$extension_type = 'core';
}
else {
if ($this->moduleHandler->moduleExists($extension)) {
$extension_type = 'module';
}
else {
$extension_type = 'theme';
}
$path = $this->extensionPathResolver->getPath($extension_type, $extension);
}
If the given extension name does not exist in the Twig library, that is considered as Theme instead of checking whether the library extension exists.
1. Create a custom Sample module(sample.module) in a fresh Drupal site.
2. Add hook_theme and create a custom render template.
3. Inside the TWIG attach non existing library as below.
{{ attach_library('xyz_module/xy_library') }}
As same as moduleExists()
check need to implement for the $this->themeHandler->themeExists($extension)
Active
11.0 🔥