I'm setting up a submission system wherein some fields will be automatically populated based on user-entered data (using computed fields), but I have some already-existing records that I'd like to import. For now, only the CCK fields show up as mappable. Once a node is imported, I can click "edit" then "save" and it'll fill in the blanks based on the imported info, but I'll have too many in the end to do it all manually, so I'm wondering if there's a way around. Is it possible to import data directly into computed fields? Alternatively, is there a way to trigger the computations when the node is uploaded (short of editing each individual record)?

Comments

John Gentilin’s picture

If you follow this thread, http://drupal.org/node/422282, and you willing to write some code,
you can use the hook that I am using to discover the nid, for node updates, to also work
for computed fields.. I have a member DB with no title field, and I create the title field as
a combination of memberid + first name + lastname. Its probably < 20 lines of code in a
separate module.. Its a little crufty, but it will get you there...

-John Gentilin

kathleenmarie’s picture

Thanks very much, John. Oddly enough, I found that when I went back to using rc4 and removed the fields with the 'Date' content type, the computed fields started updating themselves automatically, without additional modifications to the module or anything else. So for now, I'm going to work with my date fields as text rather than playing around with the code!