Skip to content

Commit

Permalink
[Pronovix#69] Class 'Drupal\bootstrap\Bootstrap' not found error
Browse files Browse the repository at this point in the history
  • Loading branch information
alenastanul87 committed Feb 6, 2023
1 parent 94437ad commit 5329172
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Service/SwaggerUiLibraryDiscovery.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,16 @@ public function libraryDirectory(): string {
$library_dir = 'libraries/swagger-ui';
// Allow the default theme to alter the default library directory.
$default_theme = $this->themeInitialization->getActiveThemeByName($this->themeHandler->getDefault());
$this->themeInitialization->loadActiveTheme($default_theme);
// @todo Remove \Throwable cathing when registration the namespaces
// of installed themes will be implemented.
// https://www.drupal.org/project/drupal/issues/2941757
try {
$this->themeInitialization->loadActiveTheme($default_theme);
}
catch (\Throwable $error) {
$this->themeHandler->listInfo();
$this->themeInitialization->loadActiveTheme($default_theme);
}
// The hook is only invoked for the default theme (and its base themes).
$this->themeManager->alterForTheme($default_theme, 'swagger_ui_library_directory', $library_dir);
// Make sure that the directory path is relative (to DRUPAL ROOT).
Expand Down

0 comments on commit 5329172

Please sign in to comment.