I'm not sure if that is the right place to ask for a mapper, but it seems that flags associated with a node are not mapable. In my case, I have serveral global flags for nodes, so the node itself has the flag on or off. It's not user specific. As an example I have the flag "exclusive". The flags itself are defined in the fields page of that node.

I use an CSV where a field is 1 or 0, which I would like to map to the flag value somehow.

If that is the wrong place, I'll accept also hints which can go in the right direction. I'll propably use a custom mapper. But I thought flags itself is very common, so a generic mapper would be nice.

Comments

clockwood’s picture

Did you get anywhere with this? I'm facing a similar situation where I need to flag some nodes during import.

clockwood’s picture

I found an alternative method using VBO (views bulk operations) which lets you perform batch operations on views results, like add/remove flags, and other sweet things.

In my source CSV file, I also have a field for the flag value (1, 3, or 4 in my case). I added an extra CCK field to my content type to store this value, and mapped it in the Feeds Importer. Then I imported the data via Feeds.

Next, I created a VBO View, added various fields (nid, title, etc), then added the VBO operation "Flag (or unflag) a node (flag_node_action)". I also added my flag field as an exposed Filter in the view. Based on the value I use in that filter, I can operate on different results and add different flags.

Works like a charm! I'm on Drupal 6, but I imagine it would work similarly in D7.

troybthompson’s picture

Issue summary: View changes

Has anyone found another solution? I plan on doing regular feed updates so I'd need something automated.

megachriz’s picture

Title: Flags Mapper needed » Feeds integration
Project: Feeds » Flag
Version: 7.x-2.0-alpha4 » 7.x-3.x-dev
Component: Code » Miscellaneous

Mappers for fields/properties provided by a contrib module, should go in that contrib module, so moving this issue to the Flags issue queue.

troybthompson’s picture

I'd be happy to offer a bounty if someone were interested in writing feeds integration to import flags as well as their associated fields.

joachim’s picture

Status: Active » Postponed (maintainer needs more info)

> feeds integration to import flags as well as their associated fields.

That surely works OOTB, as Flaggings are declared to the Entity API and I imagine Feeds picks that up.

What the OP wants is for flaggings to get imported at the same time as the nodes they are on. For that you either need Feeds to be aware of the relationship (and does Feeds even do relationships between entities?), or the flagging on the node to be declared as some sort of pseudofield.

troybthompson’s picture

Sorry, I guess it's a different case and should be a separate item. I'm looking for a straight flag importer which isn't there. Currently under processors it has comments, nodes, taxonomies, and users. I would expect there to be "flags" on that list.

joachim’s picture

Weird, I'd have thought it would have Flaggings. Yes, open a new issue please for this please :)

troybthompson’s picture

Done https://www.drupal.org/node/2408919 Sorry for disrupting this thread.

megachriz’s picture

and does Feeds even do relationships between entities?

Not really. It can create taxonomy terms when mapping to a taxonomy reference field, but it doesn't have a system to automatically create subentities.

I'm
looking for a straight flag importer which isn't there.  Currently under
processors it has comments, nodes, taxonomies, and users.  I would expect
there to be "flags" on that list.

There is! The 7.x-2.x-dev version has experimental processors for each entity type on the system. They are experimental because not each entity type can be handled in a generic way. 
There are also some issues with it: some parts are not yet implemented, such as using the entity ID as an unique target (you can select this in the UI, but it simply doesn't work).
For the experimental flag processor I found this issue: #2359157: Flag integration: missing mappers for flagged entity and flagging user ??
Maybe this means that it would be a good idea if Flag uses it's own processor instead of a generic one (I haven't study the issue closely).

megachriz’s picture

Title: Feeds integration » Feeds integration: mapper
Related issues: +#2408919: Feeds integration: Flag processor

Retitling to distinguish this issue from the other one.

joachim’s picture

Status: Postponed (maintainer needs more info) » Active

> It can create taxonomy terms when mapping to a taxonomy reference field, but it doesn't have a system to automatically create subentities.

Ok so it sounds like what is being requested in this issue is for Flag to provide the same sort of thing as there is for taxonomy: automatically create Flaggings when an entity is imported.

Presumably this would only be possible for global flags.

ivnish’s picture

Status: Active » Closed (outdated)

Drupal 7 is EOL. No more new features will be added.