Skip to main content
replaced http://drupal.stackexchange.com/ with https://drupal.stackexchange.com/
Source Link

The following has been borrowed from herehere.

Insert the following into your custom module.

/**
 * Implements hook_node_delete().
 */
function mymodule_node_delete($node) {
  if ($node->type == 'mynodetype'){
    $nids = db_query('SELECT entity_id FROM {field_data_field_review_reference} WHERE field_review_reference_nid = :nid', array(':nid' => $node->nid))->fetchCol();
    node_delete_multiple($nids);
  }
}

The following has been borrowed from here.

Insert the following into your custom module.

/**
 * Implements hook_node_delete().
 */
function mymodule_node_delete($node) {
  if ($node->type == 'mynodetype'){
    $nids = db_query('SELECT entity_id FROM {field_data_field_review_reference} WHERE field_review_reference_nid = :nid', array(':nid' => $node->nid))->fetchCol();
    node_delete_multiple($nids);
  }
}

The following has been borrowed from here.

Insert the following into your custom module.

/**
 * Implements hook_node_delete().
 */
function mymodule_node_delete($node) {
  if ($node->type == 'mynodetype'){
    $nids = db_query('SELECT entity_id FROM {field_data_field_review_reference} WHERE field_review_reference_nid = :nid', array(':nid' => $node->nid))->fetchCol();
    node_delete_multiple($nids);
  }
}
correction
Source Link
Timofey Drozhzhin
  • 2.3k
  • 1
  • 21
  • 33

The following has been stolenborrowed from here.

Insert the following into your custom module.

/**
 * Implements hook_node_delete().
 */
function mymodule_node_delete($node) {
  if ($node->type == 'mynodetype'){
    $nids = db_query('SELECT entity_id FROM {field_data_field_review_reference} WHERE field_review_reference_nid = :nid', array(':nid' => $node->nid))->fetchCol();
    node_delete_multiple($nids);
  }
}

The following has been stolen from here.

Insert the following into your custom module.

/**
 * Implements hook_node_delete().
 */
function mymodule_node_delete($node) {
  if ($node->type == 'mynodetype'){
    $nids = db_query('SELECT entity_id FROM {field_data_field_review_reference} WHERE field_review_reference_nid = :nid', array(':nid' => $node->nid))->fetchCol();
    node_delete_multiple($nids);
  }
}

The following has been borrowed from here.

Insert the following into your custom module.

/**
 * Implements hook_node_delete().
 */
function mymodule_node_delete($node) {
  if ($node->type == 'mynodetype'){
    $nids = db_query('SELECT entity_id FROM {field_data_field_review_reference} WHERE field_review_reference_nid = :nid', array(':nid' => $node->nid))->fetchCol();
    node_delete_multiple($nids);
  }
}
Source Link
Timofey Drozhzhin
  • 2.3k
  • 1
  • 21
  • 33

The following has been stolen from here.

Insert the following into your custom module.

/**
 * Implements hook_node_delete().
 */
function mymodule_node_delete($node) {
  if ($node->type == 'mynodetype'){
    $nids = db_query('SELECT entity_id FROM {field_data_field_review_reference} WHERE field_review_reference_nid = :nid', array(':nid' => $node->nid))->fetchCol();
    node_delete_multiple($nids);
  }
}