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
Comment #1
clockwood commentedDid you get anywhere with this? I'm facing a similar situation where I need to flag some nodes during import.
Comment #2
clockwood commentedI 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.
Comment #3
troybthompson commentedHas anyone found another solution? I plan on doing regular feed updates so I'd need something automated.
Comment #4
megachrizMappers for fields/properties provided by a contrib module, should go in that contrib module, so moving this issue to the Flags issue queue.
Comment #5
troybthompson commentedI'd be happy to offer a bounty if someone were interested in writing feeds integration to import flags as well as their associated fields.
Comment #6
joachim commented> 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.
Comment #7
troybthompson commentedSorry, 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.
Comment #8
joachim commentedWeird, I'd have thought it would have Flaggings. Yes, open a new issue please for this please :)
Comment #9
troybthompson commentedDone https://www.drupal.org/node/2408919 Sorry for disrupting this thread.
Comment #10
megachrizNot really. It can create taxonomy terms when mapping to a taxonomy reference field, but it doesn't have a system to automatically create subentities.
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).
Comment #11
megachrizRetitling to distinguish this issue from the other one.
Comment #12
joachim commented> 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.
Comment #13
ivnishDrupal 7 is EOL. No more new features will be added.