Problem/Motivation
A recent download of webform gave the following error due to changes in the WebformSubmissionStorage class that we extend in WebformEncryptSubmissionStorage.php
Error: Uncaught ArgumentCountError: Too few arguments to function Drupal\webform_encrypt\WebformEncryptSubmissionStorage::__construct(), 7 passed in C:\dev\sites\example\web\modules\contrib\webform_encrypt\src\WebformEncryptSubmissionStorage.php on line 68 and exactly 8 expected in C:\dev\sites\example\web\modules\contrib\webform_encrypt\src\WebformEncryptSubmissionStorage.php:51
Proposed resolution
The new arguments/injected dependencies need to be added to webform_encrypt, specifically the $access_rules_manager
| Comment | File | Size | Author |
|---|---|---|---|
| #19 | 3007450-19.patch | 341 bytes | vijaycs85 |
| #15 | 3007450-15.patch | 3.25 KB | manuel garcia |
| #15 | interdiff-3007450-11-15.txt | 965 bytes | manuel garcia |
| #11 | 3007450-11.patch | 2.31 KB | manuel garcia |
| #11 | interdiff-3007450-9-11.txt | 2.57 KB | manuel garcia |
Comments
Comment #2
rob holmes commentedBackwards compatibility will be an issue here but here are new parameters.
Comment #3
t-lopatch at #2 applies cleanly and resolves this issue for me.
Comment #4
SlayJay commentedLooks like they've yet again changed the constructor in the latest version.
I've attached a new patch incorporating the changes from the old patch here, plus the new changes.
Comment #6
marty2081 commentedThe patch from #2 applies fine in combination with Webform 8.x-5.1 and resolves the issue.
Comment #7
manuel garcia commentedI feel this should at least be major. Thanks for reporting, and glad to see tests are catching it at the HEAD.
Comment #8
manuel garcia commentedRelease notes for 5.0-rc22: https://www.drupal.org/project/webform/releases/8.x-5.0-rc12
Webform is itself already working on 5.2 though...
Comment #9
manuel garcia commentedHere's a go at this against webform 8.x-5.x
Comment #11
manuel garcia commentedLooks like on d.org ci its installing drupal/webform (5.1.0), which makes sense since that is the recommended version at the moment.
That said, it also has a BC breaking change in the
WebformSubmissionStorageconstructor so we should fix that here for now.Once webform 5.2 stable is released we'll have to revisit this.
Comment #13
manuel garcia commentedOpened up #3037909: 5.1 and 5.2 break backwards compatibilty on the webform issue queue.
Comment #14
manuel garcia commentedOK now we just seem to be missing schemas for
test_wizard_encryption:webform.webform.test_wizard_encryption:settings.form_login missing schema, webform.webform.test_wizard_encryption:settings.form_login_message missing schema, webform.webform.test_wizard_encryption:settings.submission_login missing schema, webform.webform.test_wizard_encryption:settings.submission_login_message missing schemaComment #15
manuel garcia commentedOn #2943879: How to display alternate text when the user is not allowed to create a Webform ? they changed these configurations so our exported test webform needs updating. See
webform_update_8143()Comment #17
vijaycs85Thanks all!
Comment #18
vijaycs85Comment #19
vijaycs85Follow up to update the version constraint in the composer.json
Comment #21
manuel garcia commentedJust to update the status here, the maintainer of webform module was kind enough to fix the new BC breaking change on 5.2 (see #3037909: 5.1 and 5.2 break backwards compatibilty), which is great.
It also means we should be safe with the update to
composer.jsonproposed on #19.Comment #22
rob holmes commentedThanks for taking this further... Lets get the version constraint added as there is no way to support the old constructor in conjunction with the new.
Comment #23
vijaycs85Just checking it locally:
If I install with this condition, we would get 5.1.0 for new projects and for existing installs with < 5.0.0-rc22, would update to 5.1.0 and existing installs with higher versions (e.g. 5.0.0-rc23) would stay same.
Comment #24
manuel garcia commentedI agree we should not force existing sites to upgrade to webform 1.0, and using
>=5.0.0-rc22if an existing site is requiring exactly the5.0.0-rc22version of webform, it would not throw a requirements error.Comment #26
vijaycs85Thanks, @Manuel Garcia