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

maurizio.ganovelli created an issue.