Problem

The current plugin, WebformSubmissionDevelGenerate, is not compatible with the DevelGenerateBase plugin base of the Devel module, version 5.2 or higher.

Steps to reproduce

1. Update the devel module to version ^5.2
2. Try to submit a webform
3. Get the error as below

Fatal error: Type of Drupal\webform\Plugin\DevelGenerate\WebformSubmissionDevelGenerate::$entityTypeManager must be Drupal\Core\Entity\EntityTypeManagerInterface (as in class Drupal\devel_generate\DevelGenerateBase) in /var/www/html/abc/web/modules/webform/src/Plugin/DevelGenerate/WebformSubmissionDevelGenerate.php on line 30

Proposed resolution

1. Prohibit the use of Devel module versions higher than 5.2 with the current Webform version.
2. Update the WebformSubmissionDevelGenerate in accordance with DevelGenerateBase.

Issue fork webform-3435903

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

Mahendar00279 created an issue. See original summary.

cilefen’s picture

Priority: Critical » Major
Status: Active » Postponed (maintainer needs more info)
Issue tags: -WebformSubmissionDevelGenerate

Is that the precise type error or have you edited the text? I've not seen "as in class" before.

cilefen’s picture

Also please give the exact versions of Webform and of Devel and list the versions that changed when you, as you put it, migrated. Did you migrate or upgrade?

Mahendar00279’s picture

Title: This issue is reporting after migrating from Drupal 10.1 to Drupal 10.2 » This issue is reporting after upgraded from Drupal 10.1 to Drupal 10.2

Thank you for your response Cilefen,
I encountered an issue after upgrading from Drupal 10.1 to 10.2.4. I'm using Devel 5.2.1 and Webform 6.2.2.
Reverted back Devel 5.0 then working fine.
thank you.

taraskorpach’s picture

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

I've faced the issue as well. It seems like the 'Devel' maintainers have changed a lot of code in the DevelGenerateBase, while the WebformSubmissionDevelGenerate plugin extends it. Look on the commit.

Webform 6.2.2
Devel 5.2.1

taraskorpach’s picture

Title: This issue is reporting after upgraded from Drupal 10.1 to Drupal 10.2 » Incompatibility with devel ^5.2
taraskorpach’s picture

Issue summary: View changes
cilefen’s picture

Status: Needs work » Active

No code is posted so I am setting this to "Active" status.

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

jrockowitz’s picture

Status: Active » Needs review

The MR attempts to support devel 5.2 and 5.1.

gaddman’s picture

Tested MR#429 and resolves the issue OK for me. I haven't deployed this into a production site, this is just a few basic tests using the email handler (since I didn't experience any problem without this).

gaddman’s picture

A workaround is to uninstall the Devel Generate module (so long as that's not going to impact other functions of your site).

jrockowitz’s picture

Version: 6.2.2 » 6.2.x-dev
pandaski’s picture

We encountered this issue today while trying to update the Devel module to version 5.2.1 from 5.1.2.

We are using Drupal core 10.1.8 and Webform 6.2.2.

taraskorpach’s picture

Status: Needs review » Reviewed & tested by the community

#12 says that the issue is solved with the MR. Setting RTBC because of this.

jrockowitz’s picture

Status: Reviewed & tested by the community » Needs work

We need to confirm that the MR does NOT break older versions of the devel module.

seoulpanda20’s picture

Confirming that I'm also running into this problem. I receive a 500 PHP Fatal error on form submission.

Versions:

  • Core: 10.2.5
  • Webform: 6.2.2
  • Devel: 5.2.1

PHP Fatal error on form-submission:

PHP Fatal error: Type of Drupal\\webform\\Plugin\\DevelGenerate\\WebformSubmissionDevelGenerate::$entityTypeManager must be Drupal\\Core\\Entity\\EntityTypeManagerInterface (as in class Drupal\\devel_generate\\DevelGenerateBase) in /var/www/html/www.example.com/web/modules/contrib/webform/src/Plugin/DevelGenerate/WebformSubmissionDevelGenerate.php

Frustrating but glad I came across this thread!

Thanks for your hard work all these years, @jrockowitz.

mscieszka’s picture

Status: Needs work » Reviewed & tested by the community

I can confirm that after installing a fresh Webform 6.2.x and applying the patch from the MR, I can submit the default contact form without the WSOD that occurred when using Devel 5.2.1. Also, after downgrading to 5.1.2 and applying the patch, the form submits correctly.

ricovandevin’s picture

I can confirm that the patch resolves the issue for Webform 6.2.2 and Devel 5.2.1. Also, things still work after disabling Devel Generate (which should generally be done for production websites).

ipumpkin’s picture

Confirmed patch with Webform 6.2.2 and Devel 5.1.2

inversed’s picture

Confirmed here as well. Either disabling Devel Generate or the patch, both solutions work with Webform 6.2.2 and Devel 5.1.2.

Liam Morland made their first commit to this issue’s fork.

liam morland’s picture

Title: Incompatibility with devel ^5.2 » Fix incompatibility with devel ^5.2
Version: 6.2.x-dev » 6.3.x-dev

Rebased

I noticed that the merge request removes the $entityTypeManager property but it leaves $messenger, which is also provided by the parent class. Is there a reason for this?

jrockowitz’s picture

To rely on the base classes dependencies, we might need to change

$instance = new static($configuration, $plugin_id, $plugin_definition);

- to -

$instance = parent::create($container, $configuration, $plugin_id, $plugin_definition);

liam morland’s picture

Status: Reviewed & tested by the community » Needs review

I have made the change suggested in #25. I don't see how it could have worked without this change so full review that this code is working is needed.

A test should be added which visits path admin/config/development/generate/webform. That would have caught the problem with create().

gg24’s picture

StatusFileSize
new30.8 KB

I see that a commit for 10.3 is being added in the same patch where we are handling the issue for dev module incompatibility. IMHO this should have been handled in the separate issue.

Hence, I am re-rolling a patch for 10.2 Drupal version.

Thanks!

liam morland’s picture

The Drupal 10.3 commit was added by accident. I have removed it by rebasing.

liam morland’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

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

idebr’s picture

Status: Needs work » Postponed (maintainer needs more info)
Issue tags: -Needs reroll
Related issues: +#3465838: Drupal 11 compatibility fixes for webform

This issue was fixed as part of #3465838: Drupal 11 compatibility fixes for webform

It can probably be closed as a duplicate

liam morland’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)

cb_govcms’s picture

While this was fixed in #3465838: Drupal 11 compatibility fixes for webform it looks like that only made it to the 6.3 branch. Can we get this into 6.2 please?

liam morland’s picture

6.2.x receives only security support and critical bug fixes. It will be EOL very soon.

liam morland’s picture

The fix is probably just removing protected $entityTypeManager; in src/Plugin/DevelGenerate/WebformSubmissionDevelGenerate.php. That way, it uses the declaration of this property from its parent class.

This is simple enough. Feel free to create a merge request.

yovince’s picture

StatusFileSize
new921 bytes

webform 6.3.x works fine and seems to fix the issue, but it introduces another minor compatibility issue.

liam morland’s picture

Please put your change into a merge request.