According to this change record and this issue, the getEntityTranslation method has been removed from the views module in Drupal 11. Yet one instance of the old method remains in src/Plugin/views/field/EntityFormField.php.
The deprecated code throws the following error when saving an entity in my web application:
Call to undefined method Drupal\views_entity_form_field\Plugin\views\field\EntityFormField::getEntityTranslation() in Drupal\views_entity_form_field\Plugin\views\field\EntityFormField->saveEntities() (line 622 of /code/web/modules/contrib/views_entity_form_field/src/Plugin/views/field/EntityFormField.php).
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | views_entity_form_field-rm-method-3582727-1.patch | 670 bytes | daddison |
Issue fork views_entity_form_field-3582727
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
daddison commentedHere's a patch that replaces getEntityTranslation method with getEntityTranslationByRelationship.
Comment #4
daddison commentedComment #5
anybodyConfirming this critical issue! This is entirely broken for D11 multilanguage projects currently. I'll try the patch!
Comment #6
anybodyPrerequisite here seems to be #3419794: Error when translatable entities are used
Comment #7
anybody#3419794: Error when translatable entities are used seems outdated! The fix here works great, but is also contained in #3582075: CI: fix phpcs & phpstan issues so @daddison should be credited once that one is merged!
Comment #8
francoud commentedReceived this error in Drupal 11.3.8 with the 1.0.0 version:
Error: Call to undefined method Drupal\views_entity_form_field\Plugin\views\field\EntityFormField::getEntityTranslation() in Drupal\views_entity_form_field\Plugin\views\field\EntityFormField->saveEntities() (line 622 of [...]\web\modules\contrib\views_entity_form_field\src\Plugin\views\field\EntityFormField.php).
I hadn't this error with the 8.x-1.0-beta12 version. But this patch seems to solve the problem. Will we have a new stable version including this fix?
Comment #9
vladimirausThank you everyone for your contributions.
Committed. 🍻
Will be available in version 1.1.