Taxonomy duplication

Eshilon Design Inc - May 21, 2008 - 22:56
Project:Google Client Geocoder
Version:5.x-0.1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

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

#1

rbl - May 24, 2008 - 03:11

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

Ricardo

#2

VlooiVlerke - May 24, 2008 - 21:45

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.

#3

mpaler - October 9, 2008 - 05:36

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

AttachmentSize
gcg_taxonomy.patch 426 bytes

#4

manuj_78 - October 30, 2008 - 16:38

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

#5

mpaler - October 30, 2008 - 18:01

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

#6

manuj_78 - October 30, 2008 - 18:44

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?

#7

mpaler - October 30, 2008 - 21:04

Just this patch.

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

#8

mpaler - November 22, 2008 - 00:52
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

 
 

Drupal is a registered trademark of Dries Buytaert.