This may be related to the latest drupal core update 6.24. It seems just after I did the update, my node markers wouldn't update when I edited their taxonomy. It turns out, $node->taxonomy structure has changed (at least, gmap_taxonomy_nodeapi doesn't handle it correctly anymore). Also, I don't know how to build a patch if anyone wants to help out. To function probably needs to be rewritten properly in order to be understood, but here's the minimum amount of changes you need to make it just work. These changes are in the "gmap_taxonomy.module" file.

First, change line 134 from...

if (isset($status[$voc]) && $status[$voc]) {

to...

if (isset($status[$terms->vid]) && $status[$terms->vid]) {

Then comment out lines 135 thru 139 like so:

/*$t = $terms;
            if (!is_array($t)) {
              $t = array($t);
            }
            foreach ($t as $term) {*/

...and also comment out the closure for the above "foreach" on line 144 like so:

//}

This seems to work fine with the new structure of $node->taxonomy that is in place as of Drupal 6.24. Enjoy!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dunx’s picture

Also change:
$result = db_query('SELECT marker, tid FROM {gmap_taxonomy_term} WHERE tid = %d', $term);

To:
$result = db_query('SELECT marker, tid FROM {gmap_taxonomy_term} WHERE tid = %d', $terms->tid);

izmeez’s picture

Does anyone have these changes in a patch for testing?
Thanks.

dunx’s picture

I've never done a patch as they scare me :|

It's a relatively easy and contained change to one script though, so shouldn't be tricky for somebody to put together.

But, this is a fix because of a new "feature" in core Taxonomy, so it's not 100% clear where they'll go with that.

eiland’s picture

Are you sure? I still get http://tinyurl.com/6wbz3o4 after having the following diff:

134c134,135
<           if (isset($status[$voc]) && $status[$voc]) {
---
>           if (isset($status[$terms->vid]) && $status[$terms->vid]) {
> /* patch from http://drupal.org/node/1443146
140c141,143
<               $result = db_query('SELECT marker, tid FROM {gmap_taxonomy_term} WHERE tid = %d', $term);
---
> */
> // patch from http://drupal.org/node/1443146#comment-5674860              
>               $result = db_query('SELECT marker, tid FROM {gmap_taxonomy_term} WHERE tid = %d', $terms->tid);
144c147
<               }
---
> //              }
dunx’s picture

Am I sure about what? Link looks fine, but I don't know what it's supposed to look like :)

eiland’s picture

All items are of the same category and are supposed to be blue. However, recently a few orange pins showed up.

eiland’s picture

All items are in the same category and are supposed to have the same blue marker, but since recently there are a few which pop up with an orange marker. I thought that that was what this issue was about?

eiland’s picture

sorry drupal was down i didnt see i already got through.

dunx’s picture

Perhaps start by seeing what marker is stored in the gmap_taxonomy_node table.
I've not had any issues since I updated my gmap_taxonomy.module, but my site is in dev and data is not very dynamic. May be some action is resetting something or your orange markers are new/old/modified or something that's revealing an issue. I'll keep an eye on things and feed back if I spot anything odd.

Anonymous’s picture

after applying updates in this thread:

Parse error: syntax error, unexpected T_CASE in gmap_taxonomy.module on line 154

solution:

delete extra } from line 147

izmeez’s picture

Version: 6.x-1.1 » 6.x-1.x-dev
FileSize
1.17 KB

ok, i have made a patch based on the above comments against the latest 6.x-1.x-dev and tested that it applies:-) However, I don't see any noticeable change. Gmap markers are still default color not based on taxonomy term.

Let me know if I goofed on the patch. Thanks.

izmeez’s picture

Status: Active » Needs work

sorry, I forgot to change the status.

izmeez’s picture

btw, looking at gmap_taxonomy.views.inc and it has table joins

makes me wonder if
Try to improve performance and eliminate duplicates caused by node_access table joins may come into play as people have described it helping with other bugs.

izmeez’s picture

will this also require updates to gmap_taxonomy.install that would also execute on update.php?

semajnitram’s picture

Just wanted to know if anyone has got any further with this issue? I've been trying to get taxonomy terms markers to show on a map but it simply isn't working on my setup. I've tried in a test environment and it works great, but on my production site, it doesn't work. Im stumped on what's stopping it working.

dpintats’s picture

subscribing

matt2000’s picture

Status: Needs work » Closed (duplicate)

This is a duplicate of #205944: gmap marker settings - assigning terms and displaying different markers based on these in a gmap view map. The patch in Comment 35 there is an improved version of the one above,