Problem/Motivation
PHP Fatal error: Declaration of Drupal\\webform\\Plugin\\Field\\FieldFormatter\\WebformEntityReferenceFormatterBase::getEntitiesToView(Drupal\\Core\\Field\\EntityReferenceFieldItemListInterface $items, $langcode) must be compatible with Drupal\\Core\\Field\\Plugin\\Field\\FieldFormatter\\EntityReferenceFormatterBase::getEntitiesToView(Drupal\\Core\\Field\\FieldItemListInterface $items, $langcode) in /home/jenkins/workspace/D9_SANDBOX_LILY_STANDARD_VIRTUAL_Y/build/docroot/modules/contrib/webform/src/Plugin/Field/FieldFormatter/WebformEntityReferenceFormatterBase.php on line 60
Steps to reproduce
Drush install profile with webform module added as a dependency
Proposed resolution
Fix
Remaining tasks
Review/Merge/Release
User interface changes
No
API changes
No
Data model changes
No
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | Status report | Drush Site-Install 2022-08-24 12-41-11.png | 125.2 KB | podarok |
Issue fork webform-3305679
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 #3
podarokTested as works good on
Drupal 9.4.5
PHP 8.1.9
MySQL 5.7.39
YUSA CodeShare distribution ( former Open Y ) - 9.2.1.15
More details
Added patch via composer from current issue MR https://github.com/YCloudYUSA/yusaopeny/commit/727a18c30929c799713fb379d...
Fixed same issue for video module - see https://www.drupal.org/project/video/issues/3305673 and released 3.0.1 video module
Comment #4
podarokComment #5
podarokMarking as critical because it blocks installation
Comment #6
anpolimus@podarok code is ok, but now it looks like we have to add additional code to the info file saying that Webform 6.1.3+ requires Drupal 9.4.
Or we could add it to the composer.
PR fixes the issue on fresh install with 9.4
Comment #7
anpolimusComment #8
jrockowitz commentedComment #9
froboyAdding duplicate issue, will leave this as the primary.
Comment #10
froboy@anpolimus I'm not sure if the requirements have changed, but Webform 6.1.3 requires Drupal ^9 but Webform ^6.2 requires Drupal ^9.4. This patch can work with either version, and coercing Webform to a different version can cause errors:
I think we should remove the Drupal version change and leave that up to Webform to decide.
Comment #11
podarok+1 #10
Comment #12
froboyFixed that up and rebased.
Comment #13
froboyReproduction steps:
- Install Drupal Core 9.4.5 (with Umami profile)
- Enable All messages at /admin/config/development/logging
- Require and enable Webform
- Edit a content type and add a Webform Reference field
- Upon trying to Save the Add field dialog, observe the error:
I'm not able to recreate this with Drupal 10.0.1 and Webform 6.2, but not sure why as none of the related files seem to have changed.
Comment #14
jrockowitz commentedI am very confused because I can't find a version of Drupal that references the FieldItemListInterface in EntityReferenceFormatterBase::getEntitiesToView
There is #3138528: getEntitiesToView() should implements the same interface as viewElements() , which does change the interface but has NOT been committed.
@froboy I see that you finding similar issues via #3229916: EntityReferenceFormatterBase::getEntitiesToView() must implement interface of EntityReferenceFieldItemListInterface, instance of AcquiaContentHubModerationStateFieldItemList given
Comment #15
froboy@jrockowitz 🤦🏻♂️ I think I need environment_indicator on my DrupalPod. The environment in which I was able to reproduce the issue DID have the patch from #3138528: getEntitiesToView() should implements the same interface as viewElements() applied.
At this point it seems like that issue might be going a different direction, so I think we can mark this Postponed until the parent issue is somehow resolved. Sorry for the confusion and thanks for your time.
Comment #16
josedsilvaThanks @jrockowitz
Removing the patch: #3138528: getEntitiesToView() should implements the same interface as viewElements() and updating core with `composer update --lock` fixed the "PHP Fatal error: Declaration of WebformEntityReferenceFormatterBase::getEntitiesToView" issue for me.
Comment #17
jrockowitz commentedRemoving the Drupal specific version number since this is a Drupal core related issue that has not being resolved.
Comment #18
jrockowitz commented