I noticed that a
lot of the heavy lifting for the moduel is done in validate, including the
actual population of the node object with the amazon item information. The only
thing I can think of off the top of my head is to:
Retrieve the
amazon data from scratch whenever a preview is built, based on the known ASIN
value. use the 'Validate' hook to establish whether the asin(s) are valid but do
NOT save, then retrieve the amazon data again and actually save it on submit. It
would entail more round-trips to amazon, but it would work cleanly unless I'm
missing something. Anyone? Thoughts? Corrections? Maybe you're already past that
point and I'm just echoing. :)
Validate did a LOT
of heavy lifting in the old forms system, and that's been reduced with the new
api. It requires reworking some steps in more complicated
modules.
--Jeff
My current task is
figuring out how to properly do the preview when the form is built BEFORE
validation or or submit hooks are invoked and neither hook has access to the
node object, nor do the node validation, insert and update hooks have access
to the form object. And this is my first look at image.module, which is
suggested as an example.
It's weird...I had less problems with the bulk
import form.