Closed (fixed)
Project:
Feeds
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
13 Jul 2010 at 19:34 UTC
Updated:
3 Jan 2014 at 01:42 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
alex_b commentedRequires: #853194-1: Mapping: don't reset all targets.
This patch introduces a real "update existing" option: http://skitch.com/alexbarth/dcmfc/edit-importer-term-importer-feeds-test...
When selected "update existing" it actually loads the term from the database before updating it.
HOWEVER:
Given that the taxonomy module does not support *any* load hooks the only thing that gets loaded before updating is the 'name' and the 'description' field of a taxonomy term :P
What does this mean for modules like geotaxonomy that add data to taxonomy terms?
This patch invokes a hook_feeds_taxonomy_load() to make up for taxonomy's deficiencies. An implementation for e. g. geotaxonomy looks like this:
Comment #2
alex_b commentedComment #3
alex_b commentedGeotaxonomy patch here: #853272-1: Implementation of hook_feeds_taxonomy_load()
Comment #4
TKS commentedalex_b:
Some progress, but not quite there -- at least in my testing.
First off, the patch you link to as a dependency (http://drupal.org/node/853194#comment-3197988) installs smoothly, as does the related patch for but geotaxonomy.module. But 853156-1_term_updating.patch choked on Chunk 4 -- the output from FeedsTermProcessor.inc.rej is below:
I manually updated the code in FeedsTermProcessor.inc, and the additional option to "Update existing terms (slower than replacing them)" is there, just as it is in your Skitch screenshot.
When I go to actually import, however, the import page no longer has a field for uploading new files -- see http://drupal.org/files/shapefile_import_no_file_browser.PNG.
Since both my shapefile ZIP and my Lat/Long CSV file are already on the site, hitting the import button seems to in fact import the new files -- I get the status message of "Updated 177 Terms in Countries. / Rebuilt term hierarchy." (This is the case for both importers I have set up -- one for shapefiles, and one for lat/long import.)
But most importantly, uploading the shapefiles purges all the lat/long data from my "Countries" geotaxonomy, and vice-versa.
So I seem to have gotten a non-functioning " "Update existing terms " radio button, lost my file-upload window, but not had any real change in the actual update-vs-overwrite situation.
Comment #5
alex_b commentedThis is very strange behavior that you are reporting here.
I just did a cvs checkout of the contributions/modules/feeds HEAD and applied the patches #853194-1 and the patch from #1 cleanly.
I can also not confirm missing upload fields.
So I'd recommend to replace the existing Feeds copy with a fresh checkout, apply both patches (and run update.php for that matter).
I think you've set up your importers right, but to make sure we are on the same page, here is a quick run down on how merging updates should work. Let's say your using geotaxonomy module and you'd like to import term locations with one import, term boundaries with another import.
- Create an importer A for the location import: map name (unique), lat, lon.
- Create another importer B for boundaries import: map name (unique), top boundary, right boundary, bottom boundary, left boundary.
- Import A, then B or vice versa.
If the problem persists, can you post your importer configurations attached as txt files?
Comment #6
TKS commentedSounds like a plan. Will report back after some additional testing.
Comment #7
rjbrown99 commentedI implemented something like this in my custom FeedsNodeProcessor. This issue may be of interest to you as I banged my head against it for hours:
#594004: taxonomy_node_get_terms() needs a $reset param that node_load can call when *it* is reset
Comment #8
TKS commentedalex_b -- After a clean CVS checkout of the module, the patch applied cleanly, and the basic functionality and UI are all there as one would expect.
Shapefiles still disappear whenever a term is modified -- this happens when making a change manually as well as when re-importing a CSV of lat/lon data. It's easy to work around that bug, of course, by re-importing your shapefiles after any other changes are made. But since there's no way to see the status of shapefiles on an Edit Term page, the only way to tell what's missing is to look at an actual map. So it'd be great to find a fix for this.
And in the interim, I'll look for a logical place that a warning message could be placed. (Status messages for any GeoTaxonomy import, perhaps?)
Comment #9
alex_b commentedThe patch here is RTBC then.
I just found the culprit for that: #859472: Geometry field blown away after changes through UI.
Comment #10
alex_b commentedCommitted, thank you.