When CI runs and the site is being installed, during configuration import of webforms the message comes up that Bootstrap classes can not be found. This happens on line 79 of WebformElementManager.php, and may be intermittent.

To resolve I found discussion in the devel queue where users were having a similar problem, but this is specifically related to importing configuration for webform. (https://www.drupal.org/node/2853398)

I've attached their solution in the appropriate place for webform with a patch.

Here is the full error message during a cli installation:

Fatal error: Class 'Drupal\bootstrap\Bootstrap' not found in /mnt/tmp/local.prod/source/docroot/themes/contrib/bootstrap/bootstrap.theme on line 30
Drush command terminated abnormally due to an unrecoverable error.       [error]
Error: Class 'Drupal\bootstrap\Bootstrap' not found in
/mnt/tmp/local.prod/source/docroot/themes/contrib/bootstrap/bootstrap.theme,
line 30
The external command could not be executed due to an application         [error]
error.
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

arosboro created an issue. See original summary.

jrockowitz’s picture

The latest release of the Webform module moved all Bootstrap related code into a dedicated and optional Webform Bootstrap module.

Are you still seeing this issue with the latest release of the Webform module?

arosboro’s picture

Hi @jrockowitz,

Here are a list of custom, and contrib webform modules I'm using:

 Other                            Webform Accept.js (webform_accept)                                                 Module  Enabled
 Testing                          Webform scheduled email module tests (webform_scheduled_email_test)                Module  Not installed  8.x-5.0-beta15
 Webform                          Webform (webform)                                                                  Module  Enabled        8.x-5.0-beta15
 Webform                          Webform Bootstrap (webform_bootstrap)                                              Module  Not installed  8.x-5.0-beta15
 Webform                          Webform Devel (webform_devel)                                                      Module  Not installed  8.x-5.0-beta15
 Webform                          Webform Examples (webform_examples)                                                Module  Not installed  8.x-5.0-beta15
 Webform                          Webform Node (webform_node)                                                        Module  Not installed  8.x-5.0-beta15
 Webform                          Webform Templates (webform_templates)                                              Module  Not installed  8.x-5.0-beta15
 Webform                          Webform UI (webform_ui)                                                            Module  Enabled        8.x-5.0-beta15
 Webform [EXPERIMENTAL]           Webform Scheduled Email Handler (webform_scheduled_email)                          Module  Not installed  8.x-5.0-beta15
 Webform Demo                     Webform Demo: Application/Evaluation System (webform_demo_application_evaluation)  Module  Not installed  8.x-5.0-beta15
 Webform Demo                     Webform Demo: Event Registration System (webform_demo_event_registration)          Module  Not installed  8.x-5.0-beta15

I just experienced the error on CI jobs this morning, and resolved them with this patch. It's not necessarily because bootstrap code is being called, but the core drupal theme initialization is happening w/ getInfo before the classes are autoloaded for bootstrap.

jrockowitz’s picture

This patch seems to be fixing a core issue that is affect the webform module. I can't replicate the issue so I am not comfortable applying this patch.

jrockowitz’s picture

Status: Needs review » Postponed (maintainer needs more info)

If this patch can be moved into the webform_bootstrap.module as an alter hook I would be okay with committing it.

lhridley’s picture

I can confirm that this patch does indeed resolve the issue, which we encountered this week in a CI/CD deployment after installing webforms.

jrockowitz’s picture

Status: Postponed (maintainer needs more info) » Needs review
jrockowitz’s picture

Attached is the same patch with comments and an injected 'theme_handler' service.

  • jrockowitz committed 1730308 on 8.x-5.x
    Issue #2893225 by jrockowitz, arosboro, lhridley: Fatal error: Class '...
jrockowitz’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.