I'm trying to figure out the $errors variable. I processing to either halt with a message, or store a message and continue. It looks like the functionality is in place, but I need a few clarifications

I started a page for error reporting from the stuff i can figure out. If you want to just update that in lieu of a reply, that would be good too , or i can fix it later.
http://drupal.org/node/421990

What is the correct format for an $error variable?

What do the different levels mean, and what are the effects?

what is the 'sourceid' field in the *_msg table ?

what is the best way to view messages once they are created?

thanks

Comments

mikeryan’s picture

Quick points, in additional to what you've already written:

The ERROR, WARNING, and NOTICE levels result in the node/user/whatever not being imported - counts of these appear in the Unimported column on the Process page. The idea of the NOTICE level is for cases where unwanted content could not be filtered out in the content set, it could only be identified in the prepare hook. So, if you complete a migration and #notices = total unimported (no errors or warnings), you're good to go...

The INFORMATIONAL level allows the import to complete - counts of these appear in the Imported column. This would be used in cases where you can construct a valid destination object, but there's some condition that may need attention after the fact. The context which caused me to implement this was handling file references (images etc.) in node bodies - my prepare hook checks the files directory to see if the referenced file is present in the expected place; if not, it flags the INFORMATIONAL message, but that's no reason not to create the node...

On viewing the messages - see existing issue #392416: Integrate migration messages with views. I'm hoping to get to that one next week...

Frank, thanks so much for getting the documentation going! Hopefully within the next few days I'll have a chance to review it carefully...

mikeryan’s picture

Status: Active » Fixed

The latest documentation commit covers the migrate_message() function for reporting messages.

Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.