Problem/Motivation

WSOD
Error: Uncaught TypeError:
Drupal\webform_views\WebformSubmissionViewsData::__construct(): Argument #7
($entity_type_bundle_info) must be of type
Drupal\webform_views\EntityTypeBundleInfoInterface,
Drupal\Core\Entity\EntityTypeBundleInfo given, called in
drupal-10.3.x/html/modules/contrib/webform_views/src/WebformSubmissionViewsData.php
on line 38 and defined in
drupal-10.3.x/html/modules/contrib/webform_views/src/WebformSubmissionViewsData.php: 73

Steps to reproduce

Proposed resolution

Remaining tasks

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

socialnicheguru created an issue. See original summary.

rajab natshah’s picture

Title: Major error causes WSOD » Fix Major error causes WSOD Error: Uncaught TypeError

Facing the same issue

lamtran3101 made their first commit to this issue’s fork.

gogowitsch’s picture

StatusFileSize
new1.9 KB

I have attached a patch. Now my database updates (drush updb) run through smoothly and the site works again.

socialnicheguru’s picture

Status: Active » Needs review
socialnicheguru’s picture

The patch works for me.
If it also works for you, please change to RTBC so we can get this in.

rajab natshah’s picture

Status: Needs review » Reviewed & tested by the community

Thanks, Anietie, for reporting
Thank you, Christian, that was quick!
The Patch in #5 is working.

socialnicheguru’s picture

I don't know if this is possible but it would be great to reroll with the fix. haivn a major version create a WSOD can be harmful.

paulguy’s picture

Get the error after last update, patch #5 fixes the issue. thanks
+1 for a new release too

marysalome’s picture

Thanks for this update and for the patch! Unfortunately Patch #5 didn't work for me with version 10.3.2 of Core. Let me know if there is any other info that might help solve this if it happens for others as well. I just got this error, not a lot of detail:

Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issues/2024-08-13/webform_views-issue-34677...

jfauske made their first commit to this issue’s fork.

jfauske’s picture

Status: Reviewed & tested by the community » Needs review

I believe we only need to add the proper alias here as proposed in https://git.drupalcode.org/issue/webform_views-3467786/-/tree/3467786-fi...

gogowitsch’s picture

Issue summary: View changes

Regarding #13: ...Interface as a type hint should always be preferred if an ...Interface type exists.

Regarding #11: the patch should apply independent of the Drupal Core version. I suspect you either were not in the right directory, or you had a different webform_views module version on your disk.

socialnicheguru’s picture

It worked for me on the newest version of webform_views and Drupal 10.3.2

fonant’s picture

Patch in #5 works for me, thank you!

socialnicheguru’s picture

Status: Needs review » Reviewed & tested by the community
sense-design’s picture

#5 👍 works for me too, new version please.

cpierce42’s picture

Adding my +1 for reviews. #5 works for me.

acbramley changed the visibility of the branch 3467786-fix-major-error to hidden.

acbramley changed the visibility of the branch 8.x-5.x to hidden.

acbramley’s picture

Version: 8.x-5.3 » 8.x-5.x-dev

  • acbramley committed 1ded3488 on 8.x-5.x
    Issue #3467786 by jfauske: Fix Major error causes WSOD Error: Uncaught...
acbramley’s picture

Status: Reviewed & tested by the community » Fixed
rakesh.gectcr’s picture

StatusFileSize
new2.42 KB

Due to some reason, The error, I am getting the same error with 5.4.0

 [error]  TypeError: Drupal\webform_views\WebformSubmissionViewsData::__construct(): Argument #7 ($entity_type_bundle_info) must be of type Drupal\webform_views\EntityTypeBundleInfo, Drupal\Core\Entity\EntityTypeBundleInfo given, called in /var/www/html/web/modules/contrib/webform_views/src/WebformSubmissionViewsData.php on line 39 in Drupal\webform_views\WebformSubmissionViewsData->__construct() (line 74 of /var/www/html/web/modules/contrib/webform_views/src/WebformSubmissionViewsData.php) #0 /var/www/html/web/modules/contrib/webform_views/src/WebformSubmissionViewsData.php(39): Drupal\webform_views\WebformSubmissionViewsData->__construct(Object(Drupal\Core\Entity\ContentEntityType), Object(Drupal\webform\WebformSubmissionStorage), Object(Drupal\Core\Entity\EntityTypeManager), Object(Drupal\Core\Extension\ModuleHandler), Object(Drupal\Core\StringTranslation\TranslationManager), Object(Drupal\Core\Entity\EntityFieldManager), Object(Drupal\Core\Entity\EntityTypeBundleInfo), Object(Drupal\webform\Plugin\WebformElementManager), Object(Drupal\webform\WebformEntityStorage))
#1 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityTypeManager.php(280): Drupal\webform_views\WebformSubmissionViewsData::createInstance(Object(Drupal\Core\DependencyInjection\Container), Object(Drupal\Core\Entity\ContentEntityType))

So I created the patch against the same and its working fine for Drupal 10

rakesh.gectcr’s picture

Status: Fixed » Needs review
rakesh.gectcr’s picture

socialnicheguru’s picture

The wrong fix was introduced in 5.4.
Patch in #26 fixes it. that patch is very similar to #5 which applied to 5.3.

Error with webform_views 5.4 is much like the original:
Error: Uncaught TypeError:
Drupal\webform_views\WebformSubmissionViewsData::__construct(): Argument #7
($entity_type_bundle_info) must be of type Drupal\webform_views\EntityTypeBundleInfo,
Drupal\Core\Entity\EntityTypeBundleInfo given, called in
drupal-10.3.x/html/modules/contrib/webform_views/src/WebformSubmissionViewsData.php
on line 39 and defined in
drupal-10.3.x/html/modules/contrib/webform_views/src/WebformSubmissionViewsData.php:74

Workaround for now:
I am reverting to 5.3 and the original fix in #5. (#26 is a remake of #5 for 5.4).
or apply patch in #26 to 5.4

rex.barkdoll’s picture

Wanted to confirm that #5 was working, then stopped working this morning. Implemented #26 and it's working now.

jfauske’s picture

Did you rebuild your caches after updating to 5.4.0?
Your error output indicate, to me, that you didn't.

Because Drupal\Core\Entity\EntityTypeBundleInfo implements Drupal\Core\Entity\EntityTypeBundleInfoInterface - which the fix imports.
And as such, the given Drupal\Core\Entity\EntityTypeBundleInfo object is of the required type... in 5.4.0.

rwanth’s picture

Seconding what @jfauske said. The issue was a missing use statement that the committed release resolved. There is no reason to use the EntityTypeBundleInfo class instead of its interface.

If the error message says "must be of type Drupal\webform_views\EntityTypeBundleInfo" then your site hasn't had it's caches rebuilt after deploying the 5.4 update.

Thanks for the fix @acbramley.

socialnicheguru’s picture

UGGHHHH.... Yes it was a cache issue. 5.4 works for me.
The cache gremlins got me on this one. I apologize.

If you install 5.4 please clear cache. It works without the patch.

acbramley’s picture

Status: Needs review » Fixed

As per #31

marysalome’s picture

Version 5.4.0 works where patch #5 didn't for me. Thank you!

greenhorn’s picture

Due to some reason, The error, I am getting the same error with 5.4.0

yes me too.

patch #26 works for me thanks @rakesh.gectcr

socialnicheguru’s picture

@greenhorn, remove the patch and make sure that you clear your cache

vensires’s picture

I also fell into this issue. For some reason, it only worked after I executed composer clear.

acbramley’s picture

@greenhorn you do not need the patch, you need to clear cache.

cpierce42’s picture

Adding a note incase anyone else has a similar environment to mine:
Lando, drupal 10.x, docker.
I needed to run `composer update --prefer-dist`, `lando composer clear` and then `composer clear` before drush commands would run.

cpierce42’s picture

Actually I take that back. When I deploy to an Acquia server via pipelines I get a lockout where I cannot run "composer clear" to clear composer cache. Drush cache clear works normally but does not resolve WSOD.

nicodh’s picture

Also same error for me, as #36. I need 5.4.0 + patch from #26 to be able to run drush cache clear

Status: Fixed » Closed (fixed)

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