When a feed imports a field containing a value that doesn't yet match any of the mapped cck list (text) keys, the text of the key is stored in cache_field, cache_form, field_data_field_myfieldname and field_revision_field_myfieldname, but the node can't display the field because no value is mapped to the text that was imported. After editing the field, adding the new key/value, and then manually saving the corresponding node, the field displays the text correctly.

I have a few CCK list (text) fields twill change from time to time without my knowing so in advance, as content editors who will have import access add new keys/values or change/delete existing ones, and I need to come up with a strategy for handling new/changed field values.

One idea I have is to have Rules notify me when a node is created without a valid key for that field, but I don't know where to look in Rules to experiment with that. I could also create a new field called "Changes" and have my editors flag changes there, and then have Rules inform me when something was imported that has certain values in the Changes field.

Can anyone think of a better strategy? One that, ideally, could automate the process of adding/changing cck keys/values upon import?

Comments

silurius’s picture

Title: Handling field values that don't match what's in a mapped in a CCK list (text) field » Handling field values that don't match what's in a mapped CCK list (text) field
silurius’s picture

Turns out Rules can't interact with CCK fields. Interesting that Feeds Import can interact with a variety of things, but can't insert new CCK keys/value pairs. I'm thinking the best solution will be to create my own php code snippet or even a module, and provide a form for the user where they can input text into key/value fields and insert those into the database. A nice-to-have feature would automatically format what's in the value (or label) field and create a key based on that. Until then, I think I'll have to rely on one-off database SQL statements. Fortunately, I already have an Excel spreadsheet that allows me to quickly generate those statements on the fly.

Sorin Sarca’s picture

Status: Active » Closed (won't fix)

This module is Feed Import, you are talking about another module.