When using FeedAPI and the FeedAPI Element Mapper to map tags from a feed to the node being created, those tags do not show up in the Community Tags block.

Comments

geodaniel’s picture

Note that they do get added if I edit the node and save it without making any changes.

SteveK’s picture

also reporting same error but using FileFramework. Tags don't get propagated correctly when programmatically creating nodes. It appears to be failing at community_tags_taxonomy_node_save() or in the nodeapi hook when checking to see if $node->taxonomy['tags'] is available. Since the terms have already been processed, this no longer becomes applicable.

Chris Johnson’s picture

Title: Tags not picked up on nodes tagged by FeedAPI Element Mapper » Tags not picked up on nodes tagged by FeedAPI Element Mapper or File Framework

The issue appears to be that Community Tags module is expecting $node->taxonomy['tags'] to be populated with strings representing the terms, but actually this isn't present if the tags have already been assigned term IDs, as happens in feedapi_mapper_taxonomy.inc.

It seems like community tags should be updated to handle IDs if that's all that's available.

chaps2’s picture

Priority: Normal » Minor

I've tried this with Feeds (the successor to FeedAPI and Feed Element Mapper) and mapped tags displayed in the community tags block without any problem. I haven't tried File Framework yet but as that project is itself alpha I'm marking this as minor.

chaps2’s picture

Status: Active » Fixed

OK, it's starting to make sense now. I observed this behaviour when generating nodes with "devel generate". Terms automatically added to new nodes are added as an array of tids in $node->taxonomy where the community tags module is expecting term names in $node->taxonomy['tags']... which is exactly as described by Chris Johnson #3.

Now fixed in 1.x and 2.x.

Status: Fixed » Closed (fixed)

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