When a geotaxonomy term is modified, any previous changes to the geometry field are lost. That's because the geometry field is not loaded into the form, thus never gets saved again.

Culprit: delete-then-insert approach for 'update' in geotaxonomy_taxonomy().

CommentFileSizeAuthor
#8 geotaxonomy-859472.patch789 bytesfreelock

Comments

tmcw’s picture

Status: Active » Fixed

Fixed in: http://drupal.org/cvs?commit=395508

This patch loads & saves the new geometry field, storing it as hidden between edits.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

redraven’s picture

Status: Closed (fixed) » Active

I'm still experiencing this bug with the July 31 dev release

Fresh core install with most recent stable release of feeds, ctools, views, and geotaxonomy dev (july 31)

Used feeds to import the managing news world geo dataset (http://github.com/developmentseed/mn_world/blob/master/mn_world.csv)

Lat/Long and other geo information lost when either of these actions occur.

1) Moving terms around in the hierarchy of a taxonomy using the drag and drop interface

2) Using the 'reset to alphabetical' function in the taxonomy management interface.

3) Clicking on the save button in the taxonomy interface without making any changes

It appears the only way i can manipulate the taxonomy structure without loosing geo information is to go into each term on a individual basis.

I've also been able to confirm the loss of geo information through some testing of zzolo new Geo Taxonomy Geocoder module, when i use the drag and drop UI to move terms around in the hierarchy, and then save, it give me a message of successfully geocoding terms (even though they are all already geocoded).

mark.’s picture

I've had the same problem. After MANUALLY entering coordinates for almost 250 country names, I dragged a couple terms to the top, clicked save, and saw in my db that every coordinate had been wiped out.

freelock’s picture

We got bit by this, too. 6.x-2.0-beta3.

Happened in two different circumstances: rearranging field order on core taxonomy vocabulary form - deleted all geotaxonomy data on any field that was moved. And also happened when editing (without moving) a term in taxonomy_manager module.

alex_b’s picture

I can confirm this. The real problem is that there is no hook_taxonomy_load() in Drupal 6. Hence when taxonomy is manipulated and saved with taxonomy_term_save() from any place else than the taxonomy term edit form, geo information is lost.

We need to modify geotaxonomy to not blow away existing geo information in hook_taxonomy() unless specifically requested.

freelock’s picture

There is a hook_taxonomy that should get called when terms get updated or inserted... I see that's not implemented in the module...

freelock’s picture

Status: Active » Needs review
StatusFileSize
new789 bytes

Ok, I was wrong... hook_taxonomy is implemented -- and the culprit. On update, it deletes any term_geo data, and then inserts the data loaded on the term.

Problem is, geotaxonomy never gets a chance to load this data!

Attached is a patch to check to see if $term already has geotaxonomy data loaded (by looking for latitude or bound_top) and if not, attempt to load the geotaxonomy data and merge into the term BEFORE deleting the geotaxonomy data.

Seems to fix the problem here!

YK85’s picture

subscribing