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.

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

liam morland’s picture

6.2.x receives only security support and critical bug fixes. @chrisolof your merge request looks like it does more than just what is required to fix an incompatibility with devel. There needs to be an explanation of why the change is needed.

chrisolof’s picture

6.2.x receives only security support and critical bug fixes.

Understood - feel free to close the MR, unless you feel that this represents a critical bug fix for the 6.2.x branch. It will still serve as a patch source that cleanly applies for those on webform 6.2.x who wish to use devel ^5.2. I think a lot of us are still on 6.2.x while 6.3.x moves toward a stable release.

@chrisolof your merge request looks like it does more than just what is required to fix an incompatibility with devel. There needs to be an explanation of why the change is needed.

Correct - apparently I fixed one incorrect return type while I was in there and I am pretty certain this one change is not strictly necessary for devel ^5.2 compatibility:

https://git.drupalcode.org/project/webform/-/merge_requests/860/diffs?co...

Given that this MR may never actually get merged, I'm going to leave this small fix in the MR for now. If you do want to merge this MR and do not want this change, it can be easily reverted prior to merge (and I would be happy to do that - but anyone with branch access can do it also).

Beyond that I am not trying to do anything other than fix the incompatibility with devel ^5.2 in MR 860. I believe I just branched off of 6.2.x, cherry-picked from MR 429 right up to the point 6.3.x was merged into it (see 429 commits vs 860 commits), then fixed that one incorrect return type while I was right in front of it.

If you look at how devel's DevelGenerateBase changed from 5.1.2 to 5.2.0 and compare that with the diff in MR 860, I think you'll find it all lines up.

I believe WebformEntityStorageTrait had to be removed due to it being incompatible with the new DevelGenerateBase, specifically with regard to WebformEntityStorageTrait's declaration of protected $entityTypeManager; and DevelGenerateBase's declaration of protected EntityTypeManagerInterface $entityTypeManager;, and that is why you find WebformEntityStorageTrait's methods repeated in here, as I believe they are all utilized in WebformSubmissionDevelGenerate.

I can confirm that in my project, MR 860 (in patch form) applies cleanly against webform 6.2.x and resolves this bug (which was critical in my project).