Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294396

TypeError when result row doesn't have an entity

$
0
0

Problem/Motivation

After doing some updates on our homepage we used the UI to delete a node we don't require anymore.

When we go to /admin/content we get the following PHP error:

[16-oct-2017] TypeError: Argument 1 passed to Drupal\views\Plugin\views\field\EntityOperations::getEntityTranslation() must implement interface Drupal\Core\Entity\EntityInterface, null given, called in [path.to.my.site]/core/modules/views/src/Plugin/views/field/EntityOperations.php on line 111 in Drupal\views\Plugin\views\field\EntityOperations->getEntityTranslation() (line 69 of [path.to.my.site]/core/modules/views/src/Entity/Render/EntityTranslationRenderTrait.php)

So it looks like Drupal8 tries to render information about the deleted node.

Steps to Reproduce

  1. Standard install
  2. Add entity reference field to Article content type
  3. Create new Article and leave the reference field blank
  4. Create a page view of Articles as fields. Add a relationship to the content referenced by your new reference field. Add Operations links using the relationship. Save.

When you visit the view page you will get a WSOD and the error message in the IS. Something very similar happens if you add Node operations bulk form instead of the Operations links.

Proposed resolution

Ignore missing node when rendering the view.

This only stops the error message on page load, it doesn't fix the bug when deleting a node (the incomplete deleting of the node references?)

Thank you.
Susi


Viewing all articles
Browse latest Browse all 294396

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>