Problem/Motivation
When a component provider is a theme (e.g., bootstrap_theme), the method CanvasBootstrapFormHooks::resolveComponentMetadataPath() attempts to call:
$this->pathResolver->getPath('module', $provider);
This generates:
User warning: The following module is missing from the file system: bootstrap_theme
followed by:
Deprecated function: dirname(): Passing null to parameter #1 ($path)
because getPath() returns null for missing extensions.
Steps to reproduce
Use a custom theme with sdc components and canvas_bootstrap togheter.
Proposed resolution
Check if provider is a theme or is a module before calling getPath():
$theme = \Drupal::service('theme_handler')->getTheme($provider);
if ($theme) {
// Is a theme
}
elseif (\Drupal::service('module_handler')->moduleExists($provider)) {
// Is a module
}
Remaining tasks
None
User interface changes
None
API changes
None
Data model changes
None
Comments
Comment #2
alaa abbad commentedThanks for the report! This is fixed in #3634949, merged into 1.0.x: the provider is now looked up only as the type of extension it is, so neither the "missing from the file system" warning nor the dirname(null) deprecation happens. The fix will be in 1.0.10.