Closed (duplicate)
Project:
Drupal core
Version:
8.9.x-dev
Component:
views.module
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
8 Jan 2020 at 05:58 UTC
Updated:
29 May 2023 at 12:36 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
bakidok commentedSame here, visiting "People" page, version 8.8.1.
TypeError: Argument 1 passed to Drupal\views\Plugin\views\field\EntityOperations::getEntityTranslation() must implement interface Drupal\Core\Entity\EntityInterface, null given, called in C:\wamp\www\gestor\core\modules\views\src\Plugin\views\field\EntityOperations.php on line 142 in Drupal\views\Plugin\views\field\EntityOperations->getEntityTranslation() (line 69 of core\modules\views\src\Entity\Render\EntityTranslationRenderTrait.php).
Comment #3
masher commentedSame here +1
Reverting to 8.7.11 solved the error
Comment #4
xld commentedSame issue on 8.7.11 on a rest export for comments. Exporting the entity.
Comment #5
lendudeWe need steps to reproduce this, since this obviously doesn't happen with just a clean core install.
But probably a duplicate of #3007424: Multiple usages of FieldPluginBase::getEntity do not check for NULL, leading to WSOD so closing as that for now, if you have specific steps to reproduce this that isn't covered by that issue, feel free to reopen it
Comment #6
meladawy commentedSame issue here. I managed to reproduce the issue with the following configuration
1. Install profile module https://www.drupal.org/project/profile
2. Create views that list users and add relation to their profile (optional relation)
3. Add field "Profile: Operations links" to the views
4. The error show if any of the users doesn't have profile associated with his account
5. The error doesn't show if all the users has profile associated with their account
Comment #7
meladawy commentedAdding validation around values would simply fix it. Not sure if it's the best practice to handle empty output.
Comment #8
meladawy commentedIn some cases the `$values` variable is not empty but the retrieved entities are empty. This patch to handle this case.
Comment #9
dmgig commentedI get a similar error, only in the BulkForm class.
TypeError: Argument 1 passed to Drupal\views\Plugin\views\field\BulkForm::getEntityTranslation() must implement interface Drupal\Core\Entity\EntityInterface, null given, called in /var/www/html/docroot/core/modules/views/src/Plugin/views/field/BulkForm.php on line 311 in Drupal\views\Plugin\views\field\BulkForm->getEntityTranslation() (line 69 of core/modules/views/src/Entity/Render/EntityTranslationRenderTrait.php).Comment #10
PeterStubRaindrop commented#8 works - if u disable "Node operations bulk form" in views. If not - u get a new error and content is not listed under /admin/content:
TypeError: Argument 1 passed to Drupal\views\Plugin\views\field\BulkForm::getEntityTranslation() must implement interface Drupal\Core\Entity\EntityInterface, null given, called in /Applications/MAMP/htdocs/dcu/web/core/modules/views/src/Plugin/views/field/BulkForm.php on line 311 in Drupal\views\Plugin\views\field\BulkForm->getEntityTranslation() (line 69 of /Applications/MAMP/htdocs/dcu/web/core/modules/views/src/Entity/Render/EntityTranslationRenderTrait.php)
EDIT: FORGET THIS PATCH...!!!!
Drupal 8.9.6: Go here: https://www.drupal.org/project/drupal/issues/3007424
And apply #108...
Comment #11
marcelovaniI can reproduce this error with these steps:
1. Install Drupal with `drush si -y standard`
2. Create a behat test with
3. Run the test with `/behat --tags=@error`
4. Navigate to /admin/people and refresh the page few times while the test is running
I get this
To fix it I need to run `drush cr`
I don't know if my conditions to reproduce are the same as other people, but the error is similar. I think its a racing condition. I will have to dig to find if its caused by Behat when clearing the generated user, or its a Drupal core issue...
The patch on this issue doesn't fix the problem, I will have a go with the other patch in the linked issue.
Comment #12
marcelovaniAfter digging a bit, I found that the issue is caused by cache tags in the admin/people view.
I disabled caching on this view and the problem was gone. Of course this is not the solution for the problem.
I tested the patch on #3007424 and that solved the problem.
Comment #13
abedajam commentedThis issue is caused by Views Bulk Operation form, which calls for calculateEntityBulkFormKey on null. I'm using VBO 8.3.9 btw
Comment #14
abedajam commentedComment #15
stephen ollmanPatch at #14 did the trick. Many thanks!
My issue occurred whilst trying to access the Custom Block Library.
Running 8.9.13. Will this be rolled in a future core release?
Comment #16
vlad.dancer@Stephen Ollman
> My issue occurred whilst trying to access the Custom Block Library.
The issue could be caused by broken page's view configuration. In our case the view (views.view.block_content.yml) had no "Reusable = True" filter. That caused to show blocks used by Layout Builder. Showing inline blocks is not designed for Custom Block Library page.
Comment #17
golubovicm commentedConfirming that patch from #14 works for me too. Running Drupal 9.3.0.
Comment #18
kartagisTried #14, it applied but with offset. 9.3.5 here.
Comment #19
alanin commentedHello. None of the listed patches help to fix a similar problem for drupal 9.3.14:
TypeError: Drupal\views\Plugin\views\field\BulkForm::getEntityTranslation(): Argument #1 ($entity) must be of type Drupal\Core\Entity\EntityInterface, null given, called in /var/www/html/ drupal/web/core/modules/views/src/Plugin/views/field/BulkForm.php on line 291 in Drupal\views\Plugin\views\field\BulkForm->getEntityTranslation() (line 69 of /var/www/ html/drupal/web/core/modules/views/src/Entity/Render/EntityTranslationRenderTrait.php)
Comment #20
krina_t commentedHi,
Were you able to figure out a solution for drupal 9.3.14?
I have the same issue with visiting /admin/content page. Everything was working fine until yesterday, so not sure where the problem started. Assuming that it could be a user error in entering content. But running out of clue on how to find the issue and fix it.
Comment #21
marco.bHaving the problem with core 9.4.5 at the /admin/content view. As a bad workaround I removed the date-field "node changed" in the views display and now the error doesn't occur anymore.
Comment #22
marco.bupdate: the reason in my case was a corrupt node-database-entry. Since I have removed this one, the view works fine again.
Comment #23
zarpele commented#14 worked for us on Drupal 9.3.16, we still don't know how the entity was corrupted.
The entity was not present in the main table but had some entries on the
*_revision,*__field, and*_revision__fieldtables. So we did an insert into the main table and the view goes back to work again.SELECT * from my_entity_field_data where nid not in (SELECT nid from my_entity)To identify the broken entities...
INSERT INTO my_entity (nid, vid, langcode, uuid) values ('THE BROKEN ID', 'LOOKUP FOR THE LAST REVISION', 'en', 'fed4443e-37c4-4226-7aaa-1194d8c65555');The entity now is accessible, and you can remove, unpublish, etc.
Comment #24
aaronbaumanSeems like it's related to eva on my install, but not 100% sure yet
Comment #25
bhojwanipankaj05 commentedHi folks,
By applying #14 patch, this empty entity fetal error is being fixed but we can see empty entries will be there in the list. So I have found the solution for it like added UUID field on media views and it fixed the error and removed empty entries which was available only on media_field_data table not on media table. So we don't need to apply the patch we can just add UUID field in filter area of views.