You are here

function apachesolr_multilingual_node_update in Apache Solr Multilingual 6.3

Same name and namespace in other branches
  1. 7 apachesolr_multilingual.module \apachesolr_multilingual_node_update()

Implements hook_node_update().

Return value

void

1 call to apachesolr_multilingual_node_update()
apachesolr_multilingual_nodeapi in ./apachesolr_multilingual.module
Implements hook_nodeapi().

File

./apachesolr_multilingual.module, line 43
Multilingual search using Apache Solr.

Code

function apachesolr_multilingual_node_update($node) {

  // If a node is translated using node translation aka content translation
  // we need to mark all translations as modified to update field
  // sm_translations, sm_missing_translations and CLIR.
  if (!empty($node->tnid)) {
    foreach (apachesolr_multilingual_load_all_environments() as $environment) {
      if (!empty($environment['index_bundles']['node']) && in_array($node->type, $environment['index_bundles']['node'])) {
        $translations = translation_node_get_translations($node->tnid);
        foreach ($translations as $node_stub) {
          if ($node_stub->nid != $node->nid) {
            apachesolr_mark_entity('node', $node_stub->nid);
          }
        }
        return;
      }
    }
  }
}