You are here

function hosting_client_update_6003 in Hosting 6.2

Same name and namespace in other branches
  1. 7.4 client/hosting_client.install \hosting_client_update_6003()
  2. 7.3 client/hosting_client.install \hosting_client_update_6003()

Remove duplicate client nodes.

Those may have been created in development versions of 2.x code, see https://drupal.org/node/1146014

File

client/hosting_client.install, line 307
Install, update and uninstall for the clients module.

Code

function hosting_client_update_6003() {
  $q = db_query("SELECT n.nid FROM {node} n LEFT JOIN {hosting_client} hc ON n.nid = hc.nid WHERE n.type = 'client' AND hc.nid IS NULL;");
  while ($nid = db_result($q)) {
    node_delete($nid);
  }
  return array();

  // never fail
}