If you have randomly disappearing taxonomy markers, an you use the taxonomy-manager-module, I suggest you follow this issue: #985092: Taxonomy manager erases Gmap taxonomy markers.

Comments

eiland’s picture

To regenerate your taxonomy markers, do the following.

1. Backup your database.

2. Reset your taxonomy markers through the web interface on http://yoursite/admin/content/taxonomy/edit/term/1

3. After you have reset all the markers you go to Phpmyadmin.

You execute the following mysql for each term with an associated marker:

SELECT DISTINCT CONCAT( "INSERT INTO `dbname`.`gmap_taxonomy_node` (`nid`,`vid`,`tid`,`marker`) VALUES ('", `term_node`.`nid` , "', '", `term_node`.`vid` , "', '", `term_node`.`tid` , "', 'small green');" )
FROM `term_node` WHERE tid =1;

(where tid is the term id, 'small orange' is the name of the marker as defined in your gmap_taxonomy_term table and dbname is your database name)

The output of each query you export to an editor and you search and delete all "-signs.
The result should look like a lot of lines like these:
INSERT INTO `dbname`.`gmap_taxonomy_node` (`nid`,`vid`,`tid`,`marker`) VALUES ('11', 11', '1', 'small green');

4. Then you empty out the gmap_taxonomy_node table in your database, and you run the newly generated mysql query through phpmyadmin.

Beware, this only works if you have only one term associated per node.
I'm not sure how this ends up with multiple node revisions.

Next time, be more careful with he taxonomy manager :)

rmarino’s picture

Category: task » bug

It's not a taxonomy manager issue,
reordering taxonomy terms with the core taxonomy module (admin/content/taxonomy/1) also deletes some of the markers.

rmarino’s picture

The hook_taxonomy, in gmap.taxonomy.module, on update, line 96, deletes the markers form db.

case 'update':
        $vocabs = variable_get('gmap_taxonomy_vocabs', array());
        if (isset($vocabs[$array['vid']]) && $vocabs[$array['vid']]) {
          db_query('DELETE FROM {gmap_taxonomy_term} WHERE tid = %d', $array['tid']);
       // Do we have an assigned marker?
          if (!empty($array['gmap_taxonomy_marker'])) {
            db_query("INSERT INTO {gmap_taxonomy_term} (tid, marker) VALUES (%d, '%s')", $array['tid'],    $array['gmap_taxonomy_marker']);

Moving the 'delete' inside the conditional seems to solve it, but be aware I'm not familiar with gmap at all and unfortunately don't have the time now, so this is a very dirty and untested 20 sec fix, please developers look closer at this.

case 'update':
        $vocabs = variable_get('gmap_taxonomy_vocabs', array());
        if (isset($vocabs[$array['vid']]) && $vocabs[$array['vid']]) {
          
       // Do we have an assigned marker?
          if (!empty($array['gmap_taxonomy_marker'])) {
            db_query('DELETE FROM {gmap_taxonomy_term} WHERE tid = %d', $array['tid']);  /////
            db_query("INSERT INTO {gmap_taxonomy_term} (tid, marker) VALUES (%d, '%s')", $array['tid'],    $array['gmap_taxonomy_marker']);
paulgemini’s picture

subbing

LittleRedHen’s picture

I have been experiencing the same issue, and your code-change fixed it for me: thanks for posting it!.