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.
| Comment | File | Size | Author |
|---|---|---|---|
| #37 | fix_incompatibility_issue_for_6_3_x.patch | 921 bytes | yovince |
| #27 | fix_incompatibility_with_devel_5.2.patch | 30.8 KB | gg24 |
Issue fork webform-3435903
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:
- 6.x
compare
- 6.3.x
compare
- 3435903-incompatibility-with-devel-5.2
changes, plain diff MR !429
Comments
Comment #2
cilefen commentedIs that the precise type error or have you edited the text? I've not seen "as in class" before.
Comment #3
cilefen commentedAlso 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?
Comment #4
Mahendar00279 commentedThank 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.
Comment #5
taraskorpachI'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
Comment #6
taraskorpachComment #7
taraskorpachComment #8
cilefen commentedNo code is posted so I am setting this to "Active" status.
Comment #11
jrockowitz commentedThe MR attempts to support devel 5.2 and 5.1.
Comment #12
gaddman commentedTested 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).
Comment #13
gaddman commentedA workaround is to uninstall the Devel Generate module (so long as that's not going to impact other functions of your site).
Comment #14
jrockowitz commentedComment #15
pandaski commentedWe 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.
Comment #16
taraskorpach#12 says that the issue is solved with the MR. Setting RTBC because of this.
Comment #17
jrockowitz commentedWe need to confirm that the MR does NOT break older versions of the devel module.
Comment #18
seoulpanda20 commentedConfirming that I'm also running into this problem. I receive a 500 PHP Fatal error on form submission.
Versions:
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.phpFrustrating but glad I came across this thread!
Thanks for your hard work all these years, @jrockowitz.
Comment #19
mscieszka commentedI 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.
Comment #20
ricovandevin commentedI 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).
Comment #21
ipumpkinConfirmed patch with Webform 6.2.2 and Devel 5.1.2
Comment #22
inversed commentedConfirmed here as well. Either disabling Devel Generate or the patch, both solutions work with Webform 6.2.2 and Devel 5.1.2.
Comment #24
liam morlandRebased
I noticed that the merge request removes the
$entityTypeManagerproperty but it leaves$messenger, which is also provided by the parent class. Is there a reason for this?Comment #25
jrockowitz commentedTo 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);Comment #26
liam morlandI 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 withcreate().Comment #27
gg24 commentedI 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!
Comment #28
liam morlandThe Drupal 10.3 commit was added by accident. I have removed it by rebasing.
Comment #29
liam morlandComment #31
idebr commentedThis issue was fixed as part of #3465838: Drupal 11 compatibility fixes for webform
It can probably be closed as a duplicate
Comment #32
liam morlandComment #34
cb_govcms commentedWhile 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?
Comment #35
liam morland6.2.x receives only security support and critical bug fixes. It will be EOL very soon.
Comment #36
liam morlandThe fix is probably just removing
protected $entityTypeManager;insrc/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.
Comment #37
yovincewebform 6.3.x works fine and seems to fix the issue, but it introduces another minor compatibility issue.
Comment #38
liam morlandPlease put your change into a merge request.