# This patch file was generated by NetBeans IDE # This patch can be applied using context Tools: Apply Diff Patch action on respective folder. # It uses platform neutral UTF-8 encoding. # Above lines and this line are ignored by the patching process. --- C:\Servers\Apache\htdocs\projects\gamemeatonline\sites\all\modules\gmap\gmap_taxonomy.module +++ C:\Servers\Apache\htdocs\projects\gamemeatonline\sites\all\modules\gmap\gmap_taxonomy_patched.module @@ -162,36 +162,18 @@ ->condition('nid', $node->nid) ->execute(); - $status = variable_get('gmap_taxonomy_vocabs', array()); - $marker = ''; - // @@@ PROBLEM -- $node->taxonomy doesn't exist anymore! - if (isset($node->taxonomy) && is_array($node->taxonomy)) { - foreach ($node->taxonomy as $voc => $terms) { - if (isset($status[$voc]) && $status[$voc]) { - $t = $terms; - if (!is_array($t)) { - $t = array($t); + $marker = db_select('taxonomy_index', 'ti'); + $marker->leftJoin('taxonomy_term_data', 'td', 'td.tid = ti.tid'); + $marker->leftJoin('gmap_taxonomy_term', 'gtt', 'gtt.tid = td.tid'); + $marker->addExpression($node->nid, 'nid'); + $marker->addExpression($node->vid, 'vid');; + $marker->addField('gtt', 'tid'); + $marker->addField('gtt', 'marker'); + $marker->condition('ti.nid', $node->nid, '='); + $marker->condition('td.vid', variable_get('gmap_taxonomy_vocabs', array()), 'IN'); + $marker->range(0, 1); + db_insert('gmap_taxonomy_node')->from($marker)->execute(); - } - foreach ($t as $term) { - $result = db_query('SELECT marker, tid FROM {gmap_taxonomy_term} WHERE tid = :tid', array(':tid' => $term)); - if ($m = db_fetch_object($result)) { - $marker = $m->marker; - $markertid = $m->tid; - } - } - } - } - if (!empty($marker)) { - db_insert('gmap_taxonomy_node') - ->fields(array( - 'nid' => $node->nid, - 'tid' => $markertid, - 'marker' => $marker, - )) - ->execute(); - } - } } /** * Implement hook_node_delete().