Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#8 | fatal_error_class-2893225-8.patch | 3.64 KB | jrockowitz |
| |||
webform_bootstrap-autoload-issues.patch | 753 bytes | arosboro | |
Comments
Comment #2
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedThe 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?
Comment #3
arosboro CreditAttribution: arosboro at DropForge Labs commentedHi @jrockowitz,
Here are a list of custom, and contrib webform modules I'm using:
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.
Comment #4
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedThis 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.
Comment #5
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedIf this patch can be moved into the webform_bootstrap.module as an alter hook I would be okay with committing it.
Comment #6
lhridley CreditAttribution: lhridley at Promet Source commentedI can confirm that this patch does indeed resolve the issue, which we encountered this week in a CI/CD deployment after installing webforms.
Comment #7
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #8
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedAttached is the same patch with comments and an injected 'theme_handler' service.
Comment #10
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commented