0

I created a view to display a block on my store page, but the page displays an error when the view has no result. If the view has a result, it works. What's the problem?

screenshot

When I go to my store page, I get this error in the log.

TypeError: Argument 1 passed to Drupal\views\Plugin\views\field\RenderedEntity::getEntityTranslation() must implement interface Drupal\Core\Entity\EntityInterface, null given, called in /var/www/www-example-com/web/core/modules/views/src/Plugin/views/field/RenderedEntity.php on line 149 in Drupal\views\Plugin\views\field\RenderedEntity->getEntityTranslation() (line 69 of /var/www/www-example-com/web/core/modules/views/src/Entity/Render/EntityTranslationRenderTrait.php)

#0 /var/www/www-example-com/web/core/modules/views/src/Plugin/views/field/RenderedEntity.php(149): Drupal\views\Plugin\views\field\RenderedEntity->getEntityTranslation(NULL, Object(Drupal\views\ResultRow))
#1 /var/www/www-example-com/web/core/modules/views/src/Plugin/views/field/FieldPluginBase.php(1155): Drupal\views\Plugin\views\field\RenderedEntity->render(Object(Drupal\views\ResultRow))
#2 /var/www/www-example-com/web/core/modules/views/views.theme.inc(236): Drupal\views\Plugin\views\field\FieldPluginBase->advancedRender(Object(Drupal\views\ResultRow))
#3 /var/www/www-example-com/web/core/lib/Drupal/Core/Theme/ThemeManager.php(287): template_preprocess_views_view_field(Array, 'views_view_fiel...', Array)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.