Error WSOD upon enabling module

Created on 27 December 2023, 6 months ago
Updated 8 January 2024, 6 months ago

On a brand new Drupal 10.2 site, installing and enabling this module currently causes a sitewide WSOD error:

Fatal error: Trait "Drupal\webform\Element\WebformEntityTrait" not found in /home/customer/www/1337suites.com/web/modules/contrib/css_toggle_switch/src/Element/ToggleSwitchEntity.php on line 13

🐛 Bug report
Status

Closed: works as designed

Version

1.0

Component

Code

Created by

🇺🇸United States W01F

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @W01F
  • 🇮🇳India samir_shukla bareilly

    Hi, the problem is that there should be webform module installed before installing this module. In my case, doing so, the module got installed.

  • 🇮🇳India urvashi_vora Madhya Pradesh, India

    Hi @W01F, +1 for @samir's answer.

    The issue doesn't persist as the developers have already added webform module as a dependency in info.yml file.

    dependencies:
      - webform:webform
    

    and also added webform requirement in composer.json file of the module

    "require": {
            "drupal/webform": "^6.0"
        },
    

    and that being the result, when we try to install the module without having webform module, it shows like this:

    Means, the module enabling checkbox itself is disabled, and thus, module can't be installed without fulfilling the dependency and no more WSOD could be seen.

    Thus, marking the issue as "works as expected". Please feel free to change the status of the issue if you still face the issue and provide more details on it.

    Thanks

  • Status changed to Closed: works as designed 6 months ago
  • 🇮🇳India urvashi_vora Madhya Pradesh, India
  • 🇺🇸United States W01F

    Ahh.. okay, I was confused because the module description includes that:

    "The module provides a form element that can be used programmatically but also integration with Better Exposed Filters and Webform.

    ...suggesting it can integrate with webforms, but not dependent upon it. In my case I was interested in testing it out with some BEF buttons for some views on a site that isn't even using webforms.

    So now I'm curious if this could be changed to an optional integration if webforms is installed, or I think the module page should change the wording or include additional information that webform is required.

    Thank you for the fast response!

  • 🇪🇸Spain pcambra Spain, 🇪🇺

    @W01F, I had opened https://www.drupal.org/project/css_toggle_switch/issues/3408400 📌 Move webform to suggested rather than required Active for what you're mentioning already. I don't know if a submodule will be best or there's a better way (we only depend of a specific trait).

Production build 0.69.0 2024