diff --git a/core/modules/node/src/Entity/Node.php b/core/modules/node/src/Entity/Node.php index d11463e..fbd6728 100644 --- a/core/modules/node/src/Entity/Node.php +++ b/core/modules/node/src/Entity/Node.php @@ -123,17 +123,19 @@ public function postSave(EntityStorageInterface $storage, $update = TRUE) { node_reindex_node_search($this->id()); } else { - // Add to search_dataset for performance when counting nodes to be - // indexed. - db_insert('search_dataset') - ->fields(array( - 'sid' => $this->id(), - 'langcode' => $this->language()->getId(), - 'type' => 'node_search', - 'data' => '', - 'reindex' => 1, - )) - ->execute(); + if (\Drupal::moduleHandler()->moduleExists('search')) { + // Add to search_dataset for performance when counting nodes to be + // indexed. + db_insert('search_dataset') + ->fields(array( + 'sid' => $this->id(), + 'langcode' => $this->language()->getId(), + 'type' => 'node_search', + 'data' => '', + 'reindex' => 1, + )) + ->execute(); + } } }