The trouble is that if you change a node address, the module will (correctly) apply (or create) the correct taxonomy for that Country, Locality.. but the node also RETAINS the original taxonomy vocab/terms.

So if you had a node in Sydney, Australia
And then changed the address to Moscow, Russia

Your node terms would be something like:

NSW AUS, SYDNEY, AUSTRALIA, MOSCOW, RUSSIA

CommentFileSizeAuthor
#3 gcg_taxonomy.patch426 bytesmpaler

Comments

rbl’s picture

I can confirm this on the 5.x-1.x-dev version as well

Ricardo

vlooivlerke’s picture

If you tick the "delete address" tickbox on a already submitted node, the duplicate key entry in the taxonomy does not happen. But I also confirm this bug.

mpaler’s picture

StatusFileSize
new426 bytes

Hi,

I've fixed this. The problem has to do with how node terms are cached when manipulating a node programatically. Luckily it's an easy fix.

Starting line 325 in gcg_taxonomy.module change the following:

      if (!empty($terms)) {
        taxonomy_node_delete($node->nid);
        $node->taxonomy[$vid] = $terms;
        taxonomy_node_save($node->nid, $node->taxonomy);
      }

to

      if (!empty($terms)) {
        unset($node->taxonomy);
        $node->taxonomy[$vid] = $terms;
        taxonomy_node_save($node->nid, $node->taxonomy);
      }

Attached is a patch for those that like to do it that way...

Michael

manuj_78’s picture

Hi Michael,
Did you manage to get this module running on your site?

mpaler’s picture

Yes but not in production so I've yet to see whether it can stand up to the test of users.

manuj_78’s picture

Did you have to make any more changes to the site besides this patch?
I am trying to figure out a way to set a default location and also to restrict the users to tag nodes only from a particular region...do you have any idea if that can be done?

mpaler’s picture

Just this patch.

I don't think those functionalities are built in. You will likely have to modify the module code to achieve that.

mpaler’s picture

Status: Active » Needs review

I'm still confused as to the status of this project. Not sure it's being maintained. Either way, I've changed the status of this issue to a patch for review so that is might get incorporated into the code base.

Thanks
Mike