Hi,

i extended term_files to use fields in feeds. I wrote an extended Taxonomy Processor to use fields provided by term_fields as "unique target". Patch is attached.

Comments

kthull’s picture

The patch didn't work for me. Here's the output from my terminal:

patch -p0 < term_fields_feeds_integration.patch 
patching file b/feeds/TermFieldsTermProcessor.inc
patching file b/term_fields.feeds.inc
can't find file to patch at input line 147
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/term_fields.module b/term_fields.module
|index 2ebb151..3f52559 100644
|--- a/term_fields.module
|+++ b/term_fields.module
--------------------------
File to patch: term_fields.module
patching file term_fields.module
Hunk #1 succeeded at 1 with fuzz 2.

I was assuming I needed to run the patch against term_fields.module. Maybe that was wrong?

The resulting error was:

Fatal error: require_once() [function.require]: Failed opening required 'term_fields.feeds.inc' (include_path='.:/Applications/MAMP/bin/php5/lib/php') in /Applications/MAMP/htdocs/teamwrangler/sites/all/modules/term_fields/term_fields.module on line 5
webflo’s picture

StatusFileSize
new5.38 KB

I am sorry. The path prefix in this patch was wrong. Here is a new one.

kthull’s picture

Hey no worries. Not sure if I'll get to this for a little while though. Other demons to slay at the moment.
-Kevin

b-prod’s picture

Status: Active » Needs review

I will have a look on your patch soon.
Thanks for helping.

davidseth’s picture

Status: Needs review » Reviewed & tested by the community

Tested your patch and I have successfully added and up-updated 1224 terms in one vocabulary. This vocabulary has four term_fields attached.

b-prod’s picture

I need to understand why you delete the following code:

      if ($op != 'delete') {
        // If for some reason we are presented with a $form_values array that does not contain
        // all the fields for this vocabulary, then we need not be here.
        foreach ($fields as $field) {
          if (!isset($form_values[$field->fid])) {
            return;
          }
        }
      }

Actually I cannot figure why this code exists but it may fix some issue (or not... There is some parts of unecessary code in the module and some others parts to rewrite entirely. But succh stuffs require time I do not have).

DEV version (6.x-1.x-dev) update:
I commented the code above, awaiting your answer.

I put the code directly in the term_fields.module, in a specific group, instead of including the term_fields.feeds.inc file.

Thanks you for testing this DEV version, and if it works as expected, tell me in this issue and I will create a new release.

b-prod’s picture

Issue #869824: Importing term fields tagged as duplicate.

ydnar79’s picture

By any chance, is there any way to import a hierarchical taxonomy with fields using this approach. I was originally looking at the Taxonomy CSV module (which does allow for multiple levels in the taxonomy) but it does not work with term fields.

Now I am looking at the feeds approach....but it seems to only be able to import a flat term taxonomy. (No parent, child relationships.)

By any chance has anyone else attempted to import this kind of taxonomy structure. (with term fields)

Any suggestions or ideas would be GREATLY appreciated.

b-prod’s picture

Sorry I never tried that. Somebody else maybe?

b-prod’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev
Category: feature » task
Status: Reviewed & tested by the community » Needs work

The Feeds integration has moved to the 2.x branch and needs now testing, feedbacks and probably bug fixes.

chingis’s picture

StatusFileSize
new586 bytes

Patch for 6.x-2.2 attached for correct term fields mapping with feeds

b-prod’s picture

Status: Needs work » Fixed

Patch ported in DEV.
I also add code to ignore the file fields from the Feeds mapping target, because such fields need more complex handling than just filling the 'value' element.

Status: Fixed » Closed (fixed)

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