After source object delete operation, the module tries to delete the object in elastic index and to get the information on index name and object id runs object normalization that contains rendering of node in search view modes in elasticsearch_helper_content module, class ElasticsearchContentNormalizer.

As serialization and further normalization is triggered ['method' => 'delete'] context, I suggest checking its value in normalizer and skip content rendering for it.

The reason for skipping is that sometimes when there are translations for the node rendering breaks with this information Error: Call to a member function getTranslation() on null in Drupal\node\NodeViewBuilder::renderLinks() (line 100 of core/modules/node/src/NodeViewBuilder.php).

And also there is no sense in "heavy" render operation during delete time, when only index name and object id is needed from normalized data.

Comments

a.dmitriiev created an issue. See original summary.

a.dmitriiev’s picture

Status: Active » Needs review
StatusFileSize
new2.3 KB

Patch is attached, please review.