Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Problem/Motivation
When i do drush updb :
In ProcessBase.php line 171:
Unable to decode output into JSON: Syntax error
Fatal error: Declaration of Drupal\webform\WebformSubmissionListBuilder::getQuery($keys = '', $state = '', $source_entity = '') must be compatible with Drupal\Core\Entity\EntityListBuilder::getQuery():
Drupal\Core\Entity\Query\QueryInterface in /data-ceph/www/kitbased28/public/modules/contrib/webform/src/WebformSubmissionListBuilder.php on line 1376
Steps to reproduce
Up webform to 6.2-dev with composer and launch updb
Proposed resolution
- Use the
: QueryInterface
as a return type for thegetQuery
function in theWebformImageSelectImagesListBuilder
,WebformOptionsCustomListBuilder
,WebformEntityListBuilder
,WebformOptionsListBuilder
,WebformSubmissionExporter
,WebformSubmissionListBuilder
- Use the
: SelectInterface
as a return type for thegetQuery
function in theWebformSubmissionLogManager
class
Remaining tasks
User interface changes
API changes
Data model changes
Thanks
Comment | File | Size | Author |
---|---|---|---|
#20 | webform-getquery-3360357-20.patch | 5.5 KB | Berdir |
#19 | webform-6-2-beta5-3360357-19.patch | 5.48 KB | Berdir |
#11 | webform-6-2-beta5-3360357-11.patch | 7.04 KB | Rajab Natshah |
Issue fork webform-3360357
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
Comment #2
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedFacing the same issue with Drupal 10.1.0-beta1, PHP 8.1 on install from the browser and by drush.
Comment #3
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedComment #5
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedComment #6
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedComment #7
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedComment #8
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedCheck other
getQuery
functionsComment #9
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedComment #10
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedComment #11
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedAttaching a patch file for Webform 6.2.0-beta5
Comment #12
devil2005 CreditAttribution: devil2005 commentedpatch #11 rules :) thanks a lot
Comment #13
BerdirHm, this is ugly. The new core method was added in #3332872: Allow EntityListBuilder::getEntityIds() to easily extend the query and it just happens to conflict with the method name that webform uses a lot.
Possibly the method should be renamed instead here, it's not really an override of the parent method but something else, the switch between getEntityIds() and getQuery() is different.
Comment #14
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot for Vardot commentedIs
getTotalQuery
affected by that too?Comment #15
a.dmitriiev CreditAttribution: a.dmitriiev as a volunteer and at 1xINTERNET commentedI also don't think that
getQuery
frommodules/webform_submission_log/src/WebformSubmissionLogManager.php
has anything to do with core change toListBuilder
.Comment #16
mherchelAlthough I'm not versed enough to review the actual code, I verified #11 fixed the issue for me.
Comment #17
bbombachiniMoving this to needs work as the solution previously presented might not be the right approach.
Comment #18
cosmicdreams CreditAttribution: cosmicdreams at Nerdery for Nestle Purina PetCare - United States commentedI disagree that we should reject the patch in #11 because of aesthetics. Typing the return object in the method signature is a valuable type hint that PHP allows. We should do it more often.
I'm using patch #11 for now.
Comment #19
BerdirIt's an unrelated change that implements its own interface which was not changed, it's not even the same return type, I fully agree that this doesn't belong in here. Same for WebformSubmissionExporter. This is tricky enough as it is, lets focus on the actually required changes.
The different arguments are tricky as well, but changing the name or the arguments (they seem to come from properties always, so they could also just be dropped) has its own risk of introducing more issues if people customize those classes on their own.
I updated the patch to only have the required changes. I am adding a change to require-dev though so we can actually test this on D10+, feel free to commit that separately. I didn't update the MR, might be easier to proceed with the patch as the MR also had unrelated changes it seems.
Comment #20
BerdirHere's a patch that applies on 6.2.x.
Comment #21
DamienMcKennaComment #22
kreynen CreditAttribution: kreynen at University of Colorado commentedTHANKS! Applying the patch from #20 fixed the issue for me.
Comment #23
cosmicdreams CreditAttribution: cosmicdreams at Nerdery for Nestle Purina PetCare - United States commented+1 on #20 for keeping the return type hints in the method signature.
Comment #24
BerdirI also brought this up in slack and core maintainers would be open to rename the added core method to not break Webform: https://drupal.slack.com/archives/C1BMUQ9U6/p1684156596053419.
Comment #25
longwaveI opened #3361730: Rename EntityListBuilder::getQuery() to something less generic to solve this in core, but we do not have much time to get this in.
Comment #26
longwave#3361730: Rename EntityListBuilder::getQuery() to something less generic landed.
Comment #27
AnybodyThanks @longwave, so that means we should close this works as designed?
Is the core fix perhaps worth a Drupal 10.1.0-beta2 release to fix this critical conflict? Or is betaX after beta1 also tied to a schedule?
Comment #30
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #31
BerdirYeah, this could have been closed as a won't fix too as it will be fixed in the next core beta/rc release.